From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYda1-0001KU-Cd for qemu-devel@nongnu.org; Wed, 24 Feb 2016 12:50:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYda0-0006cy-F0 for qemu-devel@nongnu.org; Wed, 24 Feb 2016 12:50:29 -0500 References: <1456247799-9593-1-git-send-email-kwolf@redhat.com> <1456247799-9593-2-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: <56CDED5C.1040209@redhat.com> Date: Wed, 24 Feb 2016 18:50:20 +0100 MIME-Version: 1.0 In-Reply-To: <1456247799-9593-2-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DG2dA9AHovfb3cEWe3NPAN54BSjsmFxs6" Subject: Re: [Qemu-devel] [PATCH 1/2] hmp: 'drive_add -n' for creating a node without BB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: pkrempa@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DG2dA9AHovfb3cEWe3NPAN54BSjsmFxs6 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 23.02.2016 18:16, Kevin Wolf wrote: > This patch adds an option to the drive_add HMP command to create only a= > BlockDriverState without a BlockBackend on top. >=20 > The motivation for this is that libvirt needs to specify options to a > migration target (specifically, detect-zeroes). drive-mirror doesn't > allow specifying options, and the proper way to do this is to create th= e > target BDS separately with blockdev-add (where you can specify options)= > and then use blockdev-mirror to that BDS. >=20 > However, libvirt can't use blockdev-add as long as it is still > experimental, and we're expecting that it will still take some time, so= > we need to resort to drive_add. >=20 > The problem with drive_add is that so far it always created a BB, and > BDSes with a BB can't be used as a mirroring target as long as we don't= > support multiple BBs per BDS - and while we're working towards that > goal, it's another thing that will still take some time. >=20 > So to achieve the goal, the simplest solution to provide the > functionality now without adding one-off options to the mirror QMP > commands is to extend drive_add to create nodes without BBs. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 30 ++++++++++++++++++++++++++++++ > device-hotplug.c | 7 +++++++ > hmp-commands.hx | 4 ++-- > include/block/block_int.h | 2 ++ > 4 files changed, 41 insertions(+), 2 deletions(-) >=20 Patch looks good to me (well, except for it being a pity we have to fall back on this HMP command), I only have a minor suggestion: [...] > diff --git a/hmp-commands.hx b/hmp-commands.hx > index bb52e4d..3b44e52 100644 > --- a/hmp-commands.hx > +++ b/hmp-commands.hx > @@ -1200,8 +1200,8 @@ ETEXI > =20 > { > .name =3D "drive_add", > - .args_type =3D "pci_addr:s,opts:s", > - .params =3D "[[:]:]\n" > + .args_type =3D "node:-n,pci_addr:s,opts:s", > + .params =3D "[-n] [[:]:]\n" > "[file=3Dfile][,if=3Dtype][,bus=3Dn]\n" > "[,unit=3Dm][,media=3Dd][,index=3Di]\n" > "[,cyls=3Dc,heads=3Dh,secs=3Ds[,trans=3Dt]]\n" The description reads: > Add drive to PCI storage controller. Maybe this should be extended now? Max --DG2dA9AHovfb3cEWe3NPAN54BSjsmFxs6 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 iQEcBAEBCAAGBQJWze1cAAoJEDuxQgLoOKytzvcH/0ss9z6nw6be+VR75raWLLu9 KjPdQ0m68JHxYS5kHclyfsByZbriT7aCresFMlRTbjqP/Gxvi0tOVEmeggXgIFWM dpYBTNPNNt+nbfhrvj/b5EeOxwO0FEFBLDdI2wXALPqYbTTyRid3zoJyHU2az6UC UB8TGjOkjBaqGnUMhNj0Ug+It5cPNH3DsoSriMc+U92rMBRYNsi5WVtg4CjFsL41 aljUuWfe3YLwFB1OWKVb4GdTe36teK64376W2wk9nnBNMMcWEWNg0xH1ODrYvFsM W1wOnDdoCANPv3bskTZC3/QEsoH+dc8WhDUiOJa6Y3Du4DMvhGnRF4+KJ3ob6U8= =e3O0 -----END PGP SIGNATURE----- --DG2dA9AHovfb3cEWe3NPAN54BSjsmFxs6--