]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Don't compare CPU against host for TCG
authorCole Robinson <crobinso@redhat.com>
Tue, 23 Sep 2014 17:07:09 +0000 (13:07 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 3 Oct 2014 15:30:29 +0000 (11:30 -0400)
Right now when building the qemu command line, we try to do various
unconditional validations of the guest CPU against the host CPU. However
this checks are overly applied. The only time we should use the checks
are:

- The user requests host-model/host-passthrough, or

- When KVM is requsted. CPU features requested in TCG mode are always
  emulated by qemu and are independent of the host CPU, so no host CPU
  checks should be performed.

Right now if trying to specify a CPU for arm on an x86 host, it attempts
to do non-sensical validation and falls over.

Switch all the test cases that were intending to test CPU validation to
use KVM, so they continue to test the intended code.

Amend some aarch64 XML tests with a CPU model, to ensure things work
correctly.

25 files changed:
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args
tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml
tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args
tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-nofallback.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml

index db5ea35be97bd4b23401d1c6de39d922bfdbd793..cd3444574ff3cf4f7cd5e0ca9ec9146589a956ac 100644 (file)
@@ -6160,6 +6160,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
     virCPUCompareResult cmp;
     const char *preferred;
     virCapsPtr caps = NULL;
+    bool compareAgainstHost = (def->virtType == VIR_DOMAIN_VIRT_KVM ||
+        def->cpu->mode != VIR_CPU_MODE_CUSTOM);
 
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         goto cleanup;
@@ -6182,30 +6184,33 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
         cpuUpdate(cpu, host) < 0)
         goto cleanup;
 
-    cmp = cpuGuestData(host, cpu, &data, &compare_msg);
-    switch (cmp) {
-    case VIR_CPU_COMPARE_INCOMPATIBLE:
-        if (compare_msg) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("guest and host CPU are not compatible: %s"),
-                           compare_msg);
-        } else {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("guest CPU is not compatible with host CPU"));
-        }
-        /* fall through */
-    case VIR_CPU_COMPARE_ERROR:
-        goto cleanup;
+    /* For non-KVM, CPU features are emulated, so host compat doesn't matter */
+    if (compareAgainstHost) {
+        cmp = cpuGuestData(host, cpu, &data, &compare_msg);
+        switch (cmp) {
+        case VIR_CPU_COMPARE_INCOMPATIBLE:
+            if (compare_msg) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                               _("guest and host CPU are not compatible: %s"),
+                               compare_msg);
+            } else {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("guest CPU is not compatible with host CPU"));
+            }
+            /* fall through */
+        case VIR_CPU_COMPARE_ERROR:
+            goto cleanup;
 
-    default:
-        break;
+        default:
+            break;
+        }
     }
 
     /* Only 'svm' requires --enable-nesting. The nested
      * 'vmx' patches now simply hook off the CPU features
      */
