=== modified file 'lava_dispatcher/config.py'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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 "$@"