Skip to contentSkip to conversation

libxl: QED disks support

PATCH Superseded Cédric Bosdonnat 2 participants 2 messages Dec 8, 2016 – Dec 12, 2016

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libxl: QED disks support

Qdisk supports qcow and qcow2, extend it to also support qed disk format.

---
v2:
* Add qed to the list for possible format values in xl-disk-configuration.txt
* Add LIBXL_HAVE_QED

---
 docs/misc/xl-disk-configuration.txt |    4 +-
 tools/libxl/libxl.h                 |    7 +
 tools/libxl/libxl_device.c          |    1 +
 tools/libxl/libxl_dm.c              |    1 +
 tools/libxl/libxl_types.idl         |    1 +
 tools/libxl/libxl_utils.c           |    2 +
 tools/libxl/libxlu_disk_l.c         | 1018 ++++++++++++++++++-----------------
 tools/libxl/libxlu_disk_l.h         |   53 +-
 tools/libxl/libxlu_disk_l.l         |    3 +-
 9 files changed, 548 insertions(+), 542 deletions(-)
docs/misc/xl-disk-configuration.txt +2 -2
index b3402bc33a..310d2586c0 100644
@@ -87,7 +87,7 @@ format
 ------
 
 Description:           Specifies the format of image file.
-Supported values:      raw, qcow, qcow2, vhd
+Supported values:      raw, qcow, qcow2, vhd, qed
 Deprecated values:     None
 Default value:         raw
 
@@ -311,7 +311,7 @@ are found prepended to the format parameter - eg "tap:aio:qcow:".
 ---------
 
 Description:           Specifies the format (deprecated)
-Supported values:      raw:  qcow2:  vhd:
+Supported values:      raw:  qcow2:  vhd:  qed:
 
 In xend and old versions of libxl it was necessary to specify the
 format with a prefix.  For compatibility, these three prefixes are
tools/libxl/libxl.h +7 -0
index acbf47690e..3924464588 100644
@@ -1012,6 +1012,13 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, const libxl_mac *src);
  */
 #define LIBXL_HAVE_MEMKB_64BITS 1
 
+/*
+ * LIBXL_HAVE_QED
+ *
+ * If this is defined QED disk formats can be used for both HVM and PV guests.
+ */
+#define LIBXL_HAVE_QED 1
+
 typedef char **libxl_string_list;
 void libxl_string_list_dispose(libxl_string_list *sl);
 int libxl_string_list_length(const libxl_string_list *sl);
tools/libxl/libxl_device.c +1 -0
index 3e7a1026c4..6c34141072 100644
@@ -411,6 +411,7 @@ char *libxl__device_disk_string_of_format(libxl_disk_format format)
         case LIBXL_DISK_FORMAT_VHD: return "vhd";
         case LIBXL_DISK_FORMAT_RAW:
         case LIBXL_DISK_FORMAT_EMPTY: return "aio";
+        case LIBXL_DISK_FORMAT_QED: return "qed";
         default: return NULL;
     }
 }
tools/libxl/libxl_dm.c +1 -0
index ad366a8cd3..8b373422f1 100644
@@ -677,6 +677,7 @@ static const char *qemu_disk_format_string(libxl_disk_format format)
     case LIBXL_DISK_FORMAT_VHD: return "vpc";
     case LIBXL_DISK_FORMAT_RAW: return "raw";
     case LIBXL_DISK_FORMAT_EMPTY: return NULL;
+    case LIBXL_DISK_FORMAT_QED: return "qed";
     default: return NULL;
     }
 }
