1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-10 05:17:59 +03:00

qemuhotplugtest: Don't fetch capabilities when they are not used

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-09 15:51:08 +01:00
parent d8ea6a391b
commit 578c2a0cc7

View File

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