[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize |
Date: |
Thu, 20 Jan 2011 09:14:17 +0000 |
On Wed, Jan 19, 2011 at 5:02 PM, Christoph Hellwig <address@hidden> wrote:
> Extend the change_cb callback with a reason argument, and use it
> to tell drivers about size changes.
>
> Signed-off-by: Christoph Hellwig <address@hidden>
>
> 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