tools/libxl/libxl_types.idl +1 -0
index a32c751b0e..a612d1f4ff 100644
@@ -114,6 +114,7 @@ libxl_disk_format = Enumeration("disk_format", [
     (3, "VHD"),
     (4, "RAW"),
     (5, "EMPTY"),
+    (6, "QED"),
     ])
 
 libxl_disk_backend = Enumeration("disk_backend", [
tools/libxl/libxl_utils.c +2 -0
index 49cbaa5b70..507ee56c7c 100644
@@ -317,6 +317,8 @@ int libxl_string_to_backend(libxl_ctx *ctx, char *s, libxl_disk_backend *backend
             *backend = LIBXL_DISK_BACKEND_QDISK;
         } else if (!strcmp(p, "qcow2")) {
             *backend = LIBXL_DISK_BACKEND_QDISK;
+        } else if (!strcmp(p, "qed")) {
+            *backend = LIBXL_DISK_BACKEND_QDISK;
         }
     }
 out:
tools/libxl/libxlu_disk_l.c +513 -505

1,655 lines not on this page · raw message

tools/libxl/libxlu_disk_l.h +19 -34

120 lines not on this page · raw message

tools/libxl/libxlu_disk_l.l +2 -1
index 5b6db221e4..f0e6a3b84e 100644
@@ -102,6 +102,7 @@ static void setformat(DiskParseContext *dpc, const char *str) {
     else if (!strcmp(str,"qcow2"))  DSET(dpc,format,FORMAT,str,QCOW2);
     else if (!strcmp(str,"vhd"))    DSET(dpc,format,FORMAT,str,VHD);
     else if (!strcmp(str,"empty"))  DSET(dpc,format,FORMAT,str,EMPTY);
+    else if (!strcmp(str,"qed"))    DSET(dpc,format,FORMAT,str,QED);
     else xlu__disk_err(dpc,str,"unknown value for format");
 }
 
@@ -209,7 +210,7 @@ target=.*	{ STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
   /* the "/.*" in these patterns ensures that they count as if they
    * matched the whole string, so these patterns take precedence */
 
-(raw|qcow2?|vhd):/.* {
+(raw|qcow2?|vhd|qed):/.* {
                     STRIP(':');
                     DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
                     setformat(DPC, yytext);
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 35 lines · Cédric Bosdonnat

Qdisk supports qcow and qcow2, extend it to also support qed disk format.

---
v2:
* Add qed to the list for possible format values in xl-disk-configuration.txt
* Add LIBXL_HAVE_QED

---
 docs/misc/xl-disk-configuration.txt |    4 +-
 tools/libxl/libxl.h                 |    7 +
 tools/libxl/libxl_device.c          |    1 +
 tools/libxl/libxl_dm.c              |    1 +
 tools/libxl/libxl_types.idl         |    1 +
 tools/libxl/libxl_utils.c           |    2 +
 tools/libxl/libxlu_disk_l.c         | 1018 ++++++++++++++++++-----------------
 tools/libxl/libxlu_disk_l.h         |   53 +-
 tools/libxl/libxlu_disk_l.l         |    3 +-
 9 files changed, 548 insertions(+), 542 deletions(-)
docs/misc/xl-disk-configuration.txt +1 -1
index b3402bc33a..310d2586c0 100644
@@ -87,7 +87,7 @@ format
 ------
 
 Description:           Specifies the format of image file.
-Supported values:      raw, qcow, qcow2, vhd
+Supported values:      raw, qcow, qcow2, vhd, qed
 Deprecated values:     None
 Default value:         raw
 

docs/misc/xl-disk-configuration.txt are found prepended to the format parameter - eg "tap:aio:qcow:". · line 314

Quoted 5 lines
docs/misc/xl-disk-configuration.txt +1 -1
@@ -311,7 +311,7 @@ are found prepended to the format parameter - eg "tap:aio:qcow:".
 ---------
 
 Description:           Specifies the format (deprecated)
-Supported values:      raw:  qcow2:  vhd:
+Supported values:      raw:  qcow2:  vhd:  qed:

Sorry for not having noticed this earlier: we shouldn't extend the deprecated syntax here.

I presume there is change to .l file to support this, please remove it.

Other than the issue mentioned above, this patch looks good to me.

Wei.

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