From: "Daniel P. Berrange" <berrange(a)redhat.com>
When launching a QEMU guest the binary is probed to discover
the list of supported CPU names. Remove this probing with a
simple lookup of CPU models in the qemuCapsPtr object. This
avoids another invocation of the QEMU binary during the
startup path.
As a nice benefit we can now remove all the nasty hacks from
the test suite which were done to avoid having to exec QEMU
on the test system. The building of the -cpu command line
can just rely on data we pre-populate in qemuCapsPtr.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 18 ++++++++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 18 ++------
tests/qemuxml2argvdata/qemu-lib.sh | 50 ---------------------
tests/qemuxml2argvdata/qemu-supported-cpus.sh | 15 -------
tests/qemuxml2argvdata/qemu.sh | 15 -------
.../qemuxml2argv-cpu-eoi-disabled.args | 2 +-
.../qemuxml2argv-cpu-eoi-disabled.xml | 2 +-
.../qemuxml2argv-cpu-eoi-enabled.args | 2 +-
.../qemuxml2argv-cpu-eoi-enabled.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-exact1.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml | 2 +-
.../qemuxml2argv-cpu-exact2-nofallback.args | 2 +-
.../qemuxml2argv-cpu-exact2-nofallback.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-exact2.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml | 2 +-
.../qemuxml2argv-cpu-fallback.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml | 2 +-
.../qemuxml2argv-cpu-host-kvmclock.args | 2 +-
.../qemuxml2argv-cpu-host-kvmclock.xml | 2 +-
.../qemuxml2argv-cpu-host-model-fallback.args | 2 +-
.../qemuxml2argv-cpu-host-model-fallback.xml | 2 +-
.../qemuxml2argv-cpu-host-model-nofallback.xml | 2 +-
.../qemuxml2argv-cpu-host-model.args | 2 +-
.../qemuxml2argv-cpu-host-model.xml | 2 +-
.../qemuxml2argv-cpu-host-passthrough.args | 2 +-
.../qemuxml2argv-cpu-host-passthrough.xml | 2 +-
.../qemuxml2argv-cpu-kvmclock.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml | 2 +-
.../qemuxml2argv-cpu-minimum1.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml | 2 +-
.../qemuxml2argv-cpu-minimum2.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml | 2 +-
.../qemuxml2argv-cpu-nofallback.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml | 2 +-
.../qemuxml2argv-cpu-qemu-host-passthrough.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml | 2 +-
.../qemuxml2argv-cpu-topology1.args | 2 +-
.../qemuxml2argv-cpu-topology1.xml | 2 +-
.../qemuxml2argv-cpu-topology2.args | 2 +-
.../qemuxml2argv-cpu-topology2.xml | 2 +-
.../qemuxml2argv-cpu-topology3.args | 2 +-
.../qemuxml2argv-cpu-topology3.xml | 2 +-
.../qemuxml2argv-eoi-disabled.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-eoi-enabled.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml | 2 +-
.../qemuxml2argv-graphics-spice-timeout.args | 2 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 2 +-
tests/qemuxml2argvtest.c | 52 +++++++++++++---------
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
55 files changed, 104 insertions(+), 162 deletions(-)
delete mode 100644 tests/qemuxml2argvdata/qemu-lib.sh
delete mode 100755 tests/qemuxml2argvdata/qemu-supported-cpus.sh
delete mode 100755 tests/qemuxml2argvdata/qemu.sh
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 50d3e92..888c56c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1680,6 +1680,24 @@ unsigned int qemuCapsGetKVMVersion(qemuCapsPtr caps)
}
+int qemuCapsAddCPUDefinition(qemuCapsPtr caps,
+ const char *name)
+{
+ char *tmp = strdup(name);
+ if (!tmp) {
+ virReportOOMError();
+ return -1;
+ }
+ if (VIR_EXPAND_N(caps->cpuDefinitions, caps->ncpuDefinitions, 1) < 0) {
+ VIR_FREE(tmp);
+ virReportOOMError();
+ return -1;
+ }
+ caps->cpuDefinitions[caps->ncpuDefinitions-1] = tmp;
+ return 0;
+}
+
+
size_t qemuCapsGetCPUDefinitions(qemuCapsPtr caps,
char ***names)
{
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 4b96662..24591d8 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -179,6 +179,8 @@ const char *qemuCapsGetBinary(qemuCapsPtr caps);
const char *qemuCapsGetArch(qemuCapsPtr caps);
unsigned int qemuCapsGetVersion(qemuCapsPtr caps);
unsigned int qemuCapsGetKVMVersion(qemuCapsPtr caps);
+int qemuCapsAddCPUDefinition(qemuCapsPtr caps,
+ const char *name);
size_t qemuCapsGetCPUDefinitions(qemuCapsPtr caps,
char ***names);
size_t qemuCapsGetMachineTypes(qemuCapsPtr caps,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index dd043a1..c73034d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4067,7 +4067,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
virCPUDefPtr guest = NULL;
virCPUDefPtr cpu = NULL;
size_t ncpus = 0;
- const char **cpus = NULL;
+ char **cpus = NULL;
const char *default_model;
union cpuData *data = NULL;
bool have_cpu = false;
@@ -4089,12 +4089,8 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
const char *preferred;
int hasSVM;
- if (host &&
- qemuCapsProbeCPUModels(emulator, caps, host->arch,
- &ncpus, &cpus) < 0)
- goto cleanup;
-
- if (!ncpus || !host) {
+ if (!host ||
+ (ncpus = qemuCapsGetCPUDefinitions(caps, &cpus)) == 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("CPU specification not supported by
hypervisor"));
goto cleanup;
@@ -4163,7 +4159,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
guest->type = VIR_CPU_TYPE_GUEST;
guest->fallback = cpu->fallback;
- if (cpuDecode(guest, data, cpus, ncpus, preferred) < 0)
+ if (cpuDecode(guest, data, (const char **)cpus, ncpus, preferred) < 0)
goto cleanup;
virBufferAdd(&buf, guest->model, -1);
@@ -4244,12 +4240,6 @@ cleanup:
virCPUDefFree(guest);
virCPUDefFree(cpu);
- if (cpus) {
- for (i = 0; i < ncpus; i++)
- VIR_FREE(cpus[i]);
- VIR_FREE(cpus);
- }
-
return ret;
no_memory:
diff --git a/tests/qemuxml2argvdata/qemu-lib.sh b/tests/qemuxml2argvdata/qemu-lib.sh
deleted file mode 100644
index ba19119..0000000
--- a/tests/qemuxml2argvdata/qemu-lib.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-candidates="/usr/bin/qemu-kvm
- /usr/libexec/qemu-kvm
- /usr/bin/qemu-system-x86_64
- /usr/bin/qemu"
-qemu=
-for candidate in $candidates; do
- if test -x $candidate; then
- qemu=$candidate
- break
- fi
-done
-
-real_qemu()
-{
- if test x$qemu != x; then
- exec $qemu "$@"
- else
- return 1
- fi
-}
-
-faked_machine()
-{
- echo "pc"
-}
-
-faked_cpu()
-{
- cat <<EOF
-x86 Opteron_G3
-x86 Opteron_G2
-x86 Opteron_G1
-x86 Nehalem
-x86 Penryn
-x86 Conroe
-x86 [n270]
-x86 [athlon]
-x86 [pentium3]
-x86 [pentium2]
-x86 [pentium]
-x86 [486]
-x86 [coreduo]
-x86 [qemu32]
-x86 [kvm64]
-x86 [core2duo]
-x86 [phenom]
-x86 [qemu64]
-x86 [host]
-EOF
-}
diff --git a/tests/qemuxml2argvdata/qemu-supported-cpus.sh
b/tests/qemuxml2argvdata/qemu-supported-cpus.sh
deleted file mode 100755
index 0204f51..0000000
--- a/tests/qemuxml2argvdata/qemu-supported-cpus.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/sh
-
-. ${0%/*}/qemu-lib.sh
-
-case $* in
-"-M ?")
- faked_machine
- ;;
-"-cpu ?")
- faked_cpu | grep -Fv '['
- ;;
-*)
- real_qemu "$@"
- ;;
-esac
diff --git a/tests/qemuxml2argvdata/qemu.sh b/tests/qemuxml2argvdata/qemu.sh
deleted file mode 100755
index 5928c1b..0000000
--- a/tests/qemuxml2argvdata/qemu.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/sh
-
-. ${0%/*}/qemu-lib.sh
-
-case $* in
-"-M ?")
- faked_machine
- ;;
-"-cpu ?")
- faked_cpu
- ;;
-*)
- real_qemu "$@"
- ;;
-esac
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args
index 6d57f91..aee85c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu qemu32,-kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -boot n -net none -serial none \
-parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
index 467df30..5e5bc04 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
@@ -21,7 +21,7 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args
index 3dc4310..3442caf 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu qemu32,+kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -boot n -net none -serial none \
-parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
index 1ed630a..ecc542e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
@@ -21,7 +21,7 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
index 83f848f..fce9ad1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu qemu64,-svm,-lm,-nx,-syscall,-clflush,-pse36,-mca -m 214 -smp 6 \
-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net \
none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
index 9165fe3..ddd9d5a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
@@ -23,6 +23,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
index 198d0d8..7f91bc7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+ds_cpl,+tm,+ht,+ds,-nx -m 214 -smp 6 \
-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net \
none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.xml
index 67785a9..de4c8d2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.xml
@@ -30,6 +30,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
index 198d0d8..7f91bc7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+ds_cpl,+tm,+ht,+ds,-nx -m 214 -smp 6 \
-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net \
none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
index 575541a..e027e6f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
@@ -30,6 +30,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args
index 658f141..fe1b470 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args
@@ -3,7 +3,7 @@ PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test \
-./qemu.sh \
+/usr/bin/qemu \
-S \
-M pc \
-cpu Penryn,-sse4.1 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml
index 8f5987b..6125f41 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml
@@ -20,6 +20,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args
index 8472b8a..5e1e759 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu host,-kvmclock -enable-kvm -m 214 -smp 6 \
-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net \
none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
index cfbf440..16d71a3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
@@ -17,7 +17,7 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
index ac8ab1a..6ec201a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
@@ -3,7 +3,7 @@ PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test \
-./qemu-supported-cpus.sh \
+/usr/bin/qemu \
-S \
-M pc \
-cpu Penryn,+xtpr,+tm2,+est,+vmx,+ds_cpl,+monitor,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme,-sse4.1
\
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.xml
index 41d455f..a1136e2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.xml
@@ -14,6 +14,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu-supported-cpus.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-nofallback.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-nofallback.xml
index e2b4b83..d0219d5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-nofallback.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-nofallback.xml
@@ -16,6 +16,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu-supported-cpus.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
index cf7eb2a..426c1c0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
@@ -3,7 +3,7 @@ PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test \
-./qemu.sh \
+/usr/bin/qemu \
-S \
-M pc \
-cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.xml
index b7b95d7..7e3f617 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.xml
@@ -14,6 +14,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args
index c63ecce..a7c6a6a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args
@@ -3,7 +3,7 @@ PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test \
-./qemu.sh \
+/usr/bin/qemu \
-S \
-M pc \
-cpu host \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.xml
index f591a17..f1233e1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.xml
@@ -14,6 +14,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args
index 6816c00..16bcc44 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo,-kvmclock -enable-kvm -m 214 -smp 6 \
-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net \
none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
index 304d88c..0bbe8e0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
@@ -18,7 +18,7 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
index df57c48..22b6a1e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,\
+acpi,+ds -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,\
nowait -no-acpi -boot n -net none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
index 42026ab..4ba5d0b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
@@ -16,6 +16,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
index 9fb1648..cd615a2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,\
+acpi,+ds,-lm,-nx,-syscall -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
index beb0551..c43bf4f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
@@ -20,6 +20,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-nofallback.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-nofallback.xml
index 31db010..4ae0be8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-nofallback.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-nofallback.xml
@@ -20,6 +20,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args
index 7c0dd30..db70657 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-m 214 -smp 16 -numa node,nodeid=0,cpus=0-7,mem=107 \
-numa node,nodeid=1,cpus=8-15,mem=107 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
index 53cc294..ee402c8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
@@ -20,6 +20,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args
index 2ac2568..1b2154d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-m 214 -smp 16,sockets=2,cores=4,threads=2 \
-numa node,nodeid=0,cpus=0-7,mem=107 \
-numa node,nodeid=1,cpus=8-15,mem=107 -nographic -monitor \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
index 53cc294..ee402c8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
@@ -20,6 +20,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-qemu-host-passthrough.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-qemu-host-passthrough.xml
index b8fbc51..7652a97 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-qemu-host-passthrough.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-qemu-host-passthrough.xml
@@ -14,6 +14,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
index 3d0c61a..41a6749 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+est,+vmx,+ds_cpl,+tm,+ht,+acpi,+ds,-nx \
-m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot n -net none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
index 02df183..935f46f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
@@ -33,6 +33,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
index 25e56ab..89f07a9 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-m 214 -smp 6,sockets=3,cores=2,threads=1 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none \
-parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
index 64783d1..6f70aa3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
@@ -16,6 +16,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
index 348b757..8a65ae2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu core2duo -m 214 -smp 6,sockets=1,cores=2,threads=3 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none \
-parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
index 6f16308..ab561fd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
@@ -17,6 +17,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
index 57b2eea..21e51c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
@@ -1,3 +1,3 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot n -net none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
index 64783d1..6f70aa3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
@@ -16,6 +16,6 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args
b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args
index 93475bd..1d610f6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu qemu32,-kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -boot n -net none -serial \
none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
index f84570e..3173a41 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
@@ -18,7 +18,7 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args
b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args
index 13f570b..02c8da3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args
@@ -1,4 +1,4 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc \
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
-cpu qemu32,+kvm_pv_eoi -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -boot n -net none -serial \
none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
index 03b6b52..22f0803 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
@@ -18,7 +18,7 @@
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
index ebda714..453805a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
@@ -1,5 +1,5 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \
-./qemu.sh -S -M pc -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,\
+/usr/bin/qemu -S -M pc -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,\
+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds \
-m 1024 -smp 2 -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \
-boot dc -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
index b4a75f4..f9fdf37 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
@@ -38,7 +38,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/f14.img'/>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 1ef4e91..c42774b 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -106,26 +106,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
goto out;
}
- /*
- * For test purposes, we may want to fake emulator's output by providing
- * our own script instead of a real emulator. For this to work we need to
- * specify a relative path in <emulator/> element, which, however, is not
- * allowed by RelaxNG schema for domain XML. To work around it we add an
- * extra '/' at the beginning of relative emulator path so that it looks
- * like, e.g., "/./qemu.sh" or "/../emulator/qemu.sh" instead of
- * "./qemu.sh" or "../emulator/qemu.sh" respectively. The
following code
- * detects such paths, strips the extra '/' and makes the path absolute.
- */
- if (vmdef->emulator && STRPREFIX(vmdef->emulator, "/.")) {
- if (!(emulator = strdup(vmdef->emulator + 1)))
- goto out;
- VIR_FREE(vmdef->emulator);
- vmdef->emulator = NULL;
- if (virAsprintf(&vmdef->emulator, "%s/qemuxml2argvdata/%s",
- abs_srcdir, emulator) < 0)
- goto out;
- }
-
if (qemuCapsGet(extraFlags, QEMU_CAPS_DOMID))
vmdef->id = 6;
else
@@ -274,12 +254,40 @@ cleanup:
}
+static int
+testAddCPUModels(qemuCapsPtr caps, bool skipLegacy)
+{
+ const char *newModels[] = {
+ "Opteron_G3", "Opteron_G2", "Opteron_G1",
+ "Nehalem", "Penryn", "Conroe",
+ };
+ const char *legacyModels[] = {
+ "n270", "athlon", "pentium3", "pentium2",
"pentium",
+ "486", "coreduo", "kvm32", "qemu32",
"kvm64",
+ "core2duo", "phenom", "qemu64",
+ };
+ size_t i;
+
+ for (i = 0 ; i < ARRAY_CARDINALITY(newModels) ; i++) {
+ if (qemuCapsAddCPUDefinition(caps, newModels[i]) < 0)
+ return -1;
+ }
+ if (skipLegacy)
+ return 0;
+ for (i = 0 ; i < ARRAY_CARDINALITY(legacyModels) ; i++) {
+ if (qemuCapsAddCPUDefinition(caps, legacyModels[i]) < 0)
+ return -1;
+ }
+ return 0;
+}
+
static int
mymain(void)
{
int ret = 0;
char *map = NULL;
+ bool skipLegacyCPUs = false;
abs_top_srcdir = getenv("abs_top_srcdir");
if (!abs_top_srcdir)
@@ -311,6 +319,8 @@ mymain(void)
}; \
if (!(info.extraFlags = qemuCapsNew())) \
return EXIT_FAILURE; \
+ if (testAddCPUModels(info.extraFlags, skipLegacyCPUs) < 0) \
+ return EXIT_FAILURE; \
qemuCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST); \
if (virtTestRun("QEMU XML-2-ARGV " name, \
1, testCompareXMLToArgvHelper, &info) < 0) \
@@ -770,8 +780,10 @@ mymain(void)
DO_TEST("cpu-numa1", NONE);
DO_TEST("cpu-numa2", QEMU_CAPS_SMP_TOPOLOGY);
DO_TEST("cpu-host-model", NONE);
+ skipLegacyCPUs = true;
DO_TEST("cpu-host-model-fallback", NONE);
DO_TEST_FAILURE("cpu-host-model-nofallback", NONE);
+ skipLegacyCPUs = false;
DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);
DO_TEST_FAILURE("cpu-host-passthrough", NONE);
DO_TEST_FAILURE("cpu-qemu-host-passthrough",
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
index 574d474..cd19b64 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
@@ -38,7 +38,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/./qemu.sh</emulator>
+ <emulator>/usr/bin/qemu</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/f14.img'/>
--
1.7.11.4