From 2ddb3bf0e1a9beef5957a8251b32d07260879335 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 11 Feb 2022 09:28:11 +0100 Subject: [PATCH] qemuPrepareNVRAM: Switch to VIR_AUTOCLOSE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing inside the qemuPrepareNVRAM function relies on @srcFD being closed early and nothing closes it early. It's okay then to close it automatically when leaving the function. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 036d95924c..0ba9343b2a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4463,7 +4463,7 @@ qemuPrepareNVRAM(virQEMUDriver *driver, { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int ret = -1; - int srcFD = -1; + VIR_AUTOCLOSE srcFD = -1; virDomainLoaderDef *loader = vm->def->os.loader; const char *master_nvram_path; struct qemuPrepareNVRAMHelperData data; @@ -4511,7 +4511,6 @@ qemuPrepareNVRAM(virQEMUDriver *driver, ret = 0; cleanup: - VIR_FORCE_CLOSE(srcFD); return ret; }