render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
99cbc7
From 479f1a10b13e3029ea71003bdd8d1158711816d8 Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <479f1a10b13e3029ea71003bdd8d1158711816d8@dist-git>
99cbc7
From: Andrea Bolognani <abologna@redhat.com>
99cbc7
Date: Fri, 5 Apr 2019 10:57:38 +0200
99cbc7
Subject: [PATCH] tests: Reuse qemucapabilities data for qemucaps2xml
99cbc7
99cbc7
While qemucaps2xml has a meager two test cases to its name, we
99cbc7
have plenty of data from qemucapabilities which is taken from
99cbc7
actual QEMU binaries, covers pretty much all supported QEMU
99cbc7
versions and architectures and is even in the right format already!
99cbc7
99cbc7
Rewrite qemucaps2xml so that it uses qemucapabilities data as
99cbc7
input. Right now we have a single test case, but we're going to
99cbc7
add a lot more next.
99cbc7
99cbc7
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
99cbc7
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
99cbc7
(cherry picked from commit 562990849a9de255b5fefa39be3f301b1bddfa6e)
99cbc7
99cbc7
https://bugzilla.redhat.com/show_bug.cgi?id=1628469
99cbc7
99cbc7
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
99cbc7
Message-Id: <20190405085744.8179-2-abologna@redhat.com>
99cbc7
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
99cbc7
---
99cbc7
 tests/qemucaps2xmldata/all_1.6.0-1.caps       | 129 ------------------
99cbc7
 .../nodisksnapshot_1.6.0-1.caps               | 128 -----------------
99cbc7
 .../nodisksnapshot_1.6.0-1.xml                |  32 -----
99cbc7
 .../caps_1.6.0.x86_64.xml}                    |  12 +-
99cbc7
 tests/qemucaps2xmltest.c                      |  33 +++--
99cbc7
 5 files changed, 23 insertions(+), 311 deletions(-)
99cbc7
 delete mode 100644 tests/qemucaps2xmldata/all_1.6.0-1.caps
99cbc7
 delete mode 100644 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
99cbc7
 delete mode 100644 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
99cbc7
 rename tests/{qemucaps2xmldata/all_1.6.0-1.xml => qemucaps2xmloutdata/caps_1.6.0.x86_64.xml} (67%)
99cbc7
99cbc7
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmldata/all_1.6.0-1.caps
99cbc7
deleted file mode 100644
99cbc7
index d39d0bebbf..0000000000
99cbc7
--- a/tests/qemucaps2xmldata/all_1.6.0-1.caps
99cbc7
+++ /dev/null
99cbc7
@@ -1,129 +0,0 @@
99cbc7
-  <qemuCaps>
99cbc7
-    <flag name='mem-path'/>
99cbc7
-    <flag name='drive-serial'/>
99cbc7
-    <flag name='chardev'/>
99cbc7
-    <flag name='enable-kvm'/>
99cbc7
-    <flag name='monitor-json'/>
99cbc7
-    <flag name='balloon'/>
99cbc7
-    <flag name='device'/>
99cbc7
-    <flag name='sdl'/>
99cbc7
-    <flag name='smp-topology'/>
99cbc7
-    <flag name='netdev'/>
99cbc7
-    <flag name='rtc'/>
99cbc7
-    <flag name='vhost-net'/>
99cbc7
-    <flag name='no-hpet'/>
99cbc7
-    <flag name='no-kvm-pit'/>
99cbc7
-    <flag name='pci-configfd'/>
99cbc7
-    <flag name='nodefconfig'/>
99cbc7
-    <flag name='boot-menu'/>
99cbc7
-    <flag name='fsdev'/>
99cbc7
-    <flag name='name-process'/>
99cbc7
-    <flag name='drive-readonly'/>
99cbc7
-    <flag name='smbios-type'/>
99cbc7
-    <flag name='vga-qxl'/>
99cbc7
-    <flag name='spice'/>
99cbc7
-    <flag name='vga-none'/>
99cbc7
-    <flag name='boot-index'/>
99cbc7
-    <flag name='hda-duplex'/>
99cbc7
-    <flag name='drive-aio'/>
99cbc7
-    <flag name='pci-multibus'/>
99cbc7
-    <flag name='pci-bootindex'/>
99cbc7
-    <flag name='ccid-emulated'/>
99cbc7
-    <flag name='ccid-passthru'/>
99cbc7
-    <flag name='chardev-spicevmc'/>
99cbc7
-    <flag name='virtio-tx-alg'/>
99cbc7
-    <flag name='device-qxl-vga'/>
99cbc7
-    <flag name='pci-multifunction'/>
99cbc7
-    <flag name='virtio-blk-pci.ioeventfd'/>
99cbc7
-    <flag name='sga'/>
99cbc7
-    <flag name='virtio-blk-pci.event_idx'/>
99cbc7
-    <flag name='virtio-net-pci.event_idx'/>
99cbc7
-    <flag name='cache-directsync'/>
99cbc7
-    <flag name='piix3-usb-uhci'/>
99cbc7
-    <flag name='piix4-usb-uhci'/>
99cbc7
-    <flag name='usb-ehci'/>
99cbc7
-    <flag name='ich9-usb-ehci1'/>
99cbc7
-    <flag name='vt82c686b-usb-uhci'/>
99cbc7
-    <flag name='pci-ohci'/>
99cbc7
-    <flag name='usb-hub'/>
99cbc7
-    <flag name='no-shutdown'/>
99cbc7
-    <flag name='cache-unsafe'/>
99cbc7
-    <flag name='rombar'/>
99cbc7
-    <flag name='ich9-ahci'/>
99cbc7
-    <flag name='no-acpi'/>
99cbc7
-    <flag name='fsdev-readonly'/>
99cbc7
-    <flag name='virtio-blk-pci.scsi'/>
99cbc7
-    <flag name='blk-sg-io'/>
99cbc7
-    <flag name='drive-copy-on-read'/>
99cbc7
-    <flag name='cpu-host'/>
99cbc7
-    <flag name='fsdev-writeout'/>
99cbc7
-    <flag name='drive-iotune'/>
99cbc7
-    <flag name='system_wakeup'/>
99cbc7
-    <flag name='scsi-disk.channel'/>
99cbc7
-    <flag name='scsi-block'/>
99cbc7
-    <flag name='transaction'/>
99cbc7
-    <flag name='block-job-async'/>
99cbc7
-    <flag name='scsi-cd'/>
99cbc7
-    <flag name='ide-cd'/>
99cbc7
-    <flag name='no-user-config'/>
99cbc7
-    <flag name='hda-micro'/>
99cbc7
-    <flag name='dump-guest-memory'/>
99cbc7
-    <flag name='nec-usb-xhci'/>
99cbc7
-    <flag name='balloon-event'/>
99cbc7
-    <flag name='bridge'/>
99cbc7
-    <flag name='lsi'/>
99cbc7
-    <flag name='virtio-scsi-pci'/>
99cbc7
-    <flag name='blockio'/>
99cbc7
-    <flag name='disable-s3'/>
99cbc7
-    <flag name='disable-s4'/>
99cbc7
-    <flag name='ide-drive.wwn'/>
99cbc7
-    <flag name='scsi-disk.wwn'/>
99cbc7
-    <flag name='seccomp-sandbox'/>
99cbc7
-    <flag name='dump-guest-core'/>
99cbc7
-    <flag name='seamless-migration'/>
99cbc7
-    <flag name='block-commit'/>
99cbc7
-    <flag name='vnc'/>
99cbc7
-    <flag name='drive-mirror'/>
99cbc7
-    <flag name='usb-host.bootindex'/>
99cbc7
-    <flag name='blockdev-snapshot-sync'/>
99cbc7
-    <flag name='qxl'/>
99cbc7
-    <flag name='VGA'/>
99cbc7
-    <flag name='cirrus-vga'/>
99cbc7
-    <flag name='vmware-svga'/>
99cbc7
-    <flag name='device-video-primary'/>
99cbc7
-    <flag name='usb-serial'/>
99cbc7
-    <flag name='usb-net'/>
99cbc7
-    <flag name='add-fd'/>
99cbc7
-    <flag name='nbd-server'/>
99cbc7
-    <flag name='virtio-rng'/>
99cbc7
-    <flag name='rng-random'/>
99cbc7
-    <flag name='rng-egd'/>
99cbc7
-    <flag name='dtb'/>
99cbc7
-    <flag name='megasas'/>
99cbc7
-    <flag name='ipv6-migration'/>
99cbc7
-    <flag name='machine-opt'/>
99cbc7
-    <flag name='machine-usb-opt'/>
99cbc7
-    <flag name='pci-bridge'/>
99cbc7
-    <flag name='vfio-pci'/>
99cbc7
-    <flag name='vfio-pci.bootindex'/>
99cbc7
-    <flag name='scsi-generic'/>
99cbc7
-    <flag name='scsi-generic.bootindex'/>
99cbc7
-    <flag name='mem-merge'/>
99cbc7
-    <flag name='vnc-websocket'/>
99cbc7
-    <flag name='mlock'/>
99cbc7
-    <flag name='vnc-share-policy'/>
99cbc7
-    <flag name='device-del-event'/>
99cbc7
-    <flag name='dmi-to-pci-bridge'/>
99cbc7
-    <flag name='i440fx-pci-hole64-size'/>
99cbc7
-    <flag name='q35-pci-hole64-size'/>
99cbc7
-    <flag name='usb-storage'/>
99cbc7
-    <flag name='usb-storage.removable'/>
99cbc7
-    <flag name='virtio-mmio'/>
99cbc7
-    <flag name='ich9-intel-hda'/>
99cbc7
-    <flag name='kvm-pit-lost-tick-policy'/>
99cbc7
-    <flag name='boot-strict'/>
99cbc7
-    <flag name='pvpanic'/>
99cbc7
-    <flag name='reboot-timeout'/>
99cbc7
-    <flag name='enable-fips'/>
99cbc7
-    <flag name='name-guest'/>
99cbc7
-  </qemuCaps>
99cbc7
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
99cbc7
deleted file mode 100644
99cbc7
index 5a0372c917..0000000000
99cbc7
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
99cbc7
+++ /dev/null
99cbc7
@@ -1,128 +0,0 @@
99cbc7
-  <qemuCaps>
99cbc7
-    <flag name='mem-path'/>
99cbc7
-    <flag name='drive-serial'/>
99cbc7
-    <flag name='chardev'/>
99cbc7
-    <flag name='enable-kvm'/>
99cbc7
-    <flag name='monitor-json'/>
99cbc7
-    <flag name='balloon'/>
99cbc7
-    <flag name='device'/>
99cbc7
-    <flag name='sdl'/>
99cbc7
-    <flag name='smp-topology'/>
99cbc7
-    <flag name='netdev'/>
99cbc7
-    <flag name='rtc'/>
99cbc7
-    <flag name='vhost-net'/>
99cbc7
-    <flag name='no-hpet'/>
99cbc7
-    <flag name='no-kvm-pit'/>
99cbc7
-    <flag name='pci-configfd'/>
99cbc7
-    <flag name='nodefconfig'/>
99cbc7
-    <flag name='boot-menu'/>
99cbc7
-    <flag name='fsdev'/>
99cbc7
-    <flag name='name-process'/>
99cbc7
-    <flag name='drive-readonly'/>
99cbc7
-    <flag name='smbios-type'/>
99cbc7
-    <flag name='vga-qxl'/>
99cbc7
-    <flag name='spice'/>
99cbc7
-    <flag name='vga-none'/>
99cbc7
-    <flag name='boot-index'/>
99cbc7
-    <flag name='hda-duplex'/>
99cbc7
-    <flag name='drive-aio'/>
99cbc7
-    <flag name='pci-multibus'/>
99cbc7
-    <flag name='pci-bootindex'/>
99cbc7
-    <flag name='ccid-emulated'/>
99cbc7
-    <flag name='ccid-passthru'/>
99cbc7
-    <flag name='chardev-spicevmc'/>
99cbc7
-    <flag name='virtio-tx-alg'/>
99cbc7
-    <flag name='device-qxl-vga'/>
99cbc7
-    <flag name='pci-multifunction'/>
99cbc7
-    <flag name='virtio-blk-pci.ioeventfd'/>
99cbc7
-    <flag name='sga'/>
99cbc7
-    <flag name='virtio-blk-pci.event_idx'/>
99cbc7
-    <flag name='virtio-net-pci.event_idx'/>
99cbc7
-    <flag name='cache-directsync'/>
99cbc7
-    <flag name='piix3-usb-uhci'/>
99cbc7
-    <flag name='piix4-usb-uhci'/>
99cbc7
-    <flag name='usb-ehci'/>
99cbc7
-    <flag name='ich9-usb-ehci1'/>
99cbc7
-    <flag name='vt82c686b-usb-uhci'/>
99cbc7
-    <flag name='pci-ohci'/>
99cbc7
-    <flag name='usb-hub'/>
99cbc7
-    <flag name='no-shutdown'/>
99cbc7
-    <flag name='cache-unsafe'/>
99cbc7
-    <flag name='rombar'/>
99cbc7
-    <flag name='ich9-ahci'/>
99cbc7
-    <flag name='no-acpi'/>
99cbc7
-    <flag name='fsdev-readonly'/>
99cbc7
-    <flag name='virtio-blk-pci.scsi'/>
99cbc7
-    <flag name='blk-sg-io'/>
99cbc7
-    <flag name='drive-copy-on-read'/>
99cbc7
-    <flag name='cpu-host'/>
99cbc7
-    <flag name='fsdev-writeout'/>
99cbc7
-    <flag name='drive-iotune'/>
99cbc7
-    <flag name='system_wakeup'/>
99cbc7
-    <flag name='scsi-disk.channel'/>
99cbc7
-    <flag name='scsi-block'/>
99cbc7
-    <flag name='transaction'/>
99cbc7
-    <flag name='block-job-async'/>
99cbc7
-    <flag name='scsi-cd'/>
99cbc7
-    <flag name='ide-cd'/>
99cbc7
-    <flag name='no-user-config'/>
99cbc7
-    <flag name='hda-micro'/>
99cbc7
-    <flag name='dump-guest-memory'/>
99cbc7
-    <flag name='nec-usb-xhci'/>
99cbc7
-    <flag name='balloon-event'/>
99cbc7
-    <flag name='bridge'/>
99cbc7
-    <flag name='lsi'/>
99cbc7
-    <flag name='virtio-scsi-pci'/>
99cbc7
-    <flag name='blockio'/>
99cbc7
-    <flag name='disable-s3'/>
99cbc7
-    <flag name='disable-s4'/>
99cbc7
-    <flag name='ide-drive.wwn'/>
99cbc7
-    <flag name='scsi-disk.wwn'/>
99cbc7
-    <flag name='seccomp-sandbox'/>
99cbc7
-    <flag name='dump-guest-core'/>
99cbc7
-    <flag name='seamless-migration'/>
99cbc7
-    <flag name='block-commit'/>
99cbc7
-    <flag name='vnc'/>
99cbc7
-    <flag name='drive-mirror'/>
99cbc7
-    <flag name='usb-host.bootindex'/>
99cbc7
-    <flag name='qxl'/>
99cbc7
-    <flag name='VGA'/>
99cbc7
-    <flag name='cirrus-vga'/>
99cbc7
-    <flag name='vmware-svga'/>
99cbc7
-    <flag name='device-video-primary'/>
99cbc7
-    <flag name='usb-serial'/>
99cbc7
-    <flag name='usb-net'/>
99cbc7
-    <flag name='add-fd'/>
99cbc7
-    <flag name='nbd-server'/>
99cbc7
-    <flag name='virtio-rng'/>
99cbc7
-    <flag name='rng-random'/>
99cbc7
-    <flag name='rng-egd'/>
99cbc7
-    <flag name='dtb'/>
99cbc7
-    <flag name='megasas'/>
99cbc7
-    <flag name='ipv6-migration'/>
99cbc7
-    <flag name='machine-opt'/>
99cbc7
-    <flag name='machine-usb-opt'/>
99cbc7
-    <flag name='pci-bridge'/>
99cbc7
-    <flag name='vfio-pci'/>
99cbc7
-    <flag name='vfio-pci.bootindex'/>
99cbc7
-    <flag name='scsi-generic'/>
99cbc7
-    <flag name='scsi-generic.bootindex'/>
99cbc7
-    <flag name='mem-merge'/>
99cbc7
-    <flag name='vnc-websocket'/>
99cbc7
-    <flag name='mlock'/>
99cbc7
-    <flag name='vnc-share-policy'/>
99cbc7
-    <flag name='device-del-event'/>
99cbc7
-    <flag name='dmi-to-pci-bridge'/>
99cbc7
-    <flag name='i440fx-pci-hole64-size'/>
99cbc7
-    <flag name='q35-pci-hole64-size'/>
99cbc7
-    <flag name='usb-storage'/>
99cbc7
-    <flag name='usb-storage.removable'/>
99cbc7
-    <flag name='virtio-mmio'/>
99cbc7
-    <flag name='ich9-intel-hda'/>
99cbc7
-    <flag name='kvm-pit-lost-tick-policy'/>
99cbc7
-    <flag name='boot-strict'/>
99cbc7
-    <flag name='pvpanic'/>
99cbc7
-    <flag name='reboot-timeout'/>
99cbc7
-    <flag name='enable-fips'/>
99cbc7
-    <flag name='name-guest'/>
99cbc7
-  </qemuCaps>
99cbc7
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
99cbc7
deleted file mode 100644
99cbc7
index 981344e6fd..0000000000
99cbc7
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
99cbc7
+++ /dev/null
99cbc7
@@ -1,32 +0,0 @@
99cbc7
-<capabilities>
99cbc7
-
99cbc7
-  <host>
99cbc7
-    <cpu>
99cbc7
-      <arch>i686</arch>
99cbc7
-    </cpu>
99cbc7
-    <power_management/>
99cbc7
-    <iommu support='no'/>
99cbc7
-  </host>
99cbc7
-
99cbc7
-  <guest>
99cbc7
-    <os_type>hvm</os_type>
99cbc7
-    <arch name='i686'>
99cbc7
-      <wordsize>32</wordsize>
99cbc7
-      <emulator>/usr/bin/qemu-system-i386</emulator>
99cbc7
-      <domain type='qemu'/>
99cbc7
-      <domain type='kvm'>
99cbc7
-        <emulator>/usr/bin/qemu-system-i386</emulator>
99cbc7
-      </domain>
99cbc7
-    </arch>
99cbc7
-    <features>
99cbc7
-      <cpuselection/>
99cbc7
-      <deviceboot/>
99cbc7
-      <disksnapshot default='off' toggle='no'/>
99cbc7
-      <acpi default='on' toggle='yes'/>
99cbc7
-      <apic default='on' toggle='no'/>
99cbc7
-      <pae/>
99cbc7
-      <nonpae/>
99cbc7
-    </features>
99cbc7
-  </guest>
99cbc7
-
99cbc7
-</capabilities>
99cbc7
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml
99cbc7
similarity index 67%
99cbc7
rename from tests/qemucaps2xmldata/all_1.6.0-1.xml
99cbc7
rename to tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml
99cbc7
index efe86b9a12..b58f54fefd 100644
99cbc7
--- a/tests/qemucaps2xmldata/all_1.6.0-1.xml
99cbc7
+++ b/tests/qemucaps2xmloutdata/caps_1.6.0.x86_64.xml
99cbc7
@@ -2,7 +2,7 @@
99cbc7
 
