mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
block: Unlink temporary file
If the image file cannot be opened and was created as a temporary file, it should be deleted; thus, in this case, we should jump to the "unlink_and_fail" label and not just to "fail". Reported-by: Benoît Canet <benoit@irqsave.net> Signed-off-by: Max Reitz <mreitz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
27eb6c097c
commit
9562f69cfd
1 changed files with 1 additions and 1 deletions
2
block.c
2
block.c
|
@ -1321,7 +1321,7 @@ int bdrv_open(BlockDriverState **pbs, const char *filename,
|
|||
bdrv_open_flags(bs, flags | BDRV_O_UNMAP) |
|
||||
BDRV_O_PROTOCOL, true, &local_err);
|
||||
if (ret < 0) {
|
||||
goto fail;
|
||||
goto unlink_and_fail;
|
||||
}
|
||||
|
||||
/* Find the right image format driver */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue