From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, jes@sgi.com,
avi@qumranet.com, dmitry.baryshkov@siemens.com
Subject: [Qemu-devel] [PATCH 13/21] provide --accel option
Date: Wed, 15 Oct 2008 19:55:10 -0200 [thread overview]
Message-ID: <1224107718-19128-14-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1224107718-19128-1-git-send-email-glommer@redhat.com>
The --accel option will provide us the ability of defining which
accelerator to pick at run time. It has the advantage of not using
the not-well-accepted constructor directives, and also, of stabilishing
a way to define priorities among accelerators.
The ones registered first, are tried first.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
vl.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index c5fb2dc..f7a58ef 100644
--- a/vl.c
+++ b/vl.c
@@ -255,6 +255,13 @@ static QEMUTimer *icount_vm_timer;
uint8_t qemu_uuid[16];
+QEMUAccel *available_accels[] = {
+/* list of available accelerators */
+#ifdef USE_KQEMU
+ &kqemu_accel,
+#endif
+};
+
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
/***********************************************************/
@@ -8349,6 +8356,7 @@ enum {
QEMU_OPTION_no_quit,
QEMU_OPTION_pidfile,
QEMU_OPTION_no_kqemu,
+ QEMU_OPTION_accel,
QEMU_OPTION_kernel_kqemu,
QEMU_OPTION_win2k_hack,
QEMU_OPTION_usb,
@@ -8436,6 +8444,7 @@ static const QEMUOption qemu_options[] = {
{ "no-kqemu", 0, QEMU_OPTION_no_kqemu },
{ "kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu },
#endif
+ { "accel", HAS_ARG, QEMU_OPTION_accel},
#if defined(TARGET_PPC) || defined(TARGET_SPARC)
{ "g", 1, QEMU_OPTION_g },
#endif
@@ -8810,9 +8819,6 @@ int main(int argc, char **argv)
}
#endif
- register_qemu_accel(&kqemu_accel);
- register_qemu_accel(&noaccel);
-
register_machines();
machine = first_machine;
cpu_model = NULL;
@@ -9261,6 +9267,15 @@ int main(int argc, char **argv)
kqemu_allowed = 2;
break;
#endif
+ case QEMU_OPTION_accel:
+ {
+ int i;
+ for (i = 0; i < ARRAY_SIZE(available_accels); i++) {
+ if (!strcasecmp(optarg, available_accels[i]->name))
+ register_qemu_accel(available_accels[i]);
+ }
+ }
+ break;
case QEMU_OPTION_usb:
usb_enabled = 1;
break;
@@ -9402,6 +9417,9 @@ int main(int argc, char **argv)
exit(1);
}
+ /* Basic handler for the noaccel case */
+ register_qemu_accel(&noaccel);
+
if (nographic) {
if (serial_device_index == 0)
serial_devices[0] = "stdio";
--
1.5.5.1
next prev parent reply other threads:[~2008-10-15 19:59 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 21:54 [Qemu-devel] [PATCH 0/21] Accelerators: cleaned up version Glauber Costa
2008-10-15 20:16 ` [Qemu-devel] " Anthony Liguori
2008-10-15 21:54 ` [Qemu-devel] [PATCH 01/21] split kqemu_init into two Glauber Costa
2008-10-15 21:54 ` [Qemu-devel] [PATCH 02/21] introduce QEMUAccel and fill it with interrupt specific driver Glauber Costa
2008-10-15 20:20 ` [Qemu-devel] " Anthony Liguori
2008-10-15 20:58 ` Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 03/21] init env made accel driver Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 04/21] wrap cache flushing functions into accel drivers Glauber Costa
2008-10-15 20:23 ` [Qemu-devel] " Anthony Liguori
2008-10-15 21:02 ` Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 05/21] turn info kqemu into generic info accelerator Glauber Costa
2008-10-15 20:25 ` [Qemu-devel] " Anthony Liguori
2008-10-15 21:23 ` M. Warner Losh
2008-10-15 21:28 ` Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 06/21] separate accelerator part of info profiler Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 07/21] move kqemu externs to kqemu.h Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 08/21] move disabling code to kqemu.c instead of vl.c Glauber Costa
2008-10-15 20:32 ` [Qemu-devel] " Anthony Liguori
2008-10-15 21:02 ` Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 09/21] set_notdirty goes through accel wrapper Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 10/21] wrap modify_page through accel calls Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 11/21] remove kqemu reference from hw/pc.c Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 12/21] build list of available accelerators Glauber Costa
2008-10-15 21:55 ` Glauber Costa [this message]
2008-10-15 20:36 ` [Qemu-devel] Re: [PATCH 13/21] provide --accel option Anthony Liguori
2008-10-15 21:08 ` Glauber Costa
2008-10-16 19:49 ` Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 14/21] add tsc field to cpu definition Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 15/21] shift for masks Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 16/21] add hook to cpu_register_physical_memory Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 17/21] accel_trace_io Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 18/21] get_env accel wrapper Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 19/21] add next_cpu_index Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 20/21] check wether kqemu is enabled in open code Glauber Costa
2008-10-15 21:55 ` [Qemu-devel] [PATCH 21/21] provide an opaque for accelerator in cpu state Glauber Costa
2008-10-16 9:26 ` [Qemu-devel] " Avi Kivity
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=1224107718-19128-14-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@qumranet.com \
--cc=dmitry.baryshkov@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=jes@sgi.com \
--cc=qemu-devel@nongnu.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).