99cbc7
   <host>
99cbc7
     <cpu>
99cbc7
-      <arch>i686</arch>
99cbc7
+      <arch>x86_64</arch>
99cbc7
     </cpu>
99cbc7
     <power_management/>
99cbc7
     <iommu support='no'/>
99cbc7
@@ -10,12 +10,12 @@
99cbc7
 
99cbc7
   <guest>
99cbc7
     <os_type>hvm</os_type>
99cbc7
-    <arch name='i686'>
99cbc7
-      <wordsize>32</wordsize>
99cbc7
-      <emulator>/usr/bin/qemu-system-i386</emulator>
99cbc7
+    <arch name='x86_64'>
99cbc7
+      <wordsize>64</wordsize>
99cbc7
+      <emulator>/usr/bin/qemu-system-x86_64</emulator>
99cbc7
       <domain type='qemu'/>
99cbc7
       <domain type='kvm'>
99cbc7
-        <emulator>/usr/bin/qemu-system-i386</emulator>
99cbc7
+        <emulator>/usr/bin/qemu-system-x86_64</emulator>
99cbc7
       </domain>
99cbc7
     </arch>
99cbc7
     <features>
99cbc7
@@ -24,8 +24,6 @@
99cbc7
       <disksnapshot default='on' toggle='no'/>
