As it is important for qemu-iotests that this particular program is used. Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx> --- client/tests/kvm/base.cfg.sample | 1 + client/tests/kvm/tests.cfg.sample | 4 ++++ client/virt/kvm_installer.py | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/base.cfg.sample b/client/tests/kvm/base.cfg.sample index c99add6..21fa513 100644 --- a/client/tests/kvm/base.cfg.sample +++ b/client/tests/kvm/base.cfg.sample @@ -3,6 +3,7 @@ # Absolute paths and/or names of binaries (default path is /usr/bin) qemu_binary = qemu qemu_img_binary = qemu-img +qemu_io_binary = qemu-io # List of virtual machine object names (whitespace seperated) vms = vm1 diff --git a/client/tests/kvm/tests.cfg.sample b/client/tests/kvm/tests.cfg.sample index b011540..bd0d05e 100644 --- a/client/tests/kvm/tests.cfg.sample +++ b/client/tests/kvm/tests.cfg.sample @@ -60,6 +60,7 @@ variants: # We want qemu-kvm for this run qemu_binary = /usr/bin/qemu-kvm qemu_img_binary = /usr/bin/qemu-img + qemu_io_binary = /usr/bin/qemu-io # Only qcow2 file format only qcow2 # Only rtl8139 for nw card (default on qemu-kvm) @@ -82,6 +83,7 @@ variants: # We want qemu for this run qemu_binary = /usr/bin/qemu qemu_img_binary = /usr/bin/qemu-img + qemu_io_binary = /usr/bin/qemu-io only qcow2 # The default nw card for qemu is e1000 only e1000 @@ -100,6 +102,7 @@ variants: # We want qemu-kvm for this run qemu_binary = /usr/bin/qemu-kvm qemu_img_binary = /usr/bin/qemu-img + qemu_io_binary = /usr/bin/qemu-io only qcow2 only rtl8139 only ide @@ -117,6 +120,7 @@ variants: # We want qemu-kvm for this run qemu_binary = /usr/bin/qemu-kvm qemu_img_binary = /usr/bin/qemu-img + qemu_io_binary = /usr/bin/qemu-io only qcow2 only rtl8139 only ide diff --git a/client/virt/kvm_installer.py b/client/virt/kvm_installer.py index 6bebd87..2af359d 100644 --- a/client/virt/kvm_installer.py +++ b/client/virt/kvm_installer.py @@ -32,6 +32,7 @@ class KVMBaseInstaller(base_installer.BaseInstaller): # QEMU_BIN = 'qemu' QEMU_IMG_BIN = 'qemu-img' + QEMU_IO_BIN = 'qemu-io' def _kill_qemu_processes(self): @@ -131,6 +132,23 @@ class KVMBaseInstaller(base_installer.BaseInstaller): return None + def _qemu_io_bin_exists_at_prefix(self): + ''' + Attempts to find the qemu-io binary at the installation prefix + + @return: full path of qemu-io binary or None if not found + ''' + qemu_io_bin_name = os.path.join(self.install_prefix, + 'bin', self.QEMU_IO_BIN) + if os.path.isfile(qemu_io_bin_name): + logging.debug('Found qemu-io binary at %s', qemu_io_bin_name) + return qemu_io_bin_name + else: + logging.debug('Could not find qemu-img binary at prefix %s', + self.install_prefix) + return None + + def _create_symlink_qemu(self): """ Create symbolic links for qemu and qemu-img commands on test bindir @@ -141,6 +159,7 @@ class KVMBaseInstaller(base_installer.BaseInstaller): qemu_dst = os.path.join(self.test_bindir, self.QEMU_BIN) qemu_img_dst = os.path.join(self.test_bindir, self.QEMU_IMG_BIN) + qemu_io_dst = os.path.join(self.test_bindir, self.QEMU_IO_BIN) qemu_bin = self._qemu_bin_exists_at_prefix() if qemu_bin is not None: @@ -154,6 +173,11 @@ class KVMBaseInstaller(base_installer.BaseInstaller): else: raise error.TestError('Invalid qemu-img path') + qemu_io_bin = self._qemu_io_bin_exists_at_prefix() + if qemu_img_bin is not None: + os.symlink(qemu_io_bin, qemu_io_dst) + else: + raise error.TestError('Invalid qemu-img path') def _install_phase_init(self): ''' -- 1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html