]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuhotplugtest: Don't fetch capabilities when they are not used
authorPeter Krempa <pkrempa@redhat.com>
Thu, 9 Mar 2023 14:51:08 +0000 (15:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Apr 2023 07:19:07 +0000 (09:19 +0200)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuhotplugtest.c

index 6a36856d8a6a95ee94c2a193286044adceda85dc..804e32279ddb4eaa08340c5bd49f7df413f356da 100644 (file)
@@ -319,7 +319,6 @@ testQemuHotplug(const void *data)
     unsigned int device_parse_flags = 0;
     virDomainObj *vm = NULL;
     virDomainDeviceDef *dev = NULL;
-    g_autoptr(virCaps) caps = NULL;
     g_autoptr(qemuMonitorTest) test_mon = NULL;
     qemuDomainObjPrivate *priv = NULL;
 
@@ -339,9 +338,6 @@ testQemuHotplug(const void *data)
         virTestLoadFile(result_filename, &result_xml) < 0)
         goto cleanup;
 
-    if (!(caps = virQEMUDriverGetCapabilities(&driver, false)))
-        goto cleanup;
-
     if (test->vm) {
         vm = test->vm;
         if (!vm->def) {
@@ -480,7 +476,6 @@ testQemuHotplugCpuPrepare(const char *test,
                           GHashTable *qmpschema)
 {
     qemuDomainObjPrivate *priv = NULL;
-    virCaps *caps = NULL;
     g_autofree char *prefix = NULL;
     struct testQemuHotplugCpuData *data = NULL;
 
@@ -501,9 +496,6 @@ testQemuHotplugCpuPrepare(const char *test,
     if (qemuHotplugCreateObjects(driver.xmlopt, &data->vm, data->xml_dom) < 0)
         goto error;
 
-    if (!(caps = virQEMUDriverGetCapabilities(&driver, false)))
-        goto error;
-
     /* create vm->newDef */
     data->vm->persistent = true;
     if (virDomainObjSetDefTransient(driver.xmlopt, data->vm, NULL) < 0)
@@ -533,7 +525,6 @@ testQemuHotplugCpuPrepare(const char *test,
     return data;
 
  error:
-    virObjectUnref(caps);
     testQemuHotplugCpuDataFree(data);
     return NULL;
 }