]> xenbits.xensource.com Git - people/liuw/qemu.git/commitdiff
vl: add -xen-stubdom option
authorWei Liu <wei.liu2@citrix.com>
Fri, 17 Apr 2015 09:51:22 +0000 (10:51 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 16 Oct 2015 15:18:44 +0000 (16:18 +0100)
This option marks whether QEMU is running inside a Xen stubdom. This
will change behaviour of QEMU, i.e. certain Xen modules might not be
activated, some extra Xen modules might need to be activated.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
include/hw/xen/xen.h
qemu-options.hx
vl.c

index b0ed04caa966e6572a81f269e5f2b64478c7de3f..dff5a59c48159bf9143eb19db5df48b4d9fec5dc 100644 (file)
@@ -22,6 +22,7 @@ extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
 
 extern bool xen_allowed;
+extern bool xen_stubdom;
 
 static inline bool xen_enabled(void)
 {
index 64af16d64ce97911cbc521c7588805b7023fac68..8ae4e9aef36e1a6536f0a37152043e019791e922 100644 (file)
@@ -2919,6 +2919,8 @@ Enable KVM full virtualization support. This option is only available
 if KVM support is enabled when compiling.
 ETEXI
 
+DEF("xen-stubdom", 0, QEMU_OPTION_xen_stubdom,
+    "-xen-stubdom     run inside a stubdom\n", QEMU_ARCH_ALL)
 DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
     "-xen-domid id   specify xen guest domain id\n", QEMU_ARCH_ALL)
 DEF("xen-create", 0, QEMU_OPTION_xen_create,
@@ -2930,6 +2932,9 @@ DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
     "                xend will use this when starting QEMU\n",
     QEMU_ARCH_ALL)
 STEXI
+@item -xen-stubdom
+@findex -xen-stubdom
+Run inside a stubdom (XEN only)
 @item -xen-domid @var{id}
 @findex -xen-domid
 Specify xen guest domain @var{id} (XEN only).
diff --git a/vl.c b/vl.c
index 91411c1fa86e12139fe55c0c9995eb320eb84866..6da74a96f5e9cf75bc7d9683399045edc7bd427f 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -206,6 +206,7 @@ static NotifierList machine_init_done_notifiers =
     NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
 
 bool xen_allowed;
+bool xen_stubdom = false;
 uint32_t xen_domid;
 enum xen_mode xen_mode = XEN_EMULATE;
 
@@ -3669,6 +3670,13 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_nodefaults:
                 has_defaults = 0;
                 break;
+           case QEMU_OPTION_xen_stubdom:
+                if (!(xen_available())) {
+                    printf("Option %s not supported for this target\n", popt->name);
+                    exit(1);
+                }
+                xen_stubdom = true;
+                break;
             case QEMU_OPTION_xen_domid:
                 if (!(xen_available())) {
                     printf("Option %s not supported for this target\n", popt->name);