From: Kevin Wolf <kwolf@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize
Date: Fri, 21 Jan 2011 11:41:16 +0100 [thread overview]
Message-ID: <4D3962CC.9000002@redhat.com> (raw)
In-Reply-To: <20110119170256.GB9819@lst.de>
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 <hch@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
next prev parent reply other threads:[~2011-01-21 10:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 17:02 [Qemu-devel] [PATCH 0/3 v2] allow online resizing of block devices Christoph Hellwig
2011-01-19 17:02 ` [Qemu-devel] [PATCH 1/3] block: add resize monitor command Christoph Hellwig
2011-01-20 8:56 ` Stefan Hajnoczi
2011-01-20 9:43 ` Christoph Hellwig
2011-01-19 17:02 ` [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize Christoph Hellwig
2011-01-20 9:14 ` Stefan Hajnoczi
2011-01-20 9:44 ` Christoph Hellwig
2011-01-21 10:41 ` Kevin Wolf [this message]
2011-01-19 17:03 ` [Qemu-devel] [PATCH 3/3] virtio-blk: tell the guest about size changes Christoph Hellwig
2011-01-19 17:26 ` [Qemu-devel] Re: [PATCH 0/3 v2] allow online resizing of block devices Juan Quintela
2011-01-20 9:42 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2011-01-24 12:32 [Qemu-devel] [PATCH 0/3 v3] " Christoph Hellwig
2011-01-24 12:32 ` [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize Christoph Hellwig
2011-01-14 16:20 [Qemu-devel] [PATCH 0/3] allow online resizing of block devices Christoph Hellwig
2011-01-14 16:21 ` [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize Christoph Hellwig
2011-01-14 21:06 ` Ryan Harper
2011-01-17 9:14 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D3962CC.9000002@redhat.com \
--to=kwolf@redhat.com \
--cc=hch@lst.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).