From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2KxC-0007WI-Ic for qemu-devel@nongnu.org; Mon, 16 May 2016 12:01:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2Kx8-0003YK-Rb for qemu-devel@nongnu.org; Mon, 16 May 2016 12:01:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Kx8-0003Y1-Ap for qemu-devel@nongnu.org; Mon, 16 May 2016 12:01:06 -0400 References: <1463405856-17063-1-git-send-email-rjones@redhat.com> <1463405856-17063-2-git-send-email-rjones@redhat.com> From: Eric Blake Message-ID: <5739EEBF.1080603@redhat.com> Date: Mon, 16 May 2016 10:01:03 -0600 MIME-Version: 1.0 In-Reply-To: <1463405856-17063-2-git-send-email-rjones@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IlI0QUh4A1ukwudc8aJkvS3lTqP4hXa1C" Subject: Re: [Qemu-devel] [PATCH v2] vl.c: Add '-L help' which lists data dirs. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" , pbonzini@redhat.com Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IlI0QUh4A1ukwudc8aJkvS3lTqP4hXa1C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/16/2016 07:37 AM, Richard W.M. Jones wrote: > QEMU compiles a list of data directories from various sources. When > consuming a QEMU binary it's useful to be able to get this list of > data directories: a primary reason is so you can list what BIOSes or > keymaps ship with this version of QEMU. However without reproducing > the method that QEMU uses internally, it's not possible to get the > list of data directories. >=20 > This commit adds a simple '-L help' option that just lists out the > data directories as qemu calculates them: >=20 > $ ./x86_64-softmmu/qemu-system-x86_64 -L help > /home/rjones/d/qemu/pc-bios > /usr/local/share/qemu >=20 > $ ./x86_64-softmmu/qemu-system-x86_64 -L /tmp -L help > /tmp > /home/rjones/d/qemu/pc-bios > /usr/local/share/qemu >=20 > Signed-off-by: Richard W.M. Jones > --- > qemu-options.hx | 2 ++ > vl.c | 13 ++++++++++++- > 2 files changed, 14 insertions(+), 1 deletion(-) I'm in favor of the idea. > +++ b/vl.c > @@ -2990,6 +2990,7 @@ int main(int argc, char **argv, char **envp) > FILE *vmstate_dump_file =3D NULL; > Error *main_loop_err =3D NULL; > Error *err =3D NULL; > + bool list_data_dirs =3D 0; s/0/false/ - might as well actually use the boolean type that we declared= =2E > =20 > qemu_init_cpu_loop(); > qemu_mutex_lock_iothread(); > @@ -3371,7 +3372,9 @@ int main(int argc, char **argv, char **envp) > add_device_config(DEV_GDB, optarg); > break; > case QEMU_OPTION_L: > - if (data_dir_idx < ARRAY_SIZE(data_dir)) { > + if (is_help_option(optarg)) { > + list_data_dirs =3D 1; s/1/true/ With those changes, you can add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IlI0QUh4A1ukwudc8aJkvS3lTqP4hXa1C 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/ iQEcBAEBCAAGBQJXOe6/AAoJEKeha0olJ0NqMJcH/AySXzsUbmGH424jj380QJUQ nki8rdkX28EOiHE3tFeFJZDzqamUUv/JJpBs49kz7ioAsNsqCB7PiLDk7y92R2iT W712kEQD7KSK21qY1021viSc1uggVboIJ/OUOx8seqODOuGu2FUfa+YcljdrgvTX xOnncwj2EE6aSi2KY327Yb0NiY9h8YVsJFoI6SYwCCiCwtqzDekQghG9DtOekfRv BufYJQDAhUuwZd/kuEDHI9dq3utBKtKQIfDSVz6NCE0NG53SI3HKn42pMdjVRgjI WMFdNtvXtMqZhy9zf8d9Z/Ta3ScO8aMKf81KTNQOYbzd8cEiosz6g3A19x48GCM= =+NX6 -----END PGP SIGNATURE----- --IlI0QUh4A1ukwudc8aJkvS3lTqP4hXa1C--