libvirt/SOURCES/libvirt-qemuDomainSaveImageStartVM-Use-g_autoptr-for-virCommand.patch
2021-09-10 11:58:15 +00:00

47 lines
1.7 KiB
Diff

From 09776b6ac6421a03fe2ff72eb6146a9ca0119259 Mon Sep 17 00:00:00 2001
Message-Id: <09776b6ac6421a03fe2ff72eb6146a9ca0119259@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 16 Jan 2020 10:03:52 +0100
Subject: [PATCH] qemuDomainSaveImageStartVM: Use g_autoptr() for virCommand
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1718707
(cherry picked from commit 82e127e34350dc0ed908611a3b2a4fbd78ad9903)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <5d41d06ee27842659082e67dd6abf40c3c59ae5d.1579165329.git.mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/qemu/qemu_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9de5bc6a32..e1c0550b9a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6804,7 +6804,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
bool restored = false;
virObjectEventPtr event;
VIR_AUTOCLOSE intermediatefd = -1;
- virCommandPtr cmd = NULL;
+ g_autoptr(virCommand) cmd = NULL;
g_autofree char *errbuf = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
virQEMUSaveHeaderPtr header = &data->header;
@@ -6920,7 +6920,6 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
cleanup:
virObjectUnref(cookie);
- virCommandFree(cmd);
if (qemuSecurityRestoreSavedStateLabel(driver, vm, path) < 0)
VIR_WARN("failed to restore save state label on %s", path);
return ret;
--
2.25.0