xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xl: Add 'pvh' config option
@ 2017-03-30 23:06 Boris Ostrovsky
  2017-03-31 10:23 ` Roger Pau Monné
  0 siblings, 1 reply; 10+ messages in thread
From: Boris Ostrovsky @ 2017-03-30 23:06 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, Boris Ostrovsky, wei.liu2, roger.pau

In addition to 'device_model_version="none"' config option users can
also use 'pvh=1' in xl configuration file when creating a PVH guest.

We can skip parsing options related to device model once we establish
that we are building PVH guest.

Also process 'device_model_version="none"' for HVM guests only since
it is not a valid model for PV guests.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 docs/man/xl.cfg.pod.5.in |  7 ++++++-
 tools/xl/xl_parse.c      | 12 +++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in
index 206d33e..5833987 100644
--- a/docs/man/xl.cfg.pod.5.in
+++ b/docs/man/xl.cfg.pod.5.in
@@ -1201,6 +1201,11 @@ expose unexpected bugs in the guest, or find bugs in Xen, so it is
 possible to disable this feature.  Use of out of sync page tables,
 when Xen thinks it appropriate, is the default.
 
+=item B<pvh=BOOLEAN>
+
+Don't use any device model. This requires a kernel capable of booting
+without emulated devices. Default is 0.
+
 =item B<shadow_memory=MBYTES>
 
 Number of megabytes to set aside for shadowing guest pagetable pages
@@ -1966,7 +1971,7 @@ This device-model is still the default for NetBSD dom0.
 =item B<none>
 
 Don't use any device model. This requires a kernel capable of booting
-without emulated devices.
+without emulated devices. This is a synonym for L</"pvh"> option above.
 
 =back
 
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 66327dc..aa591cd 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1817,6 +1817,12 @@ skip_usbdev:
         break;
     }
 
+    if (c_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+        !xlu_cfg_get_long(config, "pvh", &l, 0) && l) {
+        b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_NONE;
+        goto skip_device_model;
+    }
+
     /* parse device model arguments, this works for pv, hvm and stubdom */
     if (!xlu_cfg_get_string (config, "device_model", &buf, 0)) {
         fprintf(stderr,
@@ -1845,8 +1851,10 @@ skip_usbdev:
         } else if (!strcmp(buf, "qemu-xen")) {
             b_info->device_model_version
                 = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
-        } else if (!strcmp(buf, "none")) {
+        } else if (c_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+                   !strcmp(buf, "none")) {
             b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_NONE;
+            goto skip_device_model;
         } else {
             fprintf(stderr,
                     "Unknown device_model_version \"%s\" specified\n", buf);
@@ -1884,6 +1892,8 @@ skip_usbdev:
 
 #undef parse_extra_args
 
+skip_device_model:
+
     /* If we've already got vfb=[] for PV guest then ignore top level
      * VNC config. */
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && !d_config->num_vfbs) {
-- 
2.7.4


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

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

end of thread, other threads:[~2017-03-31 15:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-30 23:06 [PATCH] xl: Add 'pvh' config option Boris Ostrovsky
2017-03-31 10:23 ` Roger Pau Monné
2017-03-31 11:20   ` Wei Liu
2017-03-31 13:43   ` Boris Ostrovsky
2017-03-31 13:49     ` Wei Liu
2017-03-31 13:59       ` Boris Ostrovsky
2017-03-31 14:11         ` Wei Liu
2017-03-31 14:26         ` Roger Pau Monné
2017-03-31 14:33           ` Ian Jackson
2017-03-31 15:08             ` Boris Ostrovsky

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