From: Glauber Costa <gcosta@redhat.com>
To: kvm-devel@lists.sourceforge.net
Cc: chrisw@sous-sol.org, avi@qumranet.com, Glauber Costa <gcosta@redhat.com>
Subject: [PATCH 8/8] provide -cpu-map option
Date: Tue, 4 Mar 2008 13:22:01 -0300 [thread overview]
Message-ID: <1204647759864-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <12046477552955-git-send-email-gcosta@redhat.com>
this patch introduces a -cpu-map option.
It has the form C:x,y,z..., and have the effect
of setting the affinity mask of vcpu C to processors
x,y,z...
Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
qemu/vl.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/qemu/vl.c b/qemu/vl.c
index 4715594..fa830dd 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -8059,6 +8059,7 @@ static void help(int exitcode)
"-no-kvm disable KVM hardware virtualization\n"
#endif
"-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC\n"
+ "-cpu-map C:x,y,z... set cpu 'C' affinity to processors x,y,z...\n"
#endif
#ifdef TARGET_I386
"-std-vga simulate a standard VGA card with VESA Bochs Extensions\n"
@@ -8177,6 +8178,7 @@ enum {
QEMU_OPTION_no_acpi,
QEMU_OPTION_no_kvm,
QEMU_OPTION_no_kvm_irqchip,
+ QEMU_OPTION_cpu_map,
QEMU_OPTION_no_reboot,
QEMU_OPTION_show_cursor,
QEMU_OPTION_daemonize,
@@ -8263,6 +8265,7 @@ const QEMUOption qemu_options[] = {
{ "no-kvm", 0, QEMU_OPTION_no_kvm },
#endif
{ "no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip },
+ { "cpu-map", HAS_ARG, QEMU_OPTION_cpu_map },
#endif
#if defined(TARGET_PPC) || defined(TARGET_SPARC)
{ "g", 1, QEMU_OPTION_g },
@@ -9211,6 +9214,16 @@ int main(int argc, char **argv)
kvm_irqchip = 0;
break;
}
+ case QEMU_OPTION_cpu_map: {
+ int c = atoi(optarg);
+ char *ptr = strchr(optarg, ':');
+ cpu_set_t set;
+ if (!ptr)
+ fprintf(stderr, "invalid cpu mapping %s\n", ptr);
+ process_cpu_set(++ptr, &set);
+ kvm_store_cpu_affinity(c, &set);
+ break;
+ }
#endif
case QEMU_OPTION_usb:
usb_enabled = 1;
--
1.5.0.6
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2008-03-04 16:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 16:21 [PATCH 0/8] RFC: vcpu pinning at qemu start Glauber Costa
2008-03-04 16:21 ` [PATCH 1/8] add thread id to vcpu structure Glauber Costa
2008-03-04 16:21 ` [PATCH 2/8] provide a gettid function Glauber Costa
2008-03-04 16:21 ` [PATCH 3/8] get thread id at thread's creation Glauber Costa
2008-03-04 16:21 ` [PATCH 4/8] store and set cpu affinities Glauber Costa
2008-03-04 16:21 ` [PATCH 5/8] initialize affinities Glauber Costa
2008-03-04 16:21 ` [PATCH 6/8] stabilish default affinity for newly created cpus Glauber Costa
2008-03-04 16:22 ` [PATCH 7/8] process a cpu affinity mask Glauber Costa
2008-03-04 16:22 ` Glauber Costa [this message]
2008-03-04 17:26 ` [PATCH 0/8] RFC: vcpu pinning at qemu start Joerg Roedel
2008-03-04 18:11 ` Glauber Costa
2008-03-04 18:19 ` Joerg Roedel
2008-03-04 17:42 ` Anthony Liguori
2008-03-04 18:10 ` Glauber Costa
2008-03-04 19:28 ` Anthony Liguori
2008-03-04 19:42 ` Daniel P. Berrange
2008-03-04 20:00 ` Glauber Costa
2008-03-04 19:59 ` Glauber Costa
2008-03-05 3:43 ` Anthony Liguori
2008-03-05 6:44 ` Avi Kivity
2008-03-05 13:10 ` Glauber Costa
2008-03-05 5:35 ` Avi Kivity
2008-03-05 14:29 ` Anthony Liguori
2008-03-05 5:28 ` Avi Kivity
2008-03-05 13:13 ` Glauber Costa
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=1204647759864-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=avi@qumranet.com \
--cc=chrisw@sous-sol.org \
--cc=kvm-devel@lists.sourceforge.net \
/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