From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXD7J-0005GV-Gs for qemu-devel@nongnu.org; Wed, 02 Sep 2015 14:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXD7H-0005oV-CY for qemu-devel@nongnu.org; Wed, 02 Sep 2015 14:50:40 -0400 References: <1441183880-26993-1-git-send-email-wency@cn.fujitsu.com> <1441183880-26993-5-git-send-email-wency@cn.fujitsu.com> From: Eric Blake Message-ID: <55E744E6.5040502@redhat.com> Date: Wed, 2 Sep 2015 12:50:14 -0600 MIME-Version: 1.0 In-Reply-To: <1441183880-26993-5-git-send-email-wency@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pL0aoTIlSaxu0ocNGJC2ngMQBWXt2VfMg" Subject: Re: [Qemu-devel] [PATCH 04/16] block: Allow references for backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , qemu devel , Fam Zheng , Max Reitz , Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , zhanghailiang , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , "Michael R. Hines" , Gonglei , Yang Hongyang This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pL0aoTIlSaxu0ocNGJC2ngMQBWXt2VfMg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/02/2015 02:51 AM, Wen Congyang wrote: > Usage: > -drive file=3Dxxx,id=3DY, \ > -drive file=3Dxxxx,id=3DX,backing.backing_reference=3DY >=20 > It will create such backing chain: > {virtio-blk dev 'Y'} {virtio-blk dev 'X'} > | | > | | > v v >=20 > [base] <- [mid] <- ( Y ) <----------------- ( X ) This makes any changes to 'Y' have unspecified effects on 'X'. While we may have a valid reason to use a backing BDS in more than one chain, I seriously doubt anyone will ever want to have two guest-visible -drive's that are both read-write where one can corrupt the other. I can totally see the point of having BDS 'Y' exist for checkpoints or some other non-guest-visible action, so I'm not saying this patch is wrong, just that the commit message is picking a poor example of how it would be used= =2E >=20 > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > --- > block.c | 39 +++++++++++++++++++++++++++++++++++---- > include/block/block.h | 1 + > 2 files changed, 36 insertions(+), 4 deletions(-) >=20 > diff --git a/block.c b/block.c > index d02d9e9..f93c50d 100644 > --- a/block.c > +++ b/block.c > @@ -1179,6 +1179,7 @@ out: > } > =20 > #define ALLOW_WRITE_BACKING_FILE "allow-write-backing-file" > +#define BACKING_REFERENCE "backing_reference" Why the inconsistency in '-' vs. '_'? I'd stick with dash here. > static QemuOptsList backing_file_opts =3D { > .name =3D "backing_file", > .head =3D QTAILQ_HEAD_INITIALIZER(backing_file_opts.head), > @@ -1188,6 +1189,11 @@ static QemuOptsList backing_file_opts =3D { > .type =3D QEMU_OPT_BOOL, > .help =3D "allow write to backing file", > }, > + { > + .name =3D BACKING_REFERENCE, > + .type =3D QEMU_OPT_STRING, > + .help =3D "reference to the exsiting BDS", s/exsiting/existing/ But why do we need this? In qapi, BlockdevOptionsGenericCOWFormat already has '*backing':'BlockdevRef', and BlockdevRef already has a choice between 'definition' (object) and 'reference' (string). Or is this just a matter of teaching the command line to do what QMP can already do? In which case, wouldn't: -drive file=3Dxxx,id=3DY, -drive file=3Dxxxx,id=3DX,backing=3DY be the natural mapping of 'backing' being a string rather than a dictiona= ry? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pL0aoTIlSaxu0ocNGJC2ngMQBWXt2VfMg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV50TmAAoJEKeha0olJ0Nqfe4H/1nQQIH4UH5ZqPTxC1ElE+Je mVsOb3s1gppTeuEbDdVwxpuGPHUHhtpB3H6RLyr2vUyGczBEpM904qDE6A+ksc0g cxnroexrDLg7H/CDFQwQB5TtuoUZWrRgqTn2pQtdUZXuhWndPvnNBR5Wg3IEPKGc m/fzLTXu8mMACBWPA+eg057r5kNmaZos6u4upCZdBAsCOYESLWimIPog/khF762a 0Xhl1a+BIPgW+DSy0yxNOxH41pWi+buIa9k8DfOLmqrWtTkPJqIqQdd1qn8hadNY cfQ4I36LEDCAU2G96FTJouHO8q9EhBRbGM2iOI5oKDwPUbEdN7V+CNMozKhQb7Y= =DCkR -----END PGP SIGNATURE----- --pL0aoTIlSaxu0ocNGJC2ngMQBWXt2VfMg--