99cbc7
       <acpi default='on' toggle='yes'/>
99cbc7
       <apic default='on' toggle='no'/>
99cbc7
-      <pae/>
99cbc7
-      <nonpae/>
99cbc7
     </features>
99cbc7
   </guest>
99cbc7
 
99cbc7
diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
99cbc7
index 5b9152b04d..65dd97c0a4 100644
99cbc7
--- a/tests/qemucaps2xmltest.c
99cbc7
+++ b/tests/qemucaps2xmltest.c
99cbc7
@@ -32,7 +32,7 @@ typedef struct _testQemuData testQemuData;
99cbc7
 typedef testQemuData *testQemuDataPtr;
99cbc7
 struct _testQemuData {
99cbc7
     const char *base;
99cbc7
-    virArch guestarch;
99cbc7
+    const char *archName;
99cbc7
 };
99cbc7
 
99cbc7
 static virQEMUCapsPtr
99cbc7
@@ -87,23 +87,28 @@ testGetCaps(char *capsData, const testQemuData *data)
99cbc7
 {
99cbc7
     virQEMUCapsPtr qemuCaps = NULL;
99cbc7
     virCapsPtr caps = NULL;
99cbc7
+    virArch arch = virArchFromString(data->archName);
99cbc7
+    char *binary = NULL;
99cbc7
+
99cbc7
+    if (virAsprintf(&binary, "/usr/bin/qemu-system-%s", data->archName) < 0)
99cbc7
+        goto error;
99cbc7
 
99cbc7
     if ((qemuCaps = testQemuGetCaps(capsData)) == NULL) {
99cbc7
         fprintf(stderr, "failed to parse qemu capabilities flags");
99cbc7
         goto error;
99cbc7
     }
99cbc7
 
99cbc7
-    if ((caps = virCapabilitiesNew(data->guestarch, false, false)) == NULL) {
99cbc7
+    if ((caps = virCapabilitiesNew(arch, false, false)) == NULL) {
99cbc7
         fprintf(stderr, "failed to create the fake capabilities");
99cbc7
         goto error;
99cbc7
     }
99cbc7
 
99cbc7
     if (virQEMUCapsInitGuestFromBinary(caps,
99cbc7
-                                       "/usr/bin/qemu-system-i386",
99cbc7
+                                       binary,
99cbc7
                                        qemuCaps,
99cbc7
                                        NULL,
99cbc7
                                        NULL,
99cbc7
-                                       data->guestarch) < 0) {
99cbc7
+                                       arch) < 0) {
99cbc7
         fprintf(stderr, "failed to create the capabilities from qemu");
99cbc7
         goto error;
99cbc7
     }
99cbc7
@@ -114,6 +119,7 @@ testGetCaps(char *capsData, const testQemuData *data)
99cbc7
  error:
99cbc7
     virObjectUnref(qemuCaps);
99cbc7
     virObjectUnref(caps);
99cbc7
+    VIR_FREE(binary);
99cbc7
     return NULL;
99cbc7
 }
99cbc7
 
99cbc7
@@ -127,12 +133,12 @@ testQemuCapsXML(const void *opaque)
99cbc7
     char *capsXml = NULL;
99cbc7
     virCapsPtr capsProvided = NULL;
99cbc7
 
99cbc7
-    if (virAsprintf(&xmlFile, "%s/qemucaps2xmldata/%s.xml",
99cbc7
-                    abs_srcdir, data->base) < 0)
99cbc7
+    if (virAsprintf(&xmlFile, "%s/qemucaps2xmloutdata/%s.%s.xml",
99cbc7
+                    abs_srcdir, data->base, data->archName) < 0)
99cbc7
         goto cleanup;
99cbc7
 
99cbc7
-    if (virAsprintf(&capsFile, "%s/qemucaps2xmldata/%s.caps",
99cbc7
-                    abs_srcdir, data->base) < 0)
99cbc7
+    if (virAsprintf(&capsFile, "%s/qemucapabilitiesdata/%s.%s.xml",
99cbc7
+                    abs_srcdir, data->base, data->archName) < 0)
99cbc7
         goto cleanup;
99cbc7
 
99cbc7
     if (virTestLoadFile(capsFile, &capsData) < 0)
99cbc7
@@ -175,16 +181,13 @@ mymain(void)
99cbc7
 
99cbc7
     virEventRegisterDefaultImpl();
99cbc7
 
99cbc7
-#define DO_TEST_FULL(name, guest) \
99cbc7
+#define DO_TEST(arch, name) \
99cbc7
+    data.archName = arch; \
99cbc7
     data.base = name; \
99cbc7
-    data.guestarch = guest; \
99cbc7
-    if (virTestRun(name, testQemuCapsXML, &data) < 0) \
99cbc7
+    if (virTestRun(name "(" arch ")", testQemuCapsXML, &data) < 0) \
99cbc7
         ret = -1
99cbc7
 
99cbc7
-#define DO_TEST(name) DO_TEST_FULL(name, VIR_ARCH_I686)
99cbc7
-
99cbc7
-    DO_TEST("all_1.6.0-1");
99cbc7
-    DO_TEST("nodisksnapshot_1.6.0-1");
99cbc7
+    DO_TEST("x86_64", "caps_1.6.0");
99cbc7
 
99cbc7
     return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
99cbc7
 }
99cbc7
-- 
99cbc7
2.21.0
99cbc7