From 55849876b90b55f2fda5c6736d7d9b1c173d6514 Mon Sep 17 00:00:00 2001 From: Benjamin Michael Cooper Date: Thu, 29 Jun 2017 14:30:51 +0100 Subject: [PATCH] Configurable virtualisation Allows qemu to be specified instead of kvm when hardware virtualisation is not available. Change-Id: I44c6c3ed60581cdb336e55161a2cce1d68903528 --- etc/ramdisk-func-test/ramdisk-func-test.conf.sample | 3 +++ ramdisk_func_test/node.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/etc/ramdisk-func-test/ramdisk-func-test.conf.sample b/etc/ramdisk-func-test/ramdisk-func-test.conf.sample index e203aa3..51e0c4e 100644 --- a/etc/ramdisk-func-test/ramdisk-func-test.conf.sample +++ b/etc/ramdisk-func-test/ramdisk-func-test.conf.sample @@ -1,5 +1,8 @@ [DEFAULT] +# Node domain type (qemu or kvm). +#node_domain_type = kvm + # Path where virtualized node disks will be stored #ramdisk_func_test_workdir = /tmp/ramdisk-func-test/ diff --git a/ramdisk_func_test/node.py b/ramdisk_func_test/node.py index 3fd9e26..1a75156 100644 --- a/ramdisk_func_test/node.py +++ b/ramdisk_func_test/node.py @@ -31,6 +31,9 @@ from ramdisk_func_test import utils CONF = conf.CONF CONF.register_opts([ + cfg.StrOpt('node_domain_type', + help='Node domain type (qemu or kvm).', + default='kvm'), cfg.IntOpt('node_boot_timeout', help='Time to wait slave node to boot (seconds)', default=360), @@ -58,6 +61,7 @@ class Node(base.LibvirtBase): self.console_log = os.path.join(self.workdir, "console.log") xml = self.jinja_env.get_template(template).render( + domain_type=CONF.node_domain_type, mac_addr=self.mac, network_name=network, node_name=self.name,