]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuxml2xml: Wire up QEMUCaps usage
authorCole Robinson <crobinso@redhat.com>
Fri, 8 Jan 2016 03:50:05 +0000 (22:50 -0500)
committerCole Robinson <crobinso@redhat.com>
Sat, 9 Jan 2016 02:21:34 +0000 (21:21 -0500)
Future changes will make some of these tests dependent on specific
QEMUCaps flags, so wire up the basic handling. Flags will be added
in future patches.

tests/qemuxml2xmltest.c

index 9482f6c939834906b751bd1ad2479325b10db003..ab20fca296261f1931b3f00ece353b23d2b76c4f 100644 (file)
@@ -32,6 +32,8 @@ struct testInfo {
     char *inName;
     char *outActiveName;
     char *outInactiveName;
+
+    virQEMUCapsPtr qemuCaps;
 };
 
 static int
@@ -171,6 +173,8 @@ testInfoFree(struct testInfo *info)
     VIR_FREE(info->inName);
     VIR_FREE(info->outActiveName);
     VIR_FREE(info->outInactiveName);
+
+    virObjectUnref(info->qemuCaps);
 }
 
 
@@ -180,6 +184,13 @@ testInfoSet(struct testInfo *info,
             bool different,
             int when)
 {
+    if (!(info->qemuCaps = virQEMUCapsNew()))
+        goto error;
+
+    if (qemuTestCapsCacheInsert(driver.qemuCapsCache, name,
+                                info->qemuCaps) < 0)
+        goto error;
+
     if (virAsprintf(&info->inName, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
                     abs_srcdir, name) < 0)
         goto error;