From: Eric Blake <eblake@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>, pbonzini@redhat.com
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] vl.c: Add '-L help' which lists data dirs.
Date: Mon, 16 May 2016 10:01:03 -0600 [thread overview]
Message-ID: <5739EEBF.1080603@redhat.com> (raw)
In-Reply-To: <1463405856-17063-2-git-send-email-rjones@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]
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.
>
> This commit adds a simple '-L help' option that just lists out the
> data directories as qemu calculates them:
>
> $ ./x86_64-softmmu/qemu-system-x86_64 -L help
> /home/rjones/d/qemu/pc-bios
> /usr/local/share/qemu
>
> $ ./x86_64-softmmu/qemu-system-x86_64 -L /tmp -L help
> /tmp
> /home/rjones/d/qemu/pc-bios
> /usr/local/share/qemu
>
> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
> ---
> 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 = NULL;
> Error *main_loop_err = NULL;
> Error *err = NULL;
> + bool list_data_dirs = 0;
s/0/false/ - might as well actually use the boolean type that we declared.
>
> 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 = 1;
s/1/true/
With those changes, you can add:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
prev parent reply other threads:[~2016-05-16 16:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-16 13:37 [Qemu-devel] [PATCH v2] vl.c: Add '-L help' which lists data dirs Richard W.M. Jones
2016-05-16 13:37 ` Richard W.M. Jones
2016-05-16 16:01 ` Eric Blake [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5739EEBF.1080603@redhat.com \
--to=eblake@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).