From patchwork Tue Jun 11 12:46:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Terceiro X-Patchwork-Id: 17798 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0B97F25E1A for ; Tue, 11 Jun 2013 12:46:21 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id q12sf3539918vbe.9 for ; Tue, 11 Jun 2013 05:46:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=7JfHMQGGWtTwGiPcwudXrxj8kU/guGRjXA0eNOuS8iM=; b=EymnXCGEKPhb/c+ebyqaPb+Jcrf8omIMU7irgTNmFh/lq4ioL9lUhZ2z4XA2bPHMYA WPuCxOuNKgSACcJVL0cIrszW/OWoGk5j/D0Ka8MNv7jojG5/K6CbY43NnnGszjImC2mP gytLnNJty47ZbYXcRs515GT2yN182ITI0fK5Dj8A5QIHdLr9+AQqoHzXKS7o6yb3foza 1diA/+tMTQPUZtBLLDqu2L8gPoMhKmr3FFHDcbJMCse5OiXdlVXj1BN8BWHKw0NpAjIG O8VqBnSKCoy9hKp99LPDuAEcOgE8SD+Gt5NNYtuM0ZmvJk4u9bfhtQBOCpF0EAjIiamP xCJg== X-Received: by 10.224.86.200 with SMTP id t8mr9554736qal.0.1370954780369; Tue, 11 Jun 2013 05:46:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.103 with SMTP id dz7ls2380001qeb.96.gmail; Tue, 11 Jun 2013 05:46:20 -0700 (PDT) X-Received: by 10.52.243.234 with SMTP id xb10mr6785345vdc.68.1370954780134; Tue, 11 Jun 2013 05:46:20 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id di3si6819211vcb.51.2013.06.11.05.46.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 05:46:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id m17so1181159vca.9 for ; Tue, 11 Jun 2013 05:46:20 -0700 (PDT) X-Received: by 10.52.170.148 with SMTP id am20mr6746225vdc.75.1370954780010; Tue, 11 Jun 2013 05:46:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp107373vcb; Tue, 11 Jun 2013 05:46:19 -0700 (PDT) X-Received: by 10.180.109.195 with SMTP id hu3mr1254539wib.13.1370954778577; Tue, 11 Jun 2013 05:46:18 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id br2si4866116wib.31.2013.06.11.05.46.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Jun 2013 05:46:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UmNxq-0002z7-3B for ; Tue, 11 Jun 2013 12:46:18 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 07C7EE01FF for ; Tue, 11 Jun 2013 12:46:18 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 623 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 623: KVM (aka qemu-system-x86_64) device support Message-Id: <20130611124618.24358.36179.launchpad@ackee.canonical.com> Date: Tue, 11 Jun 2013 12:46:18 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16667"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: e852d40fb4311b059902f3724891cc4053296eec X-Gm-Message-State: ALoCoQk7DLyt6blhbHGkjo/JY1J8oy2OXeO98kppYfp8KM5jaBZjB9p5YNbWBWEThqnbLaQhc5B1 X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Antonio Terceiro (terceiro) Related merge proposals: https://code.launchpad.net/~terceiro/lava-dispatcher/kvm/+merge/167659 proposed by: Antonio Terceiro (terceiro) ------------------------------------------------------------ revno: 623 [merge] committer: Antonio Terceiro branch nick: trunk timestamp: Tue 2013-06-11 09:40:35 -0300 message: KVM (aka qemu-system-x86_64) device support To create images, see: https://git.linaro.org/gitweb?p=lava/lava-vmdebootstrap.git added: lava_dispatcher/default-config/lava-dispatcher/device-types/kvm.conf modified: lava_dispatcher/config.py lava_dispatcher/default-config/lava-dispatcher/device-types/qemu.conf lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf lava_dispatcher/device/qemu.py lava_test_shell/distro/fedora/lava-install-packages lava_test_shell/distro/ubuntu/lava-install-packages --- lp:lava-dispatcher https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk You are subscribed to branch lp:lava-dispatcher. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription === modified file 'lava_dispatcher/config.py' --- lava_dispatcher/config.py 2013-06-04 16:00:29 +0000 +++ lava_dispatcher/config.py 2013-06-05 21:43:24 +0000 @@ -57,6 +57,8 @@ lmc_dev_arg = schema.StringOption() master_str = schema.StringOption(default="root@master") pre_connect_command = schema.StringOption() + qemu_binary = schema.StringOption(default="qemu-system-arm") + qemu_options = schema.StringOption() qemu_drive_interface = schema.StringOption() qemu_machine_type = schema.StringOption() power_on_cmd = schema.StringOption() # for sdmux @@ -136,7 +138,6 @@ class DispatcherSchema(schema.Schema): - default_qemu_binary = schema.StringOption(default="qemu") lava_cachedir = schema.StringOption() lava_cookies = schema.StringOption() lava_image_tmpdir = schema.StringOption() === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/kvm.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/kvm.conf 1970-01-01 00:00:00 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/kvm.conf 2013-06-05 21:43:24 +0000 @@ -0,0 +1,3 @@ +client_type = qemu +qemu_binary = qemu-system-x86_64 +qemu_options = -machine accel=kvm:tcg -hda {DISK_IMAGE} -nographic === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/qemu.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/qemu.conf 2012-06-13 20:47:32 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/qemu.conf 2013-06-05 21:43:24 +0000 @@ -1,6 +1,7 @@ -# NOTE: you also need to set something like: -# DEFAULT_QEMU_BINARY = qemu-system-arm -# in your lava-dispatcher.conf file +client_type=qemu + +qemu_binary = qemu-system-arm +qemu_options = -M %(qemu_machine_type)s -drive if=%(qemu_drive_interface)s,cache=writeback,file={DISK_IMAGE} -clock unix -device usb-kbd -device usb-mouse -usb -device usb-net,netdev=mynet -netdev user,id=mynet -net nic -net user -nographic + qemu_machine_type = beaglexm qemu_drive_interface = sd -client_type=qemu === modified file 'lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf' --- lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf 2012-09-19 18:35:42 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/lava-dispatcher.conf 2013-06-05 21:43:24 +0000 @@ -36,7 +36,3 @@ # Use this variable if you want to use apt-get instead of pip to install lava-test # LAVA_TEST_DEB = lava-test LAVA_TEST_DEB = - -# The qemu command to use. Called 'default_qemu_binary' because we -# want to allow testing custom qemu binaries soon. -default_qemu_binary = qemu-system-arm === modified file 'lava_dispatcher/device/qemu.py' --- lava_dispatcher/device/qemu.py 2013-02-18 03:06:06 +0000 +++ lava_dispatcher/device/qemu.py 2013-06-06 15:10:37 +0000 @@ -69,22 +69,22 @@ extract_targz(tb, '%s/%s' % (mntdir, directory)) def power_on(self): - qemu_cmd = ('%s -M %s -drive if=%s,cache=writeback,file=%s ' - '-clock unix -device usb-kbd -device usb-mouse -usb ' - '-device usb-net,netdev=mynet -netdev user,id=mynet ' - '-net nic -net user -nographic') % ( - self.context.config.default_qemu_binary, - self.config.qemu_machine_type, - self.config.qemu_drive_interface, - self._sd_image) + qemu_options = self.config.qemu_options.format( + DISK_IMAGE=self._sd_image) + qemu_cmd = '%s %s' % (self.config.qemu_binary, qemu_options) logging.info('launching qemu with command %r' % qemu_cmd) proc = self.context.spawn(qemu_cmd, timeout=1200) return proc + def power_off(self, proc): + if proc: + proc.kill(9) + proc.close() + def get_device_version(self): try: output = subprocess.check_output( - [self.context.config.default_qemu_binary, '--version']) + [self.config.qemu_binary, '--version']) matches = re.findall('[0-9]+\.[0-9a-z.+\-:~]+', output) return matches[-1] except subprocess.CalledProcessError: === modified file 'lava_test_shell/distro/fedora/lava-install-packages' --- lava_test_shell/distro/fedora/lava-install-packages 2013-04-16 02:59:05 +0000 +++ lava_test_shell/distro/fedora/lava-install-packages 2013-06-06 14:47:36 +0000 @@ -1,3 +1,3 @@ #!/bin/sh -sudo yum -e 0 -y -q install "$@" +yum -e 0 -y -q install "$@" === modified file 'lava_test_shell/distro/ubuntu/lava-install-packages' --- lava_test_shell/distro/ubuntu/lava-install-packages 2013-04-15 19:16:44 +0000 +++ lava_test_shell/distro/ubuntu/lava-install-packages 2013-06-06 14:47:36 +0000 @@ -1,4 +1,4 @@ #!/bin/sh -sudo DEBIAN_FRONTEND=noninteractive apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -q "$@" +DEBIAN_FRONTEND=noninteractive apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y -q "$@"