From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYe7K-0003Ab-Sv for qemu-devel@nongnu.org; Wed, 24 Feb 2016 13:24:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYe7J-000151-TF for qemu-devel@nongnu.org; Wed, 24 Feb 2016 13:24:54 -0500 Date: Wed, 24 Feb 2016 19:24:46 +0100 From: Kevin Wolf Message-ID: <20160224182446.GI4485@noname.redhat.com> References: <1456247799-9593-1-git-send-email-kwolf@redhat.com> <1456247799-9593-2-git-send-email-kwolf@redhat.com> <56CDED5C.1040209@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JP+T4n/bALQSJXh8" Content-Disposition: inline In-Reply-To: <56CDED5C.1040209@redhat.com> 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: Max Reitz Cc: pkrempa@redhat.com, armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org --JP+T4n/bALQSJXh8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 24.02.2016 um 18:50 hat Max Reitz geschrieben: > 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 the > > 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 >=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: >=20 > [...] >=20 > > 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" >=20 > The description reads: >=20 > > Add drive to PCI storage controller. >=20 > Maybe this should be extended now? It was already wrong before this patch, but I guess I could just add another patch to the series anyway. Kevin --JP+T4n/bALQSJXh8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWzfVuAAoJEH8JsnLIjy/WXEcQAKAeZL0t8WqkMCMWMjpWcKlp x78Igo1RN3IS40cKd38/6EkpDVZZjcKWJwnGNkknekEFpYHFyPOcsLhdLM16sJr8 SzsFbxDYSq5oYOm2BE1VsrGVq6LcPLf1f1x/VJIFS24uQek0Ga9guI7SdHpwrk2B ijUEENUMHeSaPbeigwRg23VHG7NRzhS4Ij9Kf7P95alKlb0pjg3Hj6xB43WdA6d3 +/wzXPpD4oAIojBs5wp93lyXCm0CWD6DV6xTHlmKVuRftXtSWGkL1DHpmPEV686c zprKBKeTY2bJNMe+T1tFQxscmtbUIrMhSIskS9owr0lFgbDTe4/CeMDmWhdPDtmh +QaLeMPyA4QGjGeu1T/1So8JiSRaAq7coLE5jU+LkGx/b9y2KK7iH1LlxBe/mGiu yw23iMdUinRWn3W1NBde1YHxpCARxN/sD3rp5yjsvhwjVfETCLV9Bo3iHXZQ0Sy1 ePufQK0U1fVXnmmrbVyi6e+s7lXCp8qB5D7b6ukR3cPt67BXyOP+oDOFK1H/MvnB U3cCSFLcj7M3TvDtLKJHNazQeBLFMvKSqpnm2lj937nEdi8HjAXVN3a0MM3PIDGC xA359iMGGZR1/i62XrX9fPFo1OpltiVb0sBDb1J8/AAH0aEJt3jTFXI9OdoB4E0d QDGpZdmO+qMM8lAZBW+s =paXf -----END PGP SIGNATURE----- --JP+T4n/bALQSJXh8--