|
|
d76c62 |
From 6442aa5565de857371a7076c56ced84fbea0ec66 Mon Sep 17 00:00:00 2001
|
|
|
d76c62 |
Message-Id: <6442aa5565de857371a7076c56ced84fbea0ec66@dist-git>
|
|
|
d76c62 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
d76c62 |
Date: Thu, 16 Jan 2020 10:03:51 +0100
|
|
|
d76c62 |
Subject: [PATCH] qemuDomainSaveImageStartVM: Use VIR_AUTOCLOSE for
|
|
|
d76c62 |
@intermediatefd
|
|
|
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 1c16f261d0764ff70fb33ece4367f25e741cdb74)
|
|
|
d76c62 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
d76c62 |
Message-Id: <f181efbc202853298ca06eecf78e7dad1063dc16.1579165329.git.mprivozn@redhat.com>
|
|
|
d76c62 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
d76c62 |
---
|
|
|
d76c62 |
src/qemu/qemu_driver.c | 5 ++---
|
|
|
d76c62 |
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
d76c62 |
|
|
|
d76c62 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
d76c62 |
index d6b1e9f00c..9de5bc6a32 100644
|
|
|
d76c62 |
--- a/src/qemu/qemu_driver.c
|
|
|
d76c62 |
+++ b/src/qemu/qemu_driver.c
|
|
|
d76c62 |
@@ -6803,7 +6803,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
|
|
d76c62 |
int ret = -1;
|
|
|
d76c62 |
bool restored = false;
|
|
|
d76c62 |
virObjectEventPtr event;
|
|
|
d76c62 |
- int intermediatefd = -1;
|
|
|
d76c62 |
+ VIR_AUTOCLOSE intermediatefd = -1;
|
|
|
d76c62 |
virCommandPtr cmd = NULL;
|
|
|
d76c62 |
g_autofree char *errbuf = NULL;
|
|
|
d76c62 |
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
|
d76c62 |
@@ -6829,6 +6829,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
|
|
d76c62 |
|
|
|
d76c62 |
if (virCommandRunAsync(cmd, NULL) < 0) {
|
|
|
d76c62 |
*fd = intermediatefd;
|
|
|
d76c62 |
+ intermediatefd = -1;
|
|
|
d76c62 |
goto cleanup;
|
|
|
d76c62 |
}
|
|
|
d76c62 |
}
|
|
|
d76c62 |
@@ -6872,8 +6873,6 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
|
|
d76c62 |
|
|
|
d76c62 |
virErrorRestore(&orig_err);
|
|
|
d76c62 |
}
|
|
|
d76c62 |
- VIR_FORCE_CLOSE(intermediatefd);
|
|
|
d76c62 |
-
|
|
|
d76c62 |
if (VIR_CLOSE(*fd) < 0) {
|
|
|
d76c62 |
virReportSystemError(errno, _("cannot close file: %s"), path);
|
|
|
d76c62 |
restored = false;
|
|
|
d76c62 |
--
|
|
|
d76c62 |
2.25.0
|
|
|
d76c62 |
|