qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 4/8] v2: extend parser to parse pin: option
@ 2008-12-16 14:17 Andre Przywara
  2008-12-16 21:17 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Andre Przywara @ 2008-12-16 14:17 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, Avi Kivity

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

Signed-off-by: Andre Przywara <andre.przywara@amd.com>

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 277-84917
----to satisfy European Law for business letters:
AMD Saxony Limited Liability Company & Co. KG,
Wilschdorfer Landstr. 101, 01109 Dresden, Germany
Register Court Dresden: HRA 4896, General Partner authorized
to represent: AMD Saxony LLC (Wilmington, Delaware, US)
General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy

[-- Attachment #2: qemunuma_v2_cmdline_pin.patch --]
[-- Type: text/x-patch, Size: 3096 bytes --]

# HG changeset patch
# User Andre Przywara <andre.przywara@amd.com>
# Date 1229432330 -3600
# Node ID 28e2cf1452bacb7c8fca7154cc259769bd9df79e
# Parent  c966a24fc826ccf77a698492003faeab87f0f9e5
add pin option to -numa cmdline parser

diff -r c966a24fc826 -r 28e2cf1452ba sysemu.h
--- a/sysemu.h	Tue Dec 16 13:51:18 2008 +0100
+++ b/sysemu.h	Tue Dec 16 13:58:50 2008 +0100
@@ -97,9 +97,10 @@ extern int numnumanodes;
 extern int numnumanodes;
 extern uint64_t node_mem[MAX_NODES];
 extern uint64_t node_to_cpus[MAX_NODES];
-
-int parse_numa_args (const char *opt, uint64_t *mems,
-                     uint64_t *cpus, int maxentries, int expect_numnodes);
+extern uint64_t hostnodes[MAX_NODES];
+
+int parse_numa_args(const char *opt, uint64_t *hostnodes, uint64_t *mems,
+                    uint64_t *cpus, int maxentries, int expect_numnodes);
 
 extern int cursor_hide;
 extern int graphic_rotate;
diff -r c966a24fc826 -r 28e2cf1452ba vl.c
--- a/vl.c	Tue Dec 16 13:51:18 2008 +0100
+++ b/vl.c	Tue Dec 16 13:58:50 2008 +0100
@@ -225,6 +225,7 @@ int numnumanodes = 0;
 int numnumanodes = 0;
 uint64_t node_mem[MAX_NODES];
 uint64_t node_to_cpus[MAX_NODES];
+uint64_t hostnodes[MAX_NODES];
 const char *vnc_display;
 int acpi_enabled = 1;
 int fd_bootchk = 1;
@@ -4520,7 +4521,7 @@ static int parse_to_array(const char *ar
     return num;
 }
 
-int parse_numa_args(const char *opt, uint64_t *mems,
+int parse_numa_args(const char *opt, uint64_t *hostnodes, uint64_t *mems,
                      uint64_t *cpus, int maxentries, int expect_numnodes)
 {
 const char *s;
@@ -4547,7 +4548,10 @@ int num = 0;
                 parse_to_array(val, mems, ';', maxentries, PARSE_FLAG_SUFFIX);
             } else if (!strcmp(s, "cpu") && cpus != NULL) {
                 parse_to_array(val, cpus, ';', maxentries, PARSE_FLAG_BITMASK);
+            } else if (!strcmp(s, "pin") && hostnodes != NULL) {
+                parse_to_array(val, hostnodes, ';', maxentries, 0);
             }
+
         }
     }
     free(arg);
@@ -4657,6 +4661,7 @@ int main(int argc, char **argv, char **e
     for(i = 0; i < MAX_NODES; i++) {
         node_to_cpus[i] = 0;
         node_mem[i] = 0;
+        hostnodes[i] = (uint64_t)-1;
     }
 
     usb_devices_index = 0;
@@ -5115,12 +5120,12 @@ int main(int argc, char **argv, char **e
                 break;
             case QEMU_OPTION_numa:
                 if (numnumanodes > 0)
-                    parse_numa_args(optarg, node_mem,
+                    parse_numa_args(optarg, hostnodes, node_mem,
                         node_to_cpus, MAX_NODES, 0);
                 else
-                    numnumanodes = parse_numa_args(optarg,
+                    numnumanodes = parse_numa_args(optarg, hostnodes,
                         node_mem, node_to_cpus, MAX_NODES, 1);
-                numnumanodes = parse_numa_args(optarg,
+                numnumanodes = parse_numa_args(optarg, hostnodes,
                     node_mem, node_to_cpus, MAX_NODES, 1);
                 if (numnumanodes < 0) {
                     fprintf(stderr, "Invalid number of NUMA nodes\n");

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-17  0:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 14:17 [Qemu-devel] [PATCH 4/8] v2: extend parser to parse pin: option Andre Przywara
2008-12-16 21:17 ` [Qemu-devel] " Anthony Liguori
2008-12-16 23:25   ` Andre Przywara
2008-12-17  0:19     ` Anthony Liguori

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).