On Wed, Jan 19, 2011 at 5:02 PM, Christoph Hellwig <h...@lst.de> wrote:
> 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);

Cool, this is much nicer than stashing away state like
bs->media_changed = 1.  I just took a peek to see if we can remove
that field completely but IDE seems to use it internally.

Stefan

Reply via email to