Received: from eggs.gnu.org ([140.186.70.92]:48145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzVkF-0004BU-Sz for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:33:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzVkE-0000gh-Sl for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:33:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzVkE-0000gd-Gk for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:33:26 -0400 From: Markus Armbruster References: <1312376904-16115-1-git-send-email-armbru@redhat.com> <1312376904-16115-45-git-send-email-armbru@redhat.com> <4E60D979.9040108@redhat.com> Date: Fri, 02 Sep 2011 17:33:21 +0200 In-Reply-To: <4E60D979.9040108@redhat.com> (Kevin Wolf's message of "Fri, 02 Sep 2011 15:26:17 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v2 44/45] block: New change_media_cb() parameter load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: stefano.stabellini@eu.citrix.com, quintela@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de Kevin Wolf writes: > Am 03.08.2011 15:08, schrieb Markus Armbruster: >> To let device models distinguish between eject and load. >> >> Signed-off-by: Markus Armbruster >> --- >> block.c | 12 ++++++------ >> block.h | 3 ++- >> hw/fdc.c | 2 +- >> hw/ide/core.c | 2 +- >> hw/scsi-disk.c | 2 +- >> hw/sd.c | 2 +- >> 6 files changed, 12 insertions(+), 11 deletions(-) >> >> diff --git a/block.c b/block.c >> index b0e54ef..1bd67dd 100644 >> --- a/block.c >> +++ b/block.c >> @@ -44,7 +44,7 @@ >> #include >> #endif >> >> -static void bdrv_dev_change_media_cb(BlockDriverState *bs); >> +static void bdrv_dev_change_media_cb(BlockDriverState *bs, bool load); >> static BlockDriverAIOCB *bdrv_aio_readv_em(BlockDriverState *bs, >> int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, >> BlockDriverCompletionFunc *cb, void *opaque); >> @@ -661,7 +661,7 @@ int bdrv_open(BlockDriverState *bs, const char *filename, int flags, >> } >> >> if (!bdrv_key_required(bs)) { >> - bdrv_dev_change_media_cb(bs); >> + bdrv_dev_change_media_cb(bs, true); >> } >> >> return 0; >> @@ -697,7 +697,7 @@ void bdrv_close(BlockDriverState *bs) >> bdrv_close(bs->file); >> } >> >> - bdrv_dev_change_media_cb(bs); >> + bdrv_dev_change_media_cb(bs, false); >> } >> } >> >> @@ -780,10 +780,10 @@ void bdrv_set_dev_ops(BlockDriverState *bs, const BlockDevOps *ops, >> } >> } >> >> -static void bdrv_dev_change_media_cb(BlockDriverState *bs) >> +static void bdrv_dev_change_media_cb(BlockDriverState *bs, bool load) >> { >> if (bs->dev_ops && bs->dev_ops->change_media_cb) { >> - bs->dev_ops->change_media_cb(bs->dev_opaque); >> + bs->dev_ops->change_media_cb(bs->dev_opaque, load); >> } >> } >> >> @@ -1634,7 +1634,7 @@ int bdrv_set_key(BlockDriverState *bs, const char *key) >> } else if (!bs->valid_key) { >> bs->valid_key = 1; >> /* call the change callback now, we skipped it on open */ >> - bdrv_dev_change_media_cb(bs); >> + bdrv_dev_change_media_cb(bs, 1); > > s/1/true/ Thanks, will fix.