From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Vincent Palatin <vpalatin@chromium.org>
Subject: [Qemu-devel] [PATCH] Fix the -accel parameter and the documentation for 'hax'
Date: Tue, 2 May 2017 11:52:01 +0200 [thread overview]
Message-ID: <1493718721-29774-1-git-send-email-thuth@redhat.com> (raw)
Since 'hax' is a possible accelerator nowadays, too, the '-accel'
option should support it and we should mention it in the documentation,
too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qemu-options.hx | 8 ++++----
vl.c | 24 ++++++++++--------------
2 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 787b9c3..c7b1d2d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -31,7 +31,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
"-machine [type=]name[,prop[=value][,...]]\n"
" selects emulated machine ('-machine help' for list)\n"
" property accel=accel1[:accel2[:...]] selects accelerator\n"
- " supported accelerators are kvm, xen, tcg (default: tcg)\n"
+ " supported accelerators are kvm, xen, hax or tcg (default: tcg)\n"
" kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
" vmport=on|off|auto controls emulation of vmport (default: auto)\n"
" kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
@@ -52,9 +52,9 @@ available machines. Supported machine properties are:
@table @option
@item accel=@var{accels1}[:@var{accels2}[:...]]
This is used to enable an accelerator. Depending on the target architecture,
-kvm, xen, or tcg can be available. By default, tcg is used. If there is more
-than one accelerator specified, the next one is used if the previous one fails
-to initialize.
+kvm, xen, hax or tcg can be available. By default, tcg is used. If there is
+more than one accelerator specified, the next one is used if the previous one
+fails to initialize.
@item kernel_irqchip=on|off
Controls in-kernel irqchip support for the chosen accelerator when available.
@item gfx_passthru=on|off
diff --git a/vl.c b/vl.c
index f46e070..d5e88fb 100644
--- a/vl.c
+++ b/vl.c
@@ -3725,26 +3725,22 @@ int main(int argc, char **argv, char **envp)
qdev_prop_register_global(&kvm_pit_lost_tick_policy);
break;
}
- case QEMU_OPTION_accel:
+ case QEMU_OPTION_accel: {
+ char *mstr;
+
accel_opts = qemu_opts_parse_noisily(qemu_find_opts("accel"),
optarg, true);
optarg = qemu_opt_get(accel_opts, "accel");
-
- olist = qemu_find_opts("machine");
- if (strcmp("kvm", optarg) == 0) {
- qemu_opts_parse_noisily(olist, "accel=kvm", false);
- } else if (strcmp("xen", optarg) == 0) {
- qemu_opts_parse_noisily(olist, "accel=xen", false);
- } else if (strcmp("tcg", optarg) == 0) {
- qemu_opts_parse_noisily(olist, "accel=tcg", false);
- } else {
- if (!is_help_option(optarg)) {
- error_printf("Unknown accelerator: %s", optarg);
- }
- error_printf("Supported accelerators: kvm, xen, tcg\n");
+ if (is_help_option(optarg)) {
+ error_printf("Possible accelerators: kvm, xen, hax, tcg\n");
exit(1);
}
+ mstr = g_strdup_printf("accel=%s", optarg);
+ olist = qemu_find_opts("machine");
+ qemu_opts_parse_noisily(olist, mstr, false);
+ g_free(mstr);
break;
+ }
case QEMU_OPTION_usb:
olist = qemu_find_opts("machine");
qemu_opts_parse_noisily(olist, "usb=on", false);
--
1.8.3.1
next reply other threads:[~2017-05-02 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 9:52 Thomas Huth [this message]
2017-05-02 12:58 ` [Qemu-devel] [PATCH] Fix the -accel parameter and the documentation for 'hax' Paolo Bonzini
2017-05-02 13:45 ` Eduardo Habkost
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=1493718721-29774-1-git-send-email-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vpalatin@chromium.org \
/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).