Skip to contentSkip to conversation

Add device_model_pvdevice parameter for HVM guests

PATCH Superseded Paul Durrant 3 participants 12 messages Jul 18, 2013 – Aug 2, 2013

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add device_model_pvdevice parameter for HVM guests

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no argument will be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +23 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-xen.
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +8 -0
index 37e4d82..4170861 100644
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the libxl_device_model_pvdevice
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
tools/libxl/libxl_dm.c +9 -0
index 7e54c02..2a2665b 100644
@@ -647,6 +647,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-drive");
             flexarray_append(dm_args, drive);
         }
+
+        switch (b_info->u.hvm.device_model_pvdevice) {
+        case LIBXL_DEVICE_MODEL_PVDEVICE_XENSERVER:
+            flexarray_append(dm_args, "-device");
+            flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000");
+            break;
+        default:
+            break;
+        }
     }
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
tools/libxl/libxl_types.idl +5 -0
index d218a2d..7165139 100644
@@ -132,6 +132,10 @@ libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (2, "STD"),
     ], init_val = 0)
 
+libxl_device_model_pvdevice = Enumeration("device_model_pvdevice", [
+    (0, "NONE"),
+    (1, "XENSERVER"),
+    ])
 #
 # Complex libxl types
 #
@@ -332,6 +336,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
                                        ("usbdevice_list",   libxl_string_list),
+                                       ("device_model_pvdevice", libxl_device_model_pvdevice),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
tools/libxl/xl_cmdimpl.c +14 -0
index 8a478ba..cfaa54e 100644
@@ -1526,6 +1526,20 @@ skip_vfb:
             exit (1);
 
         }
+
+        if (!xlu_cfg_get_string (config, "device_model_pvdevice", &buf, 0)) {
+            libxl_device_model_pvdevice d;
+
+            e = libxl_device_model_pvdevice_from_string(buf, &d);
+            if (e) {
+                fprintf(stderr,
+                        "xl: unknown device_model_pvdevice '%s'\n",
+                        buf);
+                exit(-ERROR_FAIL);
+            }
+                
+            b_info->u.hvm.device_model_pvdevice = d;
+        }
     }
 
     xlu_cfg_destroy(config);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 18 lines

-----Original Message-----
From: Paul Durrant [mailto:[email protected]]
Sent: 18 July 2013 14:47
To: [email protected]
Cc: Paul Durrant; Stefano Stabellini; Ian Campbell; Ian Jackson
Subject: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no argument will
be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Quoted 7 lines

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

Ping?

I hope I've addressed all comments now. Is this stalled on the QEMU side of things?

Paul

Quoted 134 lines
 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +23 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-xen.
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +8 -0
index 37e4d82..4170861 100644
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the libxl_device_model_pvdevice
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
tools/libxl/libxl_dm.c +9 -0
index 7e54c02..2a2665b 100644
@@ -647,6 +647,15 @@ static char **
 libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-drive");
             flexarray_append(dm_args, drive);
         }
+
+        switch (b_info->u.hvm.device_model_pvdevice) {
+        case LIBXL_DEVICE_MODEL_PVDEVICE_XENSERVER:
+            flexarray_append(dm_args, "-device");
+            flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000");
+            break;
+        default:
+            break;
+        }
     }
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
tools/libxl/libxl_types.idl +0 -0
index d218a2d..7165139 100644
@@ -132,6 +132,10 @@ libxl_vga_interface_type =

Enumeration("vga_interface_type", [

     (2, "STD"),
     ], init_val = 0)
tools/libxl/libxl_types.idl +4 -0
+libxl_device_model_pvdevice = Enumeration("device_model_pvdevice", [
+    (0, "NONE"),
+    (1, "XENSERVER"),
+    ])
 #
 # Complex libxl types
 #
@@ -332,6 +336,7 @@ libxl_domain_build_info =

Struct("domain_build_info",[
("soundhw", string),
("xen_platform_pci", libxl_defbool),
("usbdevice_list", libxl_string_list),
+ ("device_model_pvdevice",
libxl_device_model_pvdevice),

                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
tools/libxl/xl_cmdimpl.c +14 -1
index 8a478ba..cfaa54e 100644
@@ -1526,6 +1526,20 @@ skip_vfb:
             exit (1);
 
         }
+
+        if (!xlu_cfg_get_string (config, "device_model_pvdevice", &buf, 0)) {
+            libxl_device_model_pvdevice d;
+
+            e = libxl_device_model_pvdevice_from_string(buf, &d);
+            if (e) {
+                fprintf(stderr,
+                        "xl: unknown device_model_pvdevice '%s'\n",
+                        buf);
+                exit(-ERROR_FAIL);
+            }
+
+            b_info->u.hvm.device_model_pvdevice = d;
+        }
     }
 
     xlu_cfg_destroy(config);
--

1.7.10.4

#2 lore raw
Quoted 26 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Paul Durrant [mailto:[email protected]]
Sent: 18 July 2013 14:47
To: [email protected]
Cc: Paul Durrant; Stefano Stabellini; Ian Campbell; Ian Jackson
Subject: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no argument will
be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Quoted 7 lines

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

Quoted 3 lines

Ping?

I hope I've addressed all comments now. Is this stalled on the QEMU side of things?

yes, I was hoping it would go into upstream qemu first so we know they are happy with the cmdline interface etc. No point accepting this first and then having to change it if they want it done differently etc.

Quoted 138 lines

Paul

Quoted 134 lines
 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +23 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-xen.
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +8 -0
index 37e4d82..4170861 100644
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the libxl_device_model_pvdevice
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
tools/libxl/libxl_dm.c +9 -0
index 7e54c02..2a2665b 100644
@@ -647,6 +647,15 @@ static char **
 libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-drive");
             flexarray_append(dm_args, drive);
         }
+
+        switch (b_info->u.hvm.device_model_pvdevice) {
+        case LIBXL_DEVICE_MODEL_PVDEVICE_XENSERVER:
+            flexarray_append(dm_args, "-device");
+            flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000");
+            break;
+        default:
+            break;
+        }
     }
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
tools/libxl/libxl_types.idl +0 -0
index d218a2d..7165139 100644
@@ -132,6 +132,10 @@ libxl_vga_interface_type =

Enumeration("vga_interface_type", [

     (2, "STD"),
     ], init_val = 0)
tools/libxl/libxl_types.idl +4 -0
+libxl_device_model_pvdevice = Enumeration("device_model_pvdevice", [
+    (0, "NONE"),
+    (1, "XENSERVER"),
+    ])
 #
 # Complex libxl types
 #
@@ -332,6 +336,7 @@ libxl_domain_build_info =

Struct("domain_build_info",[
("soundhw", string),
("xen_platform_pci", libxl_defbool),
("usbdevice_list", libxl_string_list),
+ ("device_model_pvdevice",
libxl_device_model_pvdevice),

                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
tools/libxl/xl_cmdimpl.c +14 -1
index 8a478ba..cfaa54e 100644
@@ -1526,6 +1526,20 @@ skip_vfb:
             exit (1);
 
         }
+
+        if (!xlu_cfg_get_string (config, "device_model_pvdevice", &buf, 0)) {
+            libxl_device_model_pvdevice d;
+
+            e = libxl_device_model_pvdevice_from_string(buf, &d);
+            if (e) {
+                fprintf(stderr,
+                        "xl: unknown device_model_pvdevice '%s'\n",
+                        buf);
+                exit(-ERROR_FAIL);
+            }
+
+            b_info->u.hvm.device_model_pvdevice = d;
+        }
     }
 
     xlu_cfg_destroy(config);
--

1.7.10.4

#3 lore raw
Quoted 37 lines

-----Original Message-----
From: Ian Campbell [mailto:[email protected]]
Sent: 22 July 2013 18:52
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Paul Durrant [mailto:[email protected]]
Sent: 18 July 2013 14:47
To: [email protected]
Cc: Paul Durrant; Stefano Stabellini; Ian Campbell; Ian Jackson
Subject: [PATCH v2] Add device_model_pvdevice parameter for HVM

guests

Quoted 3 lines
Quoted 3 lines

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no

argument

Quoted 17 lines
Quoted 16 lines

will
be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

Quoted 9 lines
Quoted 3 lines

Ping?

I hope I've addressed all comments now. Is this stalled on the QEMU side

of things?

yes, I was hoping it would go into upstream qemu first so we know they are happy with the cmdline interface etc. No point accepting this first and then having to change it if they want it done differently etc.

The qemu patch is all acked/reviewed and ready to go. Just waiting for Stefano to send a pull request AFAIK... Stefano?

Paul

Quoted 143 lines
Quoted 29 lines

Paul

Quoted 26 lines
 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +11 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+
+The xen-pvdevice should be omitted. This is the default.
+
Quoted 8 lines

docs/man/xl.cfg.pod.5 you have selected.

Quoted 8 lines
docs/man/xl.cfg.pod.5 +8 -0
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-

xen.

Quoted 14 lines
Quoted 14 lines
docs/man/xl.cfg.pod.5 +4 -0
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +0 -0
index 37e4d82..4170861 100644
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
Quoted 2 lines

tools/libxl/libxl.h line 85

Quoted 2 lines
tools/libxl/libxl.h +1 -0
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the

libxl_device_model_pvdevice

Quoted 40 lines
Quoted 40 lines
tools/libxl/libxl.h +7 -0
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
tools/libxl/libxl_dm.c +9 -0
index 7e54c02..2a2665b 100644
@@ -647,6 +647,15 @@ static char **
 libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-drive");
             flexarray_append(dm_args, drive);
         }
+
+        switch (b_info->u.hvm.device_model_pvdevice) {
+        case LIBXL_DEVICE_MODEL_PVDEVICE_XENSERVER:
+            flexarray_append(dm_args, "-device");
+            flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000");
+            break;
+        default:
+            break;
+        }
     }
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
tools/libxl/libxl_types.idl +0 -0
index d218a2d..7165139 100644
@@ -132,6 +132,10 @@ libxl_vga_interface_type =

Enumeration("vga_interface_type", [

     (2, "STD"),
     ], init_val = 0)
Quoted 1 line
Quoted 1 line

+libxl_device_model_pvdevice =

Enumeration("device_model_pvdevice", [

Quoted 23 lines
Quoted 23 lines
tools/libxl/libxl_types.idl +3 -0
+    (0, "NONE"),
+    (1, "XENSERVER"),
+    ])
 #
 # Complex libxl types
 #
@@ -332,6 +336,7 @@ libxl_domain_build_info =

Struct("domain_build_info",[
("soundhw", string),
("xen_platform_pci", libxl_defbool),
("usbdevice_list", libxl_string_list),
+ ("device_model_pvdevice",
libxl_device_model_pvdevice),

                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
tools/libxl/xl_cmdimpl.c +0 -0
index 8a478ba..cfaa54e 100644
@@ -1526,6 +1526,20 @@ skip_vfb:
             exit (1);
 
Quoted 3 lines

tools/libxl/xl_cmdimpl.c skip_vfb: · line 1530

Quoted 3 lines
tools/libxl/xl_cmdimpl.c +2 -0
         }
+
+        if (!xlu_cfg_get_string (config, "device_model_pvdevice", &buf, 0))

{

Quoted 18 lines
Quoted 17 lines
tools/libxl/xl_cmdimpl.c +12 -1
+            libxl_device_model_pvdevice d;
+
+            e = libxl_device_model_pvdevice_from_string(buf, &d);
+            if (e) {
+                fprintf(stderr,
+                        "xl: unknown device_model_pvdevice '%s'\n",
+                        buf);
+                exit(-ERROR_FAIL);
+            }
+
+            b_info->u.hvm.device_model_pvdevice = d;
+        }
     }
 
     xlu_cfg_destroy(config);
--

1.7.10.4

#4 lore raw
Quoted 40 lines · Paul Durrant
Quoted 40 lines

-----Original Message-----
From: Ian Campbell [mailto:[email protected]]
Sent: 22 July 2013 18:52
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Paul Durrant [mailto:[email protected]]
Sent: 18 July 2013 14:47
To: [email protected]
Cc: Paul Durrant; Stefano Stabellini; Ian Campbell; Ian Jackson
Subject: [PATCH v2] Add device_model_pvdevice parameter for HVM

guests

Quoted 3 lines
Quoted 3 lines

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no

argument

Quoted 20 lines
Quoted 9 lines

will
be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Quoted 7 lines

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

Ping?

I hope I've addressed all comments now. Is this stalled on the QEMU side

Quoted 8 lines
Quoted 6 lines

of things?

yes, I was hoping it would go into upstream qemu first so we know they are happy with the cmdline interface etc. No point accepting this first and then having to change it if they want it done differently etc.

The qemu patch is all acked/reviewed and ready to go. Just waiting for Stefano to send a pull request AFAIK... Stefano?

Yep, it's queued up. I'll send it upstream in the next days.

#5 lore raw
Quoted 59 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 23 July 2013 11:51
To: Paul Durrant
Cc: Ian Campbell; [email protected]; Stefano Stabellini; Ian Jackson
Subject: RE: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 15 lines · Paul Durrant
Quoted 15 lines

-----Original Message-----
From: Ian Campbell [mailto:[email protected]]
Sent: 22 July 2013 18:52
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Paul Durrant [mailto:[email protected]]
Sent: 18 July 2013 14:47
To: [email protected]
Cc: Paul Durrant; Stefano Stabellini; Ian Campbell; Ian Jackson
Subject: [PATCH v2] Add device_model_pvdevice parameter for HVM

Quoted 3 lines
Quoted 3 lines

guests

Quoted 2 lines
Quoted 2 lines

The parameter determines which, if any, xen-pvdevice is specified on

the

Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

QEMU command line. The default value is 'none' which means no

argument

Quoted 2 lines
Quoted 2 lines

will
be passed. A value of 'xenserver' specifies a xen-pvdevice with

device-id

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines

0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Ping?

I hope I've addressed all comments now. Is this stalled on the QEMU

side

Quoted 7 lines
Quoted 6 lines

of things?

yes, I was hoping it would go into upstream qemu first so we know they are happy with the cmdline interface etc. No point accepting this first and then having to change it if they want it done differently etc.

Quoted 4 lines
Quoted 1 line

The qemu patch is all acked/reviewed and ready to go. Just waiting for

Stefano to send a pull request AFAIK... Stefano?

Yep, it's queued up. I'll send it upstream in the next days.

Cool. Thanks.

Paul

#6 lore raw
In reply to Paul Durrant
Quoted 63 lines · Paul Durrant

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no argument will be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +23 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-xen.
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +0 -0
index 37e4d82..4170861 100644

tools/libxl/libxl.h line 90

Quoted 9 lines
tools/libxl/libxl.h +6 -0
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the libxl_device_model_pvdevice
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1

Can we expand this name a bit, to make it clear what PVDEVICE refers to? LIBXL_HAVE_PLATFORM_PVDEVICE_TYPES? or _VARIANTS? Bit clumsy?

While at it I'd be tempted to s/device_model_pvdevice/platform_device_type/ or something in the API (both the Enum and the field). The related overall boolean control is xen_platform_pci, so perhaps something derived from that?

Sorry for spotting this after so long.

Quoted 73 lines
tools/libxl/libxl.h +2 -0
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
tools/libxl/libxl_dm.c +9 -0
index 7e54c02..2a2665b 100644
@@ -647,6 +647,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-drive");
             flexarray_append(dm_args, drive);
         }
+
+        switch (b_info->u.hvm.device_model_pvdevice) {
+        case LIBXL_DEVICE_MODEL_PVDEVICE_XENSERVER:
+            flexarray_append(dm_args, "-device");
+            flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000");
+            break;
+        default:
+            break;
+        }
     }
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
tools/libxl/libxl_types.idl +5 -0
index d218a2d..7165139 100644
@@ -132,6 +132,10 @@ libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (2, "STD"),
     ], init_val = 0)
 
+libxl_device_model_pvdevice = Enumeration("device_model_pvdevice", [
+    (0, "NONE"),
+    (1, "XENSERVER"),
+    ])
 #
 # Complex libxl types
 #
@@ -332,6 +336,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
                                        ("usbdevice_list",   libxl_string_list),
+                                       ("device_model_pvdevice", libxl_device_model_pvdevice),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
tools/libxl/xl_cmdimpl.c +14 -0
index 8a478ba..cfaa54e 100644
@@ -1526,6 +1526,20 @@ skip_vfb:
             exit (1);
 
         }
+
+        if (!xlu_cfg_get_string (config, "device_model_pvdevice", &buf, 0)) {
+            libxl_device_model_pvdevice d;
+
+            e = libxl_device_model_pvdevice_from_string(buf, &d);
+            if (e) {
+                fprintf(stderr,
+                        "xl: unknown device_model_pvdevice '%s'\n",
+                        buf);
+                exit(-ERROR_FAIL);
+            }
+                
+            b_info->u.hvm.device_model_pvdevice = d;
+        }
     }
 
     xlu_cfg_destroy(config);
#7 lore raw
Quoted 87 lines

-----Original Message-----
From: Ian Campbell
Sent: 02 August 2013 15:32
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 2 lines · Paul Durrant

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no

argument will

Quoted 39 lines

be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +9 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+

docs/man/xl.cfg.pod.5 you have selected. · line 1248

Quoted 10 lines
docs/man/xl.cfg.pod.5 +10 -0
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-

xen.

Quoted 12 lines
docs/man/xl.cfg.pod.5 +4 -0
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +0 -0
index 37e4d82..4170861 100644

tools/libxl/libxl.h line 90

Quoted 9 lines
tools/libxl/libxl.h +6 -0
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the libxl_device_model_pvdevice
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1

Can we expand this name a bit, to make it clear what PVDEVICE refers to? LIBXL_HAVE_PLATFORM_PVDEVICE_TYPES? or _VARIANTS? Bit clumsy?

Quoted 5 lines

While at it I'd be tempted to s/device_model_pvdevice/platform_device_type/ or something in the API (both the Enum and the field). The related overall boolean control is xen_platform_pci, so perhaps something derived from that?

This is orthogonal to xen_platform_pci. The exists regardless of the xen_platform_pci boolean (and, in fact, the platform device also exists in upstream qemu regardless of that boolean). Do we really want to start confusing the two things (again)? So, doesn't LIBXL_HAVE_PVDEVICE cover it? The intention is there's only ever going to be one of them.

Paul

Quoted 81 lines

Sorry for spotting this after so long.

tools/libxl/libxl_dm.c static char **

Quoted 10 lines
tools/libxl/libxl.h +2 -0
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
tools/libxl/libxl_dm.c +0 -0
index 7e54c02..2a2665b 100644
@@ -647,6 +647,15 @@ static char **

libxl__build_device_model_args_new(libxl__gc *gc,

tools/libxl/libxl_types.idl libxl_vga_interface_type =

Quoted 20 lines
tools/libxl/libxl_dm.c +9 -0
             flexarray_append(dm_args, "-drive");
             flexarray_append(dm_args, drive);
         }
+
+        switch (b_info->u.hvm.device_model_pvdevice) {
+        case LIBXL_DEVICE_MODEL_PVDEVICE_XENSERVER:
+            flexarray_append(dm_args, "-device");
+            flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000");
+            break;
+        default:
+            break;
+        }
     }
     flexarray_append(dm_args, NULL);
     return (char **) flexarray_contents(dm_args);
tools/libxl/libxl_types.idl +0 -0
index d218a2d..7165139 100644
@@ -132,6 +132,10 @@ libxl_vga_interface_type =

Enumeration("vga_interface_type", [

tools/libxl/libxl_types.idl libxl_vga_interface_type = Enumeration("vga_interface_type", [

Quoted 4 lines
tools/libxl/libxl_types.idl +1 -0
     (2, "STD"),
     ], init_val = 0)
 
+libxl_device_model_pvdevice = Enumeration("device_model_pvdevice",

[

tools/libxl/libxl_types.idl libxl_domain_build_info =

Quoted 7 lines
tools/libxl/libxl_types.idl +3 -0
+    (0, "NONE"),
+    (1, "XENSERVER"),
+    ])
 #
 # Complex libxl types
 #
@@ -332,6 +336,7 @@ libxl_domain_build_info =

Struct("domain_build_info",[

tools/libxl/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[

Quoted 4 lines
tools/libxl/libxl_types.idl +1 -0
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
                                        ("usbdevice_list",   libxl_string_list),
+                                       ("device_model_pvdevice",

libxl_device_model_pvdevice),

Quoted 28 lines
tools/libxl/libxl_types.idl +0 -0
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
tools/libxl/xl_cmdimpl.c +14 -0
index 8a478ba..cfaa54e 100644
@@ -1526,6 +1526,20 @@ skip_vfb:
             exit (1);
 
         }
+
+        if (!xlu_cfg_get_string (config, "device_model_pvdevice", &buf, 0)) {
+            libxl_device_model_pvdevice d;
+
+            e = libxl_device_model_pvdevice_from_string(buf, &d);
+            if (e) {
+                fprintf(stderr,
+                        "xl: unknown device_model_pvdevice '%s'\n",
+                        buf);
+                exit(-ERROR_FAIL);
+            }
+
+            b_info->u.hvm.device_model_pvdevice = d;
+        }
     }
 
     xlu_cfg_destroy(config);
#8 lore raw
Quoted 93 lines · Paul Durrant
Quoted 87 lines

-----Original Message-----
From: Ian Campbell
Sent: 02 August 2013 15:32
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 2 lines · Paul Durrant

The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no

argument will

Quoted 39 lines

be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +9 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+

docs/man/xl.cfg.pod.5 you have selected. · line 1248

Quoted 10 lines
docs/man/xl.cfg.pod.5 +10 -0
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-

xen.

Quoted 12 lines
docs/man/xl.cfg.pod.5 +4 -0
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +0 -0
index 37e4d82..4170861 100644

tools/libxl/libxl.h line 90

Quoted 9 lines
tools/libxl/libxl.h +6 -0
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the libxl_device_model_pvdevice
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1

Can we expand this name a bit, to make it clear what PVDEVICE refers to? LIBXL_HAVE_PLATFORM_PVDEVICE_TYPES? or _VARIANTS? Bit clumsy?

Quoted 5 lines

While at it I'd be tempted to s/device_model_pvdevice/platform_device_type/ or something in the API (both the Enum and the field). The related overall boolean control is xen_platform_pci, so perhaps something derived from that?

Quoted 4 lines

This is orthogonal to xen_platform_pci. The exists regardless of the xen_platform_pci boolean (and, in fact, the platform device also exists in upstream qemu regardless of that boolean). Do we really want to start confusing the two things (again)?

Ah, I mistakenly thought this overrode that one or was conditional on it, that explains the NONE in the Enum which I vaguely wondered about too.

I'd like to avoid "device_model" in the name since that is an implementation detail and not something which is really relevant to the user who is asking for a domain to be created with certain properties.

Quoted 2 lines

So, doesn't LIBXL_HAVE_PVDEVICE cover it? The intention is there's only ever going to be one of them.

PVDEVICE is a very broad term, does it mean PVNIC, PVCONSOLE, PVDISK etc? How does it relate to a PVDOMAIN etc. I know we both know the answer to what this is but the API should be less ambiguous.

Ian.

#9 lore raw
Quoted 111 lines

-----Original Message-----
From: Ian Campbell
Sent: 02 August 2013 16:37
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 10 lines · Paul Durrant
Quoted 10 lines

-----Original Message-----
From: Ian Campbell
Sent: 02 August 2013 15:32
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 1 line · Paul Durrant

The parameter determines which, if any, xen-pvdevice is specified on

the

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

QEMU command line. The default value is 'none' which means no

argument will

Quoted 1 line

be passed. A value of 'xenserver' specifies a xen-pvdevice with device-

id

Quoted 63 lines
Quoted 63 lines
Quoted 38 lines

0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt).

Cc Stefano Stabellini <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
v2:
- Added LIBXL_HAVE_PVDEVICE to libxl.h
- Added more text to xl.cfg manpage to call out the device-id of the xenserver pvdevice and point readers at docs/misc/pci-device-reservations.txt

 docs/man/xl.cfg.pod.5       |   23 +++++++++++++++++++++++
 tools/libxl/libxl.h         |    8 ++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    5 +++++
 tools/libxl/xl_cmdimpl.c    |   14 ++++++++++++++
 5 files changed, 59 insertions(+)
docs/man/xl.cfg.pod.5 +9 -0
index 069b73f..bf6760f 100644
@@ -1227,6 +1227,29 @@ you have selected.
 
 Assign an XSM security label to the device-model stubdomain.
 
+=item B<device_model_pvdevice="PVDEVICE">
+
+Selects which variant of the xen-pvdevice should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<none>
+

docs/man/xl.cfg.pod.5 you have selected. · line 1248

Quoted 10 lines
docs/man/xl.cfg.pod.5 +10 -0
+The xen-pvdevice should be omitted. This is the default.
+
+=item B<xenserver>
+
+The xenserver variant of the xen-pvdevice (device-id=C000) will be
+specified, enabling the use of XenServer PV drivers in the guest.
+
+=back
+
+This parameter only takes effect when device_model_version=qemu-

xen.

Quoted 14 lines
docs/man/xl.cfg.pod.5 +4 -0
+See F<docs/misc/pci-device-reservations.txt> for more information.
+
+=back
+
 =item B<device_model_args=[ "ARG", "ARG", ...]>
 
 Pass additional arbitrary options on the device-model command
tools/libxl/libxl.h +0 -0
index 37e4d82..4170861 100644
@@ -82,6 +82,14 @@
 #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
 
Quoted 2 lines
Quoted 2 lines

tools/libxl/libxl.h line 85

Quoted 2 lines
tools/libxl/libxl.h +1 -0
 /*
+ * LIBXL_HAVE_PVDEVICE indicates that the

libxl_device_model_pvdevice

Quoted 11 lines
Quoted 11 lines

tools/libxl/libxl.h line 90

Quoted 5 lines
tools/libxl/libxl.h +5 -0
+ * field is present in the hvm sections of libxl_domain_build_info.
+ * This field tells libxl which flavour of xen-pvdevice to enable in
+ * QEMU.
+ */
+#define LIBXL_HAVE_PVDEVICE 1

Can we expand this name a bit, to make it clear what PVDEVICE refers to? LIBXL_HAVE_PLATFORM_PVDEVICE_TYPES? or _VARIANTS? Bit clumsy?

While at it I'd be tempted to s/device_model_pvdevice/platform_device_type/ or something in the

API

Quoted 8 lines
Quoted 3 lines

(both the Enum and the field). The related overall boolean control is xen_platform_pci, so perhaps something derived from that?

This is orthogonal to xen_platform_pci. The exists regardless of the xen_platform_pci boolean (and, in fact, the platform device also exists in upstream qemu regardless of that boolean). Do we really want to start confusing the two things (again)?

Quoted 8 lines

Ah, I mistakenly thought this overrode that one or was conditional on it, that explains the NONE in the Enum which I vaguely wondered about too.

I'd like to avoid "device_model" in the name since that is an implementation detail and not something which is really relevant to the user who is asking for a domain to be created with certain properties.

Ok, I can drop that. I was only following suit. I prefer shorter names anyway :-)

Quoted 7 lines
Quoted 2 lines

So, doesn't LIBXL_HAVE_PVDEVICE cover it? The intention is there's only ever going to be one of them.

PVDEVICE is a very broad term, does it mean PVNIC, PVCONSOLE, PVDISK etc? How does it relate to a PVDOMAIN etc. I know we both know the answer to what this is but the API should be less ambiguous.

How about VENDOR_DEVICE? That probably captures the intention (and makes more sense when you consider the only available value apart fromn 'none' is 'citrix').

Paul

#10 lore raw
Quoted 11 lines · Paul Durrant
Quoted 7 lines
Quoted 2 lines

So, doesn't LIBXL_HAVE_PVDEVICE cover it? The intention is there's only ever going to be one of them.

PVDEVICE is a very broad term, does it mean PVNIC, PVCONSOLE, PVDISK etc? How does it relate to a PVDOMAIN etc. I know we both know the answer to what this is but the API should be less ambiguous.

How about VENDOR_DEVICE? That probably captures the intention (and makes more sense when you consider the only available value apart fromn 'none' is 'citrix').

vendor device sounds good to me.

Should be HVM_VENDOR_DEVICE though I think and it looks like we've fallen into the pattern of LIBXL_HAVE_<STRUCT>_<FIELD>, so how about LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE? and u.hvm.vendor_device for the field itself?

Ian.

#11 lore raw
Quoted 21 lines

-----Original Message-----
From: Ian Campbell
Sent: 02 August 2013 16:54
To: Paul Durrant
Cc: [email protected]; Stefano Stabellini; Ian Jackson
Subject: Re: [PATCH v2] Add device_model_pvdevice parameter for HVM guests

Quoted 11 lines · Paul Durrant
Quoted 7 lines
Quoted 2 lines

So, doesn't LIBXL_HAVE_PVDEVICE cover it? The intention is there's only ever going to be one of them.

PVDEVICE is a very broad term, does it mean PVNIC, PVCONSOLE, PVDISK etc? How does it relate to a PVDOMAIN etc. I know we both know the answer to what this is but the API should be less ambiguous.

How about VENDOR_DEVICE? That probably captures the intention (and makes more sense when you consider the only available value apart fromn 'none' is 'citrix').

Quoted 8 lines

vendor device sounds good to me.

Should be HVM_VENDOR_DEVICE though I think and it looks like we've fallen into the pattern of LIBXL_HAVE_<STRUCT>_<FIELD>, so how about LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE? and u.hvm.vendor_device for the
field itself?

Sounds good to me. Patch v3 coming up.

Paul