From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzTiT-0005Ya-49 for qemu-devel@nongnu.org; Fri, 02 Sep 2011 09:23:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzTiR-0001kt-LT for qemu-devel@nongnu.org; Fri, 02 Sep 2011 09:23:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzTiR-0001kp-BF for qemu-devel@nongnu.org; Fri, 02 Sep 2011 09:23:27 -0400 Message-ID: <4E60D979.9040108@redhat.com> Date: Fri, 02 Sep 2011 15:26:17 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1312376904-16115-1-git-send-email-armbru@redhat.com> <1312376904-16115-45-git-send-email-armbru@redhat.com> In-Reply-To: <1312376904-16115-45-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit 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: Markus Armbruster Cc: quintela@redhat.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de 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/ Kevin