From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43042 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pfqay-0006rv-63 for qemu-devel@nongnu.org; Thu, 20 Jan 2011 04:14:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pfqaw-0006xL-Fy for qemu-devel@nongnu.org; Thu, 20 Jan 2011 04:14:20 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:59094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pfqaw-0006xB-8F for qemu-devel@nongnu.org; Thu, 20 Jan 2011 04:14:18 -0500 Received: by wwi18 with SMTP id 18so342868wwi.10 for ; Thu, 20 Jan 2011 01:14:17 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20110119170256.GB9819@lst.de> References: <20110119170238.GA9615@lst.de> <20110119170256.GB9819@lst.de> Date: Thu, 20 Jan 2011 09:14:17 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org On Wed, Jan 19, 2011 at 5:02 PM, Christoph Hellwig wrote: > Extend the change_cb callback with a reason argument, and use it > to tell drivers about size changes. > > Signed-off-by: Christoph Hellwig > > Index: qemu/block.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- qemu.orig/block.c =A0 2011-01-18 20:54:45.246021572 +0100 > +++ qemu/block.c =A0 =A0 =A0 =A02011-01-18 20:56:54.117255612 +0100 > @@ -645,7 +645,7 @@ int bdrv_open(BlockDriverState *bs, cons > =A0 =A0 =A0 =A0 /* call the change callback */ > =A0 =A0 =A0 =A0 bs->media_changed =3D 1; > =A0 =A0 =A0 =A0 if (bs->change_cb) > - =A0 =A0 =A0 =A0 =A0 =A0bs->change_cb(bs->change_opaque); > + =A0 =A0 =A0 =A0 =A0 =A0bs->change_cb(bs->change_opaque, CHANGE_MEDIA); Cool, this is much nicer than stashing away state like bs->media_changed =3D 1. I just took a peek to see if we can remove that field completely but IDE seems to use it internally. Stefan