]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuagenttest: Use real x86_64 capabilities for parsing domain definitions
authorPeter Krempa <pkrempa@redhat.com>
Tue, 4 Jul 2023 11:39:24 +0000 (13:39 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jul 2023 13:23:34 +0000 (15:23 +0200)
Some test cases require a real definition and thus parse a XML with the
definition to obtain it. Convert the code to use real capabilities and
switch to x86_64.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuagentdata/fsinfo.xml
tests/qemuagenttest.c

index 233968fc29e1e9bb412c3c53004a3f6f09b2874f..914c2828c62fc0cb84e0c2d582b9c93c39c8b7bd 100644 (file)
@@ -5,7 +5,7 @@
   <currentMemory unit='KiB'>219136</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <clock offset='utc'/>
@@ -13,7 +13,7 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='file' device='disk'>
       <source file='/tmp/idedisk.img'/>
       <target dev='hdc' bus='ide'/>
index 3c24a3139f42c8bf7c715c1df48ef5a19c6d38ae..328788024197a4f5aea170d12d2afb711a792f86 100644 (file)
@@ -1359,11 +1359,19 @@ testQemuAgentTimezone(const void *data)
 static int
 mymain(void)
 {
+    g_autoptr(GHashTable) capslatest = testQemuGetLatestCaps();
+    g_autoptr(GHashTable) capscache = virHashNew(virObjectUnref);
     int ret = 0;
 
     if (qemuTestDriverInit(&driver) < 0)
         return EXIT_FAILURE;
 
+    /* Some test cases need a real definition thus parse a XML. We need
+     * qemu capabilities for that. */
+    if (testQemuInsertRealCaps(driver.qemuCapsCache, "x86_64", "latest", "",
+                               capslatest, capscache, NULL, NULL) < 0)
+        return EXIT_FAILURE;
+
     virEventRegisterDefaultImpl();
 
 #define DO_TEST(name) \