On a Wednesday in 2020, Peter Krempa wrote:
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
double space
the return code. Since it's easy to miss this nuance introduce a 'ret' variable for the
missing comma
return code and return it's value in the error section.
its
https://bugzilla.redhat.com/show_bug.cgi?id=1791522 Signed-off-by: Peter Krempa <[email protected]> --- 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 dfe0adaad8..9a9361949d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6691,6 +6691,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, bool unlink_corrupt) { int fd = -1; + int ret = -1; virQEMUSaveDataPtr data = NULL; virQEMUSaveHeaderPtr header; virDomainDefPtr def = NULL;
This does not restore the preservation of -errno from the following
call:
if ((fd = qemuOpenFile(driver, NULL, path, oflags, NULL)) < 0)
goto error;
that existed before commit 21ad56e932 mentioned above. Thankfully.
Guess it's unlikely that this function would return -ESRCH and confuse
the caller.
Reviewed-by: Ján Tomko <[email protected]>
Jano
signature.asc
Description: PGP signature
