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