Am 19.01.2011 18:02, schrieb Christoph Hellwig: > Extend the change_cb callback with a reason argument, and use it > to tell drivers about size changes. > > Signed-off-by: Christoph Hellwig <h...@lst.de> > > Index: qemu/block.c > =================================================================== > --- qemu.orig/block.c 2011-01-18 20:54:45.246021572 +0100 > +++ qemu/block.c 2011-01-18 20:56:54.117255612 +0100 > @@ -645,7 +645,7 @@ int bdrv_open(BlockDriverState *bs, cons > /* call the change callback */ > bs->media_changed = 1; > if (bs->change_cb) > - bs->change_cb(bs->change_opaque); > + bs->change_cb(bs->change_opaque, CHANGE_MEDIA); > } > > return 0; > @@ -684,7 +684,7 @@ void bdrv_close(BlockDriverState *bs) > /* call the change callback */ > bs->media_changed = 1; > if (bs->change_cb) > - bs->change_cb(bs->change_opaque); > + bs->change_cb(bs->change_opaque, CHANGE_MEDIA); > } > } > > @@ -1135,6 +1135,8 @@ int bdrv_truncate(BlockDriverState *bs, > ret = drv->bdrv_truncate(bs, offset); > if (ret == 0) { > ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS); > + if (bs->change_cb) > + bs->change_cb(bs->change_opaque, CHANGE_SIZE);
Braces are missing here. Apart from that and Stefan's s/id/device/ the series looks good to me. Kevin