Patchwork Don't reset bs->is_temporary in bdrv_open_common

login
register
mail settings
Submitter Ryan Harper
Date June 28, 2010, 2:38 p.m.
Message ID <20100628143833.GB1647@us.ibm.com>
Download mbox | patch
Permalink /patch/57145/
State New
Headers show

Comments

Ryan Harper - June 28, 2010, 2:38 p.m.
To fix https://bugs.launchpad.net/qemu/+bug/597402 where qemu fails to
call unlink() on temporary snapshots due to bs->is_temporary getting clobbered
in bdrv_open_common() after being set in bdrv_open() which calls the former.

We don't need to initialize bs->is_temporary in bdrv_open_common().

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
 block.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Kevin Wolf - June 29, 2010, 7:32 a.m.
Am 28.06.2010 16:38, schrieb Ryan Harper:
> To fix https://bugs.launchpad.net/qemu/+bug/597402 where qemu fails to
> call unlink() on temporary snapshots due to bs->is_temporary getting clobbered
> in bdrv_open_common() after being set in bdrv_open() which calls the former.
> 
> We don't need to initialize bs->is_temporary in bdrv_open_common().
> 
> Signed-off-by: Ryan Harper <ryanh@us.ibm.com>

Thanks, applied to the block branch.

Kevin

Patch

diff --git a/block.c b/block.c
index e71a771..a55882e 100644
--- a/block.c
+++ b/block.c
@@ -393,7 +393,6 @@  static int bdrv_open_common(BlockDriverState *bs, const char *filename,
 
     bs->file = NULL;
     bs->total_sectors = 0;
-    bs->is_temporary = 0;
     bs->encrypted = 0;
     bs->valid_key = 0;
     bs->open_flags = flags;