diff mbox

[RFC,2/3] libxl: upstream Qemu as PV backend for IOEMU stubdom

Message ID 1498428931-465-3-git-send-email-watermansrdev@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Waterman June 25, 2017, 10:15 p.m. UTC
Process xl.cfg file setting for PV device model version.
Valid values are qemu-xen and qemu-xen-traditional.

Signed-off-by: Simon Waterman <watermansrdev@gmail.com>
---
 tools/xl/xl_parse.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox

Patch

diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 856a304..48cbb18 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1883,6 +1883,25 @@  skip_usbdev:
     xlu_cfg_replace_string(config, "device_model_user",
                            &b_info->device_model_user, 0);
 
+    if (!xlu_cfg_get_string (config, "device_model_pv_version", &buf, 0)) {
+        if (!libxl_defbool_val(b_info->device_model_stubdomain)) {
+            fprintf(stderr, "WARNING: device_model_pv_version specified but no stub domain\n");
+        }
+        if (!strcmp(buf, "qemu-xen-traditional")) {
+            b_info->device_model_pv_version
+                = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+        } else if (!strcmp(buf, "qemu-xen")) {
+            b_info->device_model_pv_version
+                = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
+        } else {
+            fprintf(stderr,
+                    "Unknown device_model_pv_version \"%s\" specified\n", buf);
+            exit(1);
+        }
+    } else 
+        b_info->device_model_pv_version
+            = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+
 #define parse_extra_args(type)                                            \
     e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
                                     &b_info->extra##type, 0);            \