diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2023-04-20 17:59:14 +0200 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2023-04-25 08:46:27 +0200 |
commit | 11793a53111c586c7fbd66cb08d8c8b3b9b9dd41 (patch) | |
tree | 9f3fbed14ee4819fd581d3c24a2e72ffea77f56e | |
parent | 22c082b8a2cf54421a689368a218cd5cf5ef4d3f (diff) | |
download | libvirt-11793a53111c586c7fbd66cb08d8c8b3b9b9dd41.tar.gz |
qemuhotplugtest: use g_autoptr(virDomainDeviceDef)
This brings us one step closer to the caller of
qemuDomainAttachDeviceLive()
(qemuDomainAttachDeviceLiveAndConfig()).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
-rw-r--r-- | tests/qemuhotplugtest.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 0794a0c9a4..d571cd38dc 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -154,7 +154,7 @@ testQemuHotplug(const void *data) bool keep = test->keep; unsigned int device_parse_flags = 0; virDomainObj *vm = NULL; - virDomainDeviceDef *dev = NULL; + g_autoptr(virDomainDeviceDef) dev = NULL; g_autoptr(qemuMonitorTest) test_mon = NULL; qemuDomainObjPrivate *priv = NULL; @@ -229,11 +229,6 @@ testQemuHotplug(const void *data) switch (test->action) { case ATTACH: ret = qemuDomainAttachDeviceLive(vm, dev, &driver); - if (ret == 0) { - /* vm->def stolen dev->data.* so we just need to free the dev - * envelope */ - VIR_FREE(dev); - } if (ret == 0 || fail) ret = testQemuHotplugCheckResult(vm, result_xml, result_filename, fail); @@ -262,7 +257,6 @@ testQemuHotplug(const void *data) virObjectUnref(vm); test->vm = NULL; } - virDomainDeviceDefFree(dev); return ((ret < 0 && fail) || (!ret && !fail)) ? 0 : -1; } |