From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQzeM-0000KB-NH for qemu-devel@nongnu.org; Wed, 03 Feb 2016 10:47:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQzeL-0002Gz-Jb for qemu-devel@nongnu.org; Wed, 03 Feb 2016 10:47:22 -0500 References: <1454417864-18774-1-git-send-email-berrange@redhat.com> <1454417864-18774-7-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <56B22103.2060804@redhat.com> Date: Wed, 3 Feb 2016 08:47:15 -0700 MIME-Version: 1.0 In-Reply-To: <1454417864-18774-7-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2vaVmJQ42mVBVw9XRBnd2Soht0mF8AuT7" Subject: Re: [Qemu-devel] [PATCH v5 06/10] qemu-nbd: allow specifying image as a set of options args List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Markus Armbruster , qemu-block@nongnu.org, =?UTF-8?Q?Andreas_F=c3=a4rber?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2vaVmJQ42mVBVw9XRBnd2Soht0mF8AuT7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/02/2016 05:57 AM, Daniel P. Berrange wrote: > Currently qemu-nbd allows an image filename to be passed on the > command line, but unless using the JSON format, it does not have > a way to set any options except the format eg >=20 > qemu-nbd https://127.0.0.1/images/centos7.iso > qemu-nbd /home/berrange/demo.qcow2 >=20 > This adds a --image-opts arg that indicates that the positional > filename should be interpreted as a full option string, not > just a filename. >=20 > qemu-nbd --image-opts driver=3Dhttps,url=3Dhttps://127.0.0.1/images,= sslverify=3Doff > qemu-nbd --image-opts driver=3Dfile,filename=3D/home/berrange/demo.q= cow2 >=20 > This flag is mutually exclusive with the '-f' flag. >=20 > Signed-off-by: Daniel P. Berrange > --- > qemu-nbd.c | 42 +++++++++++++++++++++++++++++++++++++----- > 1 file changed, 37 insertions(+), 5 deletions(-) Where is this new option documented? At a minimum, 'qemu-nbd --help' should mention it. If later in the series, mention that in the commit message. >=20 > diff --git a/qemu-nbd.c b/qemu-nbd.c > index 0e019c1..ee91e47 100644 > --- a/qemu-nbd.c > +++ b/qemu-nbd.c > @@ -47,6 +47,7 @@ > #define QEMU_NBD_OPT_DISCARD 3 > #define QEMU_NBD_OPT_DETECT_ZEROES 4 > #define QEMU_NBD_OPT_OBJECT 5 > +#define QEMU_NBD_OPT_IMAGE_OPTS 6 Churn here where 8/10 has to touch the same line; but I'm not sure rearranging the series is worth the effort, so I don't mind it. > @@ -724,13 +740,29 @@ int main(int argc, char **argv) > bdrv_init(); > atexit(bdrv_close_all); There's an earlier use of argv[optind] for the --disconnect option; should that code be tweaked at all, or is it always safe for that path to blindly open(name) without trying to parse options? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2vaVmJQ42mVBVw9XRBnd2Soht0mF8AuT7 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/ iQEcBAEBCAAGBQJWsiEDAAoJEKeha0olJ0NqG/kH/1uS2tyynQ1rpdD8G4FJL5w9 +GtwdGPMAUu07pTGOJ1nyLsORsYsJH2vdedtaIgDMcxUd20zfL4XGCCJkNv8iH5w Q3DsAG/b6tzg9I6FHG4susnS9vuJ2v1BC0gGiUYitMsg0AXK53Mg9ddBess3JZPU 2yralBR7AlcNmBwSctKeY7wVwh3G6XQ4SStjVoQuXMHF7QRHlrQmCAbeSRhlCueL XeLCMdzdgLBz4Og6N2EauB6iWdVlAl/H+VPlQTSlZ1fTfMOI8SaYSuFW/bRVwg+v gE9dRyfb4pWTjcz6hXdWAmJSBH0U82YzPEkPan9UMpGZtgJxkjTB551UzVpeM2E= =QI7u -----END PGP SIGNATURE----- --2vaVmJQ42mVBVw9XRBnd2Soht0mF8AuT7--