[PATCH 08/10] qemuagenttest: Use real x86_64 capabilities for parsing domain definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/qemuagentdata/fsinfo.xml | 4 ++--
 tests/qemuagenttest.c          | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/qemuagentdata/fsinfo.xml b/tests/qemuagentdata/fsinfo.xml
index 233968fc29..914c2828c6 100644
--- a/tests/qemuagentdata/fsinfo.xml
+++ b/tests/qemuagentdata/fsinfo.xml
@@ -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'/>
diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
index 3c24a3139f..3287880241 100644
--- a/tests/qemuagenttest.c
+++ b/tests/qemuagenttest.c
@@ -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) \
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux