From e023b2e244ddcc25308309d20c6bfd037897b10c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 8 May 2012 16:51:41 +0200 Subject: block: fix snapshot on QED QED's opaque data includes a pointer back to the BlockDriverState. This breaks when bdrv_append shuffles data between bs_new and bs_top. To avoid this, add a "rebind" function that tells the driver about the new relationship between the BlockDriverState and its opaque. The patch also adds rebind to VVFAT for completeness, even though it is not used with live snapshots. Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- block_int.h | 1 + 1 file changed, 1 insertion(+) (limited to 'block_int.h') diff --git a/block_int.h b/block_int.h index 086832aab9..fbbc7aeb1a 100644 --- a/block_int.h +++ b/block_int.h @@ -140,6 +140,7 @@ struct BlockDriver { int (*bdrv_write)(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); void (*bdrv_close)(BlockDriverState *bs); + void (*bdrv_rebind)(BlockDriverState *bs); int (*bdrv_create)(const char *filename, QEMUOptionParameter *options); int (*bdrv_set_key)(BlockDriverState *bs, const char *key); int (*bdrv_make_empty)(BlockDriverState *bs); -- cgit v1.2.3-55-g7522