-    if (def->os.arch == VIR_ARCH_X86_64 ||
-        def->os.arch == VIR_ARCH_I686) {
+    if ((def->os.arch == VIR_ARCH_X86_64 || def->os.arch == VIR_ARCH_I686) &&
+         compareAgainstHost) {
         int hasSVM = cpuHasFeature(data, "svm");
         if (hasSVM < 0)
             goto cleanup;
@@ -6233,16 +6238,23 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
         if (VIR_STRDUP(guest->vendor_id, cpu->vendor_id) < 0)
             goto cleanup;
 
-        guest->arch = host->arch;
-        if (cpu->match == VIR_CPU_MATCH_MINIMUM)
-            preferred = host->model;
-        else
-            preferred = cpu->model;
+        if (compareAgainstHost) {
+            guest->arch = host->arch;
+            if (cpu->match == VIR_CPU_MATCH_MINIMUM)
+                preferred = host->model;
+            else
+                preferred = cpu->model;
 
-        guest->type = VIR_CPU_TYPE_GUEST;
-        guest->fallback = cpu->fallback;
-        if (cpuDecode(guest, data, (const char **)cpus, ncpus, preferred) < 0)
-            goto cleanup;
+            guest->type = VIR_CPU_TYPE_GUEST;
+            guest->fallback = cpu->fallback;
+            if (cpuDecode(guest, data,
+                          (const char **)cpus, ncpus, preferred) < 0)
+                goto cleanup;
+        } else {
+            guest->arch = def->os.arch;
+            if (VIR_STRDUP(guest->model, cpu->model) < 0)
+                goto cleanup;
+        }
 
         virBufferAdd(buf, guest->model, -1);
         if (guest->vendor_id)
@@ -6259,7 +6271,7 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
     }
 
     ret = 0;
-cleanup:
+ cleanup:
     virObjectUnref(caps);
     VIR_FREE(compare_msg);
     cpuDataFree(data);
index d4d403b7716690d0129a6e171f2d98c5697c7b1f..8cb57c5c8d5d00a9c4a7a38d23e28010dfde1511 100644 (file)
@@ -1,5 +1,6 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-aarch64 -S -M virt -m 1024 -smp 1 -nographic \
+/usr/bin/qemu-system-aarch64 -S -M virt -cpu cortex-a53 \
+-m 1024 -smp 1 -nographic \
 -nodefconfig -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \
 -boot c -kernel /aarch64.kernel -initrd /aarch64.initrd -append console=ttyAMA0 \
 -usb -device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \
index 868de9497a7b5120ab63950d989056d855a64d95..3a6f098d0767378e012137b510baf7f07e724633 100644 (file)
@@ -7,6 +7,9 @@
   <features>
     <acpi/>
   </features>
+  <cpu match='exact'>
+    <model>cortex-a53</model>
+  </cpu>
   <os>
     <type arch="aarch64" machine="virt">hvm</type>
     <kernel>/aarch64.kernel</kernel>
index afd6e41a5dd6ae18510b1fba7ad191a67fe5d9ce..05f3629803a5f82ef187946c87004426a0fbdc17 100644 (file)
@@ -1,5 +1,6 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-aarch64 -S -M virt -m 1024 -smp 1 -nographic \
+/usr/bin/qemu-system-aarch64 -S -M virt -cpu cortex-a53 \
+-m 1024 -smp 1 -nographic \
 -nodefconfig -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \
 -boot c -kernel /aarch64.kernel -initrd /aarch64.initrd -append \
 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
index 184b62cd45c966f74f972f6efb8840819e8b2b14..ad34615128a5d9dc71f9363c16f9653f4d584388 100644 (file)
@@ -16,6 +16,9 @@
     <apic/>
     <pae/>
   </features>
+  <cpu match='exact'>
+    <model>cortex-a53</model>
+  </cpu>
   <clock offset="utc"/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
index 76c2c48435c0fd1b870f6102029e3ced8f925108..0a58616356f3f0ca15ada56dd83ac7fe9179d633 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc \
+/usr/bin/qemu-kvm -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 -usb -net \
 none -serial none -parallel none
index ddd9d5ad3541b0f2ac26a9c7c0bbf4e6bff7b55f..1d1e81571c00fd8198e4985bebf67326ef737ea0 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -23,6 +23,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 0e37379676d535bab24d7ba55913fc9ca333a26f..e46527b56ef5e3a109911188039dcf0554ef94a0 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc \
+/usr/bin/qemu-kvm -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 -usb -net \
 none -serial none -parallel none
index de4c8d2fff8bdeb94eaf30da2b5a3390a8b9e205..6b9b7d4c6445c91e45ff5de0969561b61a26ccb0 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -30,6 +30,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 0e37379676d535bab24d7ba55913fc9ca333a26f..e46527b56ef5e3a109911188039dcf0554ef94a0 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc \
+/usr/bin/qemu-kvm -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 -usb -net \
 none -serial none -parallel none
index e027e6fcd38519c2c75e47407ab42533b9e4f8ac..eaea564f60daec7aaa0b83da8396cfee5a6c81d1 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -30,6 +30,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 4ee8391842c6d3f7b453bdd5138653ad9c288bb4..ead561f44203ea655976c76ce07ed8d933bd1318 100644 (file)
@@ -3,7 +3,7 @@ PATH=/bin \
 HOME=/home/test \
 USER=test \
 LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu \
+/usr/bin/qemu-kvm \
 -S \
 -M pc \
 -cpu Penryn,-sse4.1 \
index 6125f41f65b1790442e2b23e0aad601972097c97..85642e9a9f0285b1ff7be09541eb463931bab6ba 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -20,6 +20,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 0630ef46b1b6150f818a0ed02c77950b65d69276..d8207e73ce2a6fd7515d08a31529816f68b479ef 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc \
+/usr/bin/qemu-kvm -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 -usb -net none -serial none -parallel none
index 4ba5d0b14f2454d4a6a9809214000a470641c8c1..5879d35479c04935e629ee98e6a2e971ce85ad78 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -16,6 +16,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 830994f72d1722a1d3b7968525fe7c4c41878acd..17ba2568fbe9d8763eb610cd31b8a701d7c272b7 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc \
+/usr/bin/qemu-kvm -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 -usb -net none -serial none \
index c43bf4f80efb3bbcd17ad36501bcfa3e93d98348..b8bbf25acbbac6fcbe8f48b343d41912729741e0 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -20,6 +20,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 4ae0be8b23b181023c773c74588ce08210cf1f27..abb0e9c2d2c3f05a886e1e7aa98cf5ac919684a5 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
index 8b545a795e772dd71dc6f14b2a7b925e3a39e11b..c500ef72b134a6d068d0b24b3d3076345cefc313 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc \
+/usr/bin/qemu-kvm -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 -usb -net none -serial none -parallel none
index 935f46fb9590469f27f6be82bfeb19aa80470206..a9fc9c5291ecd53bde1e5020f8e6e542520ec09e 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>QEMUGuest1</name>
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
@@ -33,6 +33,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu</emulator>
+      <emulator>/usr/bin/qemu-kvm</emulator>
   </devices>
 </domain>
index 48744b2f3271fbc9210387034710a29adef631bf..8b5d9ee25fa0a11321a70b24341075bf37bd6b22 100644 (file)
@@ -1,5 +1,5 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \
-/usr/bin/qemu -S -M pc -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,\
+/usr/bin/qemu-kvm -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 \
index e6ecbed5878bf5a7ec309057a06062840a3aa249..3ed864c93b4f836866c59e5fb6d63fcfd819c1fe 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>f14</name>
   <uuid>553effab-b5e1-2d80-dfe3-da4344826c43</uuid>
   <memory unit='KiB'>1048576</memory>
@@ -38,7 +38,7 @@
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu</emulator>
+    <emulator>/usr/bin/qemu-kvm</emulator>
     <disk type='file' device='disk'>
       <driver name='qemu' type='qcow2'/>
       <source file='/var/lib/libvirt/images/f14.img'/>
index 1e0968068a195161c95a370240c2dfb2cccce8c7..992729442a55f77fac8396aa19c4efd2a79fe2d4 100644 (file)
@@ -1,6 +1,6 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
-/usr/bin/qemu-system-ppc64 -S -M pseries -cpu POWER7_v2.3 -m 512 -smp 1 -nographic \
--nodefconfig -nodefaults \
+QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries -cpu POWER7_v2.3 \
+-m 512 -smp 1 -nographic -nodefconfig -nodefaults \
 -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
 -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \
 -chardev pty,id=charserial0 \
index b380fd86cfc0610f00547422dd84cf8722444b37..483ca90324ce716a288769bb77bcabf71ccb36b8 100644 (file)
@@ -933,7 +933,7 @@ mymain(void)
             QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE,
             QEMU_CAPS_DEVICE_QXL);
     DO_TEST("graphics-spice-timeout",
-            QEMU_CAPS_DRIVE,
+            QEMU_CAPS_KVM, QEMU_CAPS_DRIVE,
             QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL,
             QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE,
             QEMU_CAPS_DEVICE_QXL_VGA);
@@ -1208,14 +1208,14 @@ mymain(void)
     DO_TEST("cpu-topology1", QEMU_CAPS_SMP_TOPOLOGY);
     DO_TEST("cpu-topology2", QEMU_CAPS_SMP_TOPOLOGY);
     DO_TEST("cpu-topology3", NONE);
-    DO_TEST("cpu-minimum1", NONE);
-    DO_TEST("cpu-minimum2", NONE);
-    DO_TEST("cpu-exact1", NONE);
-    DO_TEST("cpu-exact2", NONE);
-    DO_TEST("cpu-exact2-nofallback", NONE);
-    DO_TEST("cpu-fallback", NONE);
-    DO_TEST_FAILURE("cpu-nofallback", NONE);
-    DO_TEST("cpu-strict1", NONE);
+    DO_TEST("cpu-minimum1", QEMU_CAPS_KVM);
+    DO_TEST("cpu-minimum2", QEMU_CAPS_KVM);
+    DO_TEST("cpu-exact1", QEMU_CAPS_KVM);
+    DO_TEST("cpu-exact2", QEMU_CAPS_KVM);
+    DO_TEST("cpu-exact2-nofallback", QEMU_CAPS_KVM);
+    DO_TEST("cpu-fallback", QEMU_CAPS_KVM);
+    DO_TEST_FAILURE("cpu-nofallback", QEMU_CAPS_KVM);
+    DO_TEST("cpu-strict1", QEMU_CAPS_KVM);
     DO_TEST("cpu-numa1", NONE);
     DO_TEST("cpu-numa2", QEMU_CAPS_SMP_TOPOLOGY);
     DO_TEST_PARSE_ERROR("cpu-numa3", NONE);
@@ -1303,7 +1303,8 @@ mymain(void)
     DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI,
             QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_CHARDEV,
             QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
-    DO_TEST_FAILURE("pseries-cpu-exact", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+    DO_TEST("pseries-cpu-exact", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
+            QEMU_CAPS_NODEFCONFIG);
     DO_TEST("disk-ide-drive-split",
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_IDE_CD);
index 44c4cf77fabeb91e606fba9a3c676141fe4dd8c7..73ebcab9e3e1c5160e5ef34050f37601415331ac 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='qemu'>
+<domain type='kvm'>
   <name>f14</name>
   <uuid>553effab-b5e1-2d80-dfe3-da4344826c43</uuid>
   <memory unit='KiB'>1048576</memory>
@@ -38,7 +38,7 @@
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu</emulator>
+    <emulator>/usr/bin/qemu-kvm</emulator>
     <disk type='file' device='disk'>
       <driver name='qemu' type='qcow2'/>
       <source file='/var/lib/libvirt/images/f14.img'/>