代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8dcea1141c60ebc7c7a292b8112ca74a0ad56c46 Mon Sep 17 00:00:00 2001
From: tangbin <[email protected]>
Date: Wed, 23 Nov 2022 15:03:37 +0200
Subject: [PATCH 03/23] qemu: fix domain start with corrupted save file
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 21ad56e932 introduced a regression where a VM with a corrupted
save image file would fail to start on the first attempt. This was
caused by returning a wrong return code as 'fd' was abused to also hold
the return code.
Since it's easy to miss this nuance, introduce a 'ret' variable for the
return code and return it' value in the error section.
https://bugzilla.redhat.com/show_bug.cgi?id=1791522
Signed-off-by: Peter Krempa <[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Reviewed-by: Pavel Mores <[email protected]>
Signed-off-by: tangbin <[email protected]>
(cherry-pick from f76a57182046da59af5547a1c02094dc9d61ad88)
---
src/qemu/qemu_driver.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a3617b4d73..10ddbba325 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6587,6 +6587,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
bool unlink_corrupt)
{
int fd = -1;
+ int ret = -1;
virQEMUSaveDataPtr data = NULL;
virQEMUSaveHeaderPtr header;
virDomainDefPtr def = NULL;
@@ -6622,7 +6623,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
_("cannot remove corrupt file: %s"),
path);
} else {
- fd = -3;
+ ret = -3;
}
} else {
virReportError(VIR_ERR_OPERATION_FAILED,
@@ -6643,7 +6644,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
_("cannot remove corrupt file: %s"),
path);
} else {
- fd = -3;
+ ret = -3;
}
goto error;
}
@@ -6712,7 +6713,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
virDomainDefFree(def);
virQEMUSaveDataFree(data);
VIR_FORCE_CLOSE(fd);
- return -1;
+ return ret;
}
static int ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6)
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。