All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Unlink temporary file
@ 2014-02-15 17:03 Max Reitz
  2014-02-17 10:12 ` Stefan Hajnoczi
  2014-03-12  9:15 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Max Reitz @ 2014-02-15 17:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Benoît Canet, Stefan Hajnoczi, Max Reitz

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>
---
This patch's context depends on my bdrv_open()/bdrv_file_open() series
("[PATCH v3 0/8] block: Integrate bdrv_file_open() into bdrv_open()").
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 62161bd..51c77b0 100644
--- a/block.c
+++ b/block.c
@@ -1308,7 +1308,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 */
-- 
1.8.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: Unlink temporary file
  2014-02-15 17:03 [Qemu-devel] [PATCH] block: Unlink temporary file Max Reitz
@ 2014-02-17 10:12 ` Stefan Hajnoczi
  2014-03-12  9:15 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-02-17 10:12 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, qemu-devel, Benoît Canet

On Sat, Feb 15, 2014 at 06:03:21PM +0100, Max Reitz wrote:
> 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>
> ---
> This patch's context depends on my bdrv_open()/bdrv_file_open() series
> ("[PATCH v3 0/8] block: Integrate bdrv_file_open() into bdrv_open()").
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index 62161bd..51c77b0 100644
> --- a/block.c
> +++ b/block.c
> @@ -1308,7 +1308,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 */

Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: Unlink temporary file
  2014-02-15 17:03 [Qemu-devel] [PATCH] block: Unlink temporary file Max Reitz
  2014-02-17 10:12 ` Stefan Hajnoczi
@ 2014-03-12  9:15 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-03-12  9:15 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi, Benoît Canet

On Sat, Feb 15, 2014 at 06:03:21PM +0100, Max Reitz wrote:
> 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>
> ---
> This patch's context depends on my bdrv_open()/bdrv_file_open() series
> ("[PATCH v3 0/8] block: Integrate bdrv_file_open() into bdrv_open()").
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-12  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 17:03 [Qemu-devel] [PATCH] block: Unlink temporary file Max Reitz
2014-02-17 10:12 ` Stefan Hajnoczi
2014-03-12  9:15 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.