[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [QEMU][RFC PATCH 1/6] option: Add -xen-dmid



With this option, QEMU knows it's ID and can retrieve it's configuration
from XenStore.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 hw/xen.h        |    1 +
 qemu-options.hx |    2 ++
 vl.c            |    8 ++++++++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/xen.h b/hw/xen.h
index b46879c..b056b13 100644
--- a/hw/xen.h
+++ b/hw/xen.h
@@ -18,6 +18,7 @@ enum xen_mode {
 };
 
 extern uint32_t xen_domid;
+extern uint32_t xen_dmid;
 extern enum xen_mode xen_mode;
 
 extern int xen_allowed;
diff --git a/qemu-options.hx b/qemu-options.hx
index daefce3..95c87f8 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2364,6 +2364,8 @@ DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
     "-xen-attach     attach to existing xen domain\n"
     "                xend will use this when starting qemu\n",
     QEMU_ARCH_ALL)
+DEF("xen-dmid", HAS_ARG, QEMU_OPTION_xen_dmid,
+    "-xen-dmid id  specify the device model id for xenstore\n", QEMU_ARCH_ALL)
 STEXI
 @item -xen-domid @var{id}
 @findex -xen-domid
diff --git a/vl.c b/vl.c
index bd95539..36f2111 100644
--- a/vl.c
+++ b/vl.c
@@ -263,6 +263,7 @@ int kvm_allowed = 0;
 int xen_allowed = 0;
 uint32_t xen_domid;
 enum xen_mode xen_mode = XEN_EMULATE;
+uint32_t xen_dmid = 0;
 static int tcg_tb_size;
 
 static int default_serial = 1;
@@ -3132,6 +3133,13 @@ int main(int argc, char **argv, char **envp)
                 }
                 xen_mode = XEN_ATTACH;
                 break;
+           case QEMU_OPTION_xen_dmid:
+                if (!(xen_available())) {
+                    printf("Option %s not supported for this target\n", 
popt->name);
+                    exit(1);
+                }
+                xen_dmid = atoi(optarg);
+                break;
             case QEMU_OPTION_trace:
             {
                 opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0);
-- 
Julien Grall


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.