From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1gNg-0003yl-Pk for qemu-devel@nongnu.org; Wed, 15 Aug 2012 12:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1gNf-0006qL-Lj for qemu-devel@nongnu.org; Wed, 15 Aug 2012 12:23:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1gNf-0006q4-D7 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 12:23:39 -0400 Message-ID: <502BCD04.1060608@redhat.com> Date: Wed, 15 Aug 2012 10:23:32 -0600 From: Eric Blake MIME-Version: 1.0 References: <1345042466-31743-1-git-send-email-benoit@irqsave.net> <1345042466-31743-4-git-send-email-benoit@irqsave.net> In-Reply-To: <1345042466-31743-4-git-send-email-benoit@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig32261357D8EB13BFB9DD1A1F" Subject: Re: [Qemu-devel] [PATCH 3/3] qemu-img: Add json output option to the info command. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org, pbonzini@redhat.com, xiawenc@linux.vnet.ibm.com, =?UTF-8?B?QmVub8OudCBDYW5ldA==?= This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig32261357D8EB13BFB9DD1A1F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/15/2012 08:54 AM, Beno=C3=AEt Canet wrote: > This additionnal --machine=3Djson option make qemu-img info output on > stdout a JSON formated representation of the image informations. >=20 > --machine=3Djson was choosen instead of --format=3Djson because the > info command already have a -f parameter. Do we want a counterpart '--machine=3Dtext' or '--machine=3Dhuman' to explicitly specify current output format? > @@ -1113,10 +1174,20 @@ static int img_info(int argc, char **argv) > char backing_filename[1024]; > char backing_filename2[1024]; > BlockDriverInfo bdi; > + ImageInfo *image_info; > =20 > fmt =3D NULL; > + machine =3D NULL; > for(;;) { > - c =3D getopt(argc, argv, "f:h"); > + int option_index =3D 0; > + static struct option long_options[] =3D { > + {"help", no_argument, 0, 'h'}, > + {"format", required_argument, 0, 'f'}, > + {"machine", required_argument, 0, 'm'}, > + {0, 0, 0, 0} > + }; > + c =3D getopt_long(argc, argv, "f:h", > + long_options, &option_index); getopt_long is not in POSIX. Are you sure this will compile on all target platforms? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig32261357D8EB13BFB9DD1A1F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQK80EAAoJEKeha0olJ0NqIkMH/A4IjC6KLygskLvMXhCJkZST wJJNL2No831TVUpi70JzQ8naZ4uz4mEM6x3FhV8/xsy44f0K4ASwT32/bKx6lFWg lc4fUdj93/5zlSuTimpie+pthZvw6qW3vCZOsfw9EO7KRel/qy83ULIeyIbVfhHr /fnoncevmY2cSxhLKi6WiIiryBGDg9+/1ttN2R4hPk8oZvyIf/khEs/Kc9ghniri zR8wMdvsXecUwmglw6GPhhmML6RSAnljsMghEYqA3kC62EkOsMx7d1T25TxJROZA pTvPh+nH4VXs108jeI5Budnn3FyyOoq7hDkXpnpsbZxsV2+/rKE7LPmofRv2wa8= =FXsk -----END PGP SIGNATURE----- --------------enig32261357D8EB13BFB9DD1A1F--