Skip to contentSkip to conversation

libxl/xl: add PVH guest type

PATCH Applied Roger Pau Monne 2 participants 5 messages Sep 28, 2017

lore
Share & tools
lore
#0 lore raw

v4 cover libxl/xl: add PVH guest type

Hello,

This series adds a new PVH guest type to libxl/xl. This supersedes the current PVHv2 implementation that relies on using the "none" device model version.

As part of this series a new xl option is also implemented, called "type" that supersedes the current "builder" option. A "firmware" option is also introduced in order to have a uniform way of loading firmwares for all guest types (HVM, PV and PVH).

Only patch 5/22 is posted as part of the series, the rest have already been acked and can be found in the git branch below:

git://xenbits.xen.org/people/royger/xen.git pvh_tools_v4

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#1 lore raw

PATCH v4 5/22 xl: introduce a domain type option

Introduce a new type option to xl configuration files in order to specify the domain type. This supersedes the current builder option.

The new option is documented in the xl.cfg man page, and the previous builder option is marked as deprecated.

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
---
Changes since v3:
- Use a temporary variable to store the builder option.
- Remove the macro.

Changes since v2:
- Left shift error message.
- Detect wrong combination of 'builder' and 'type' options.
- Do not complain if both type and builder and set to the same value.
- Drop Wei's Ack (patch changed substantially).

---
 docs/man/xl.cfg.pod.5.in | 23 +++++++++++++++++++++--
 tools/xl/xl_parse.c      | 44 ++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 6 deletions(-)
docs/man/xl.cfg.pod.5.in +21 -2
index e7ab67395b..b4bbc8f9a7 100644
@@ -54,9 +54,9 @@ Pairs may be separated either by a newline or a semicolon.  Both
 of the following are valid:
 
   name="h0"
-  builder="hvm"
+  type="hvm"
 
-  name="h0"; builder="hvm"
+  name="h0"; type="hvm"
 
 =head1 OPTIONS
 
@@ -77,6 +77,25 @@ single host must be unique.
 
 =over 4
 
+=item B<type="pv">
+
+Specifies that this is to be a PV domain, suitable for hosting Xen-aware
+guest operating systems. This is the default.
+
+=item B<type="hvm">
+
+Specifies that this is to be an HVM domain. That is, a fully virtualised
+computer with emulated BIOS, disk and network peripherals, etc.
+
+=back
+
+=head3 Deprecated guest type selection
+
+Note that the builder option is being deprecated in favor of the type
+option.
+
+=over 4
+
 =item B<builder="generic">
 
 Specifies that this is to be a PV domain, suitable for hosting Xen-aware guest
tools/xl/xl_parse.c +40 -4

50 lines not on this page · raw message

Signature · 7 lines
2.13.5 (Apple Git-94)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v4 5/22
#2 lore raw

Re: [PATCH v4 05/22] xl: introduce a domain type option

Roger Pau Monne writes ("[PATCH v4 05/22] xl: introduce a domain type option"):

Quoted 5 lines

Introduce a new type option to xl configuration files in order to specify the domain type. This supersedes the current builder option.

The new option is documented in the xl.cfg man page, and the previous builder option is marked as deprecated.

Quoted 9 lines
tools/xl/xl_parse.c +9 -0
+    /* Deprecated since Xen 4.10. */
+    if (!xlu_cfg_get_string(config, "builder", &buf, 0)) {
+        libxl_domain_type builder_type;
+
+        if (c_info->type == LIBXL_DOMAIN_TYPE_INVALID)
+            fprintf(stderr,
+"The \"builder\" option is being deprecated, please use \"type\" instead.\n");
+        if (!strncmp(buf, "hvm", strlen(buf)))
+            builder_type = LIBXL_DOMAIN_TYPE_HVM;

tools/xl/xl_parse.c void parse_config_data(const char *config_source, · line 933

Quoted 10 lines
tools/xl/xl_parse.c +10 -0
+        else if (!strncmp(buf, "generic", strlen(buf)))
+            builder_type = LIBXL_DOMAIN_TYPE_PV;
+        else {
+            fprintf(stderr, "Invalid domain type %s.\n", buf);
+            exit(1);
+        }
+
+        if (c_info->type != LIBXL_DOMAIN_TYPE_INVALID &&
+            c_info->type != builder_type)
+        {
           ^

tools/xl/xl_parse.c void parse_config_data(const char *config_source, · line 936

Quoted 3 lines
tools/xl/xl_parse.c +3 -0
+            fprintf(stderr,
+            "Contradicting \"builder\" and \"type\" options specified.\n");
+            exit(1);

Much nicer. Although one nit: the { on the next line after the if.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw

Re: [PATCH v4 05/22] xl: introduce a domain type option

Quoted 30 lines · Ian Jackson

Roger Pau Monne writes ("[PATCH v4 05/22] xl: introduce a domain type option"):

Quoted 5 lines

Introduce a new type option to xl configuration files in order to specify the domain type. This supersedes the current builder option.

The new option is documented in the xl.cfg man page, and the previous builder option is marked as deprecated.

Quoted 9 lines
tools/xl/xl_parse.c +9 -0
+    /* Deprecated since Xen 4.10. */
+    if (!xlu_cfg_get_string(config, "builder", &buf, 0)) {
+        libxl_domain_type builder_type;
+
+        if (c_info->type == LIBXL_DOMAIN_TYPE_INVALID)
+            fprintf(stderr,
+"The \"builder\" option is being deprecated, please use \"type\" instead.\n");
+        if (!strncmp(buf, "hvm", strlen(buf)))
+            builder_type = LIBXL_DOMAIN_TYPE_HVM;

tools/xl/xl_parse.c void parse_config_data(const char *config_source, · line 933

Quoted 10 lines
tools/xl/xl_parse.c +10 -0
+        else if (!strncmp(buf, "generic", strlen(buf)))
+            builder_type = LIBXL_DOMAIN_TYPE_PV;
+        else {
+            fprintf(stderr, "Invalid domain type %s.\n", buf);
+            exit(1);
+        }
+
+        if (c_info->type != LIBXL_DOMAIN_TYPE_INVALID &&
+            c_info->type != builder_type)
+        {
           ^
Quoted 5 lines

tools/xl/xl_parse.c void parse_config_data(const char *config_source, · line 936

Quoted 3 lines
tools/xl/xl_parse.c +3 -0
+            fprintf(stderr,
+            "Contradicting \"builder\" and \"type\" options specified.\n");
+            exit(1);

Much nicer. Although one nit: the { on the next line after the if.

Right, I've fixed this, added the Ack and pushed a new branch to my personal repo:

git://xenbits.xen.org/people/royger/xen.git pvh_tools_v4.1

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Applied
#4 lore raw

Re: [PATCH v4 05/22] xl: introduce a domain type option

Roger Pau Monné writes ("Re: [PATCH v4 05/22] xl: introduce a domain type option"):

Quoted 4 lines

Right, I've fixed this, added the Ack and pushed a new branch to my personal repo:

git://xenbits.xen.org/people/royger/xen.git pvh_tools_v4.1

Pushed to staging (with the "---" notes stripped).

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel