Skip to contentSkip to conversation

tools/libxl: add support for emulated NVMe drives

PATCH RESEND Superseded Paul Durrant 2 participants 9 messages Jan 13, 2017 – Jan 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 tools/libxl: add support for emulated NVMe drives

Upstream QEMU supports emulation of NVM Express a.k.a. NVMe drives.

This patch adds a new vdev type into libxl to allow such drives to be presented to HVM guests. Because the purpose of the new vdev is purely to configure emulation, the syntax only supports specification of whole disks. Also there is no need to introduce a new concrete VBD encoding for NVMe drives.

NOTE: QEMU's emulation only supports a single NVMe namespace, so the
vdev syntax does not include specification of a namespace. Also, current versions of SeaBIOS do not support booting from NVMe devices, so the vdev should only be used for secondary drives.

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 docs/man/xen-vbd-interface.markdown.7 | 15 ++++++++-------
 docs/man/xl-disk-configuration.pod.5  |  4 ++--
 tools/libxl/libxl_device.c            |  8 ++++++++
 tools/libxl/libxl_dm.c                |  6 ++++++
 4 files changed, 24 insertions(+), 9 deletions(-)
docs/man/xen-vbd-interface.markdown.7 +8 -7
index 1c996bf..8fd378c 100644
@@ -8,12 +8,12 @@ emulated IDE, AHCI or SCSI disks.
 The abstract interface involves specifying, for each block device:
 
  * Nominal disk type: Xen virtual disk (aka xvd*, the default); SCSI
-   (sd*); IDE or AHCI (hd*).
+   (sd*); IDE or AHCI (hd*); NVMe.
 
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same
    underlying devices as the corresponding Xen VBD (ie, multipath).
    In hd* case with hdtype=ahci, disk will be AHCI via emulated
    ich9 disk controller.
@@ -42,8 +42,7 @@ The abstract interface involves specifying, for each block device:
    treat each vbd as it would a partition or slice or LVM volume (for
    example by putting or expecting a filesystem on it).
 
-   Non-whole disk devices cannot be passed through to HVM guests via
-   the emulated IDE or SCSI controllers.
+   Only whole disk devices can be emulated for HVM guests.
 
 
 Configuration file syntax
@@ -56,6 +55,7 @@ The config file syntaxes are, for example
        d536p37  xvdtq37  Xen virtual disk 536 partition 37
        sdb3              SCSI disk 1 partition 3
        hdc2              IDE disk 2 partition 2
+       nvme0             NVMe disk 0 (whole disk only)
 
 The d*p* syntax is not supported by xm/xend.
 
@@ -78,6 +78,7 @@ encodes the information above as follows:
      8 << 8 | disk << 4 | partition      sd, disks and partitions up to 15
      3 << 8 | disk << 6 | partition      hd, disks 0..1, partitions 0..63
     22 << 8 | (disk-2) << 6 | partition  hd, disks 2..3, partitions 0..63
+    1 << 28 | disk << 8                  nvme, all disks, whole disk only
     2 << 28 onwards                      reserved for future use
    other values less than 1 << 28        deprecated / reserved
 
docs/man/xl-disk-configuration.pod.5 +2 -2
index d3eedc1..c40418e 100644
@@ -127,8 +127,8 @@ designation in some specifications).  L<xen-vbd-interface(7)>
 
 =item Supported values
 
-hd[x], xvd[x], sd[x] etc.  Please refer to the above specification for
-further details.
+hd[x], xvd[x], sd[x], nvme[x] etc.  Please refer to the above specification
+for further details.
 
 =item Deprecated values
 
tools/libxl/libxl_device.c +8 -0
index b2aeefc..63a738c 100644
@@ -532,6 +532,14 @@ int libxl__device_disk_dev_number(const char *virtpath, int *pdisk,
         if (ppartition) *ppartition = partition;
         return (8 << 8) | (disk << 4) | partition;
     }
+    if (!memcmp(virtpath, "nvme", 4)) {
+        disk = strtoul(virtpath + 4, &ep, 10);
+        if (*ep)
+            return -1;
+        if (pdisk) *pdisk = disk;
+        if (ppartition) *ppartition = 0;
+        return (1 << 28) | (disk << 8);
+    }
     return -1;
 }
 
tools/libxl/libxl_dm.c +6 -0
index 281058d..980dad1 100644
@@ -1430,6 +1430,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                                         format,
                                                         &disks[i],
                                                         colo_mode);
+                } else if (strncmp(disks[i].vdev, "nvme", 4) == 0) {
+                    flexarray_vappend(dm_args,
+                        "-drive",  GCSPRINTF("file=%s,if=none,id=nvmedisk-%d,format=%s,cache=writeback", target_path, disk, format),
+                        "-device", GCSPRINTF("nvme,drive=nvmedisk-%d,serial=%d", disk, disk),
+                        NULL);
+                    continue;
                 } else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
                     if (!disks[i].readwrite) {
                         LOGD(ERROR, guest_domid,
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 7 lines · Paul Durrant

Upstream QEMU supports emulation of NVM Express a.k.a. NVMe drives.

This patch adds a new vdev type into libxl to allow such drives to be presented to HVM guests. Because the purpose of the new vdev is purely to configure emulation, the syntax only supports specification of whole disks. Also there is no need to introduce a new concrete VBD encoding for NVMe drives.

This seems to be in contradiction with the code below?

Quoted 7 lines

NOTE: QEMU's emulation only supports a single NVMe namespace, so the
vdev syntax does not include specification of a namespace. Also, current versions of SeaBIOS do not support booting from NVMe devices, so the vdev should only be used for secondary drives.

I don't know much about NVMe, but I presume we could just extend the proposed syntax to support namespaces should the need arise?

Quoted 16 lines

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 docs/man/xen-vbd-interface.markdown.7 | 15 ++++++++-------
 docs/man/xl-disk-configuration.pod.5  |  4 ++--
 tools/libxl/libxl_device.c            |  8 ++++++++
 tools/libxl/libxl_dm.c                |  6 ++++++
 4 files changed, 24 insertions(+), 9 deletions(-)
docs/man/xen-vbd-interface.markdown.7 +0 -0
index 1c996bf..8fd378c 100644

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 11

Quoted 5 lines
docs/man/xen-vbd-interface.markdown.7 +1 -1
@@ -8,12 +8,12 @@ emulated IDE, AHCI or SCSI disks.
 The abstract interface involves specifying, for each block device:
 
  * Nominal disk type: Xen virtual disk (aka xvd*, the default); SCSI
-   (sd*); IDE or AHCI (hd*).
+   (sd*); IDE or AHCI (hd*); NVMe.

NVMe (nvme*) ?

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 16

Quoted 9 lines
docs/man/xen-vbd-interface.markdown.7 +4 -4
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same

How do you expect the guest to deal with multipath NVMe devices? Maybe we need to add unplug support for NVMe devices in QEMU?

Quoted 22 lines
docs/man/xen-vbd-interface.markdown.7 +2 -2
    underlying devices as the corresponding Xen VBD (ie, multipath).
    In hd* case with hdtype=ahci, disk will be AHCI via emulated
    ich9 disk controller.
@@ -42,8 +42,7 @@ The abstract interface involves specifying, for each block device:
    treat each vbd as it would a partition or slice or LVM volume (for
    example by putting or expecting a filesystem on it).
 
-   Non-whole disk devices cannot be passed through to HVM guests via
-   the emulated IDE or SCSI controllers.
+   Only whole disk devices can be emulated for HVM guests.
 
 
 Configuration file syntax
@@ -56,6 +55,7 @@ The config file syntaxes are, for example
        d536p37  xvdtq37  Xen virtual disk 536 partition 37
        sdb3              SCSI disk 1 partition 3
        hdc2              IDE disk 2 partition 2
+       nvme0             NVMe disk 0 (whole disk only)
 
 The d*p* syntax is not supported by xm/xend.
 

docs/man/xen-vbd-interface.markdown.7 encodes the information above as follows: · line 81

Quoted 4 lines
docs/man/xen-vbd-interface.markdown.7 +1 -0
@@ -78,6 +78,7 @@ encodes the information above as follows:
      8 << 8 | disk << 4 | partition      sd, disks and partitions up to 15
      3 << 8 | disk << 6 | partition      hd, disks 0..1, partitions 0..63
     22 << 8 | (disk-2) << 6 | partition  hd, disks 2..3, partitions 0..63
+    1 << 28 | disk << 8                  nvme, all disks, whole disk only

^ Here, concrete encoding is introduced.

Quoted 57 lines
docs/man/xen-vbd-interface.markdown.7 +0 -0
     2 << 28 onwards                      reserved for future use
    other values less than 1 << 28        deprecated / reserved
 
docs/man/xl-disk-configuration.pod.5 +2 -2
index d3eedc1..c40418e 100644
@@ -127,8 +127,8 @@ designation in some specifications).  L<xen-vbd-interface(7)>
 
 =item Supported values
 
-hd[x], xvd[x], sd[x] etc.  Please refer to the above specification for
-further details.
+hd[x], xvd[x], sd[x], nvme[x] etc.  Please refer to the above specification
+for further details.
 
 =item Deprecated values
 
tools/libxl/libxl_device.c +8 -0
index b2aeefc..63a738c 100644
@@ -532,6 +532,14 @@ int libxl__device_disk_dev_number(const char *virtpath, int *pdisk,
         if (ppartition) *ppartition = partition;
         return (8 << 8) | (disk << 4) | partition;
     }
+    if (!memcmp(virtpath, "nvme", 4)) {
+        disk = strtoul(virtpath + 4, &ep, 10);
+        if (*ep)
+            return -1;
+        if (pdisk) *pdisk = disk;
+        if (ppartition) *ppartition = 0;
+        return (1 << 28) | (disk << 8);
+    }
     return -1;
 }
 
tools/libxl/libxl_dm.c +6 -0
index 281058d..980dad1 100644
@@ -1430,6 +1430,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                                         format,
                                                         &disks[i],
                                                         colo_mode);
+                } else if (strncmp(disks[i].vdev, "nvme", 4) == 0) {
+                    flexarray_vappend(dm_args,
+                        "-drive",  GCSPRINTF("file=%s,if=none,id=nvmedisk-%d,format=%s,cache=writeback", target_path, disk, format),
+                        "-device", GCSPRINTF("nvme,drive=nvmedisk-%d,serial=%d", disk, disk),
+                        NULL);
+                    continue;
                 } else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
                     if (!disks[i].readwrite) {
                         LOGD(ERROR, guest_domid,
Signature · 1 line
2.1.4

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

#2 lore raw
Quoted 12 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 18 January 2017 10:29
To: Paul Durrant <[email protected]>
Cc: [email protected]; Ian Jackson <[email protected]>; Wei Liu <[email protected]>
Subject: Re: [PATCH RESEND] tools/libxl: add support for emulated NVMe drives

Quoted 2 lines · Paul Durrant

Upstream QEMU supports emulation of NVM Express a.k.a. NVMe drives.

Quoted 8 lines
Quoted 5 lines

This patch adds a new vdev type into libxl to allow such drives to be presented to HVM guests. Because the purpose of the new vdev is purely to configure emulation, the syntax only supports specification of whole disks. Also there is no need to introduce a new concrete VBD encoding for NVMe drives.

This seems to be in contradiction with the code below?

No, there's no contradiction because the encoding is identical to xvdX encoding. Perhaps I should state that in the comment.

Quoted 11 lines
Quoted 7 lines

NOTE: QEMU's emulation only supports a single NVMe namespace, so the
vdev syntax does not include specification of a namespace. Also, current versions of SeaBIOS do not support booting from NVMe devices, so the vdev should only be used for secondary drives.

I don't know much about NVMe, but I presume we could just extend the proposed syntax to support namespaces should the need arise?

Well, I could make the syntax be nvme<device>n<namespace> (to match linux's namespace syntax) and insist that namespace be 1 at the moment. Do you think that would be preferable?

Quoted 19 lines

docs/man/xen-

Quoted 12 lines

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 docs/man/xen-vbd-interface.markdown.7 | 15 ++++++++-------
 docs/man/xl-disk-configuration.pod.5  |  4 ++--
 tools/libxl/libxl_device.c            |  8 ++++++++
 tools/libxl/libxl_dm.c                |  6 ++++++
 4 files changed, 24 insertions(+), 9 deletions(-)
docs/man/xen- renamed from docs/man/xen-vbd-interface.markdown.7 +0 -0

vbd-interface.markdown.7

Quoted 6 lines

index 1c996bf..8fd378c 100644

docs/man/xen-vbd-interface.markdown.7 +0 -0
@@ -8,12 +8,12 @@ emulated IDE, AHCI or SCSI disks.
 The abstract interface involves specifying, for each block device:
 
Quoted 5 lines

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 11

Quoted 3 lines
docs/man/xen-vbd-interface.markdown.7 +1 -1
  * Nominal disk type: Xen virtual disk (aka xvd*, the default); SCSI
-   (sd*); IDE or AHCI (hd*).
+   (sd*); IDE or AHCI (hd*); NVMe.

NVMe (nvme*) ?

Yes.

Quoted 11 lines

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 16

Quoted 10 lines
docs/man/xen-vbd-interface.markdown.7 +4 -4
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same
Quoted 2 lines

How do you expect the guest to deal with multipath NVMe devices? Maybe we need to add unplug support for NVMe devices in QEMU?

That's true. For convenience, there would need to a QEMU patch for unplug to allow displacement of the emulated device with PV. I can document this as a shortcoming at the moment, if that's ok?

Paul

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

#3 lore raw
Quoted 18 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 18 January 2017 10:29
To: Paul Durrant <[email protected]>
Cc: [email protected]; Ian Jackson <[email protected]>; Wei Liu <[email protected]>
Subject: Re: [PATCH RESEND] tools/libxl: add support for emulated NVMe drives

Quoted 7 lines · Paul Durrant

Upstream QEMU supports emulation of NVM Express a.k.a. NVMe drives.

This patch adds a new vdev type into libxl to allow such drives to be presented to HVM guests. Because the purpose of the new vdev is purely to configure emulation, the syntax only supports specification of whole disks. Also there is no need to introduce a new concrete VBD encoding for NVMe drives.

Quoted 5 lines
Quoted 2 lines

This seems to be in contradiction with the code below?

No, there's no contradiction because the encoding is identical to xvdX encoding. Perhaps I should state that in the comment.

That would be appreciated.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

NOTE: QEMU's emulation only supports a single NVMe namespace, so the
vdev syntax does not include specification of a namespace. Also, current versions of SeaBIOS do not support booting from NVMe devices, so the vdev should only be used for secondary drives.

Quoted 6 lines
Quoted 3 lines

I don't know much about NVMe, but I presume we could just extend the proposed syntax to support namespaces should the need arise?

Well, I could make the syntax be nvme<device>n<namespace> (to match linux's namespace syntax) and insist that namespace be 1 at the moment. Do you think that would be preferable?

Fine by me. Let's wait a bit for other people to comment.

Quoted 38 lines
Quoted 19 lines

docs/man/xen-

Quoted 12 lines

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 docs/man/xen-vbd-interface.markdown.7 | 15 ++++++++-------
 docs/man/xl-disk-configuration.pod.5  |  4 ++--
 tools/libxl/libxl_device.c            |  8 ++++++++
 tools/libxl/libxl_dm.c                |  6 ++++++
 4 files changed, 24 insertions(+), 9 deletions(-)
docs/man/xen- renamed from docs/man/xen-vbd-interface.markdown.7 +0 -0

vbd-interface.markdown.7

Quoted 6 lines

index 1c996bf..8fd378c 100644

docs/man/xen-vbd-interface.markdown.7 +0 -0
@@ -8,12 +8,12 @@ emulated IDE, AHCI or SCSI disks.
 The abstract interface involves specifying, for each block device:
 
Quoted 5 lines

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 11

Quoted 3 lines
docs/man/xen-vbd-interface.markdown.7 +1 -1
  * Nominal disk type: Xen virtual disk (aka xvd*, the default); SCSI
-   (sd*); IDE or AHCI (hd*).
+   (sd*); IDE or AHCI (hd*); NVMe.

NVMe (nvme*) ?

Yes.

Quoted 11 lines
Quoted 10 lines
docs/man/xen-vbd-interface.markdown.7 +4 -4
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same
Quoted 5 lines
Quoted 2 lines

How do you expect the guest to deal with multipath NVMe devices? Maybe we need to add unplug support for NVMe devices in QEMU?

That's true. For convenience, there would need to a QEMU patch for unplug to allow displacement of the emulated device with PV. I can document this as a shortcoming at the moment, if that's ok?

The unplug functionality, as I understand, is crucial to data integrity. Documenting this as shortcoming doesn't seem to be good enough. Do we need to wait until QEMU is ready before we can apply this patch?

Wei.

Quoted 1 line

Paul

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

#4 lore raw
Quoted 9 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 18 January 2017 12:02
To: Paul Durrant <[email protected]>
Cc: Wei Liu <[email protected]>; [email protected]; Ian Jackson <[email protected]>
Subject: Re: [PATCH RESEND] tools/libxl: add support for emulated NVMe drives

[snip]

Quoted 14 lines
Quoted 11 lines
Quoted 11 lines

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 16

Quoted 9 lines
docs/man/xen-vbd-interface.markdown.7 +4 -4
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same

How do you expect the guest to deal with multipath NVMe devices?

Maybe

Quoted 2 lines
Quoted 1 line

we need to add unplug support for NVMe devices in QEMU?

Quoted 8 lines
Quoted 1 line

That's true. For convenience, there would need to a QEMU patch for

unplug to allow displacement of the emulated device with PV. I can document this as a shortcoming at the moment, if that's ok?

Quoted 1 line

The unplug functionality, as I understand, is crucial to data integrity. Documenting this as shortcoming doesn't seem to be good enough. Do we need to wait until QEMU is ready before we can apply this patch?

It will take time to get a patch into QEMU and if you're going to use PV drivers then you have little interest in the emulation model. I think just documenting it would be ok. For safety I guess I could explore the possibility of having libxl not create a PV backend for this vdev type.

Paul

Quoted 5 lines

Wei.

Quoted 1 line

Paul

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

#5 lore raw
Quoted 29 lines · Paul Durrant
Quoted 9 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 18 January 2017 12:02
To: Paul Durrant <[email protected]>
Cc: Wei Liu <[email protected]>; [email protected]; Ian Jackson <[email protected]>
Subject: Re: [PATCH RESEND] tools/libxl: add support for emulated NVMe drives

[snip]

Quoted 19 lines
Quoted 11 lines
Quoted 11 lines

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 16

Quoted 9 lines
docs/man/xen-vbd-interface.markdown.7 +4 -4
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same

How do you expect the guest to deal with multipath NVMe devices?

Maybe

Quoted 3 lines
Quoted 1 line

we need to add unplug support for NVMe devices in QEMU?

That's true. For convenience, there would need to a QEMU patch for

unplug to allow displacement of the emulated device with PV. I can document this as a shortcoming at the moment, if that's ok?

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

The unplug functionality, as I understand, is crucial to data integrity. Documenting this as shortcoming doesn't seem to be good enough. Do we need to wait until QEMU is ready before we can apply this patch?

It will take time to get a patch into QEMU and if you're going to use PV drivers then you have little interest in the emulation model. I think just documenting it would be ok.

This is OK provided there is no safety issue. If we can't rule that out,
...

Quoted 2 lines

For safety I guess I could explore the possibility of having libxl not create a PV backend for this vdev type.

... this is the best option for now.

Wei.

Quoted 8 lines

Paul

Quoted 5 lines

Wei.

Quoted 1 line

Paul

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

#6 lore raw
Quoted 38 lines · Wei Liu
Quoted 29 lines · Paul Durrant
Quoted 9 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 18 January 2017 12:02
To: Paul Durrant <[email protected]>
Cc: Wei Liu <[email protected]>; [email protected]; Ian Jackson <[email protected]>
Subject: Re: [PATCH RESEND] tools/libxl: add support for emulated NVMe drives

[snip]

Quoted 19 lines
Quoted 11 lines
Quoted 11 lines

docs/man/xen-vbd-interface.markdown.7 emulated IDE, AHCI or SCSI disks. · line 16

Quoted 9 lines
docs/man/xen-vbd-interface.markdown.7 +4 -4
-   For HVM guests, each whole-disk hd* and and sd* device is made
-   available _both_ via emulated IDE resp. SCSI controller, _and_ as a
-   Xen VBD.  The HVM guest is entitled to assume that the IDE or SCSI
-   disks available via the emulated IDE controller target the same
+   For HVM guests, each whole-disk hd*, sd* or nvme* device is made
+   available _both_ via emulated IDE, SCSI controller or NVMe drive
+   respectively _and_ as a Xen VBD.  The HVM guest is entitled to
+   assume that the disks available via the emulation target the same

How do you expect the guest to deal with multipath NVMe devices?

Maybe

Quoted 3 lines
Quoted 1 line

we need to add unplug support for NVMe devices in QEMU?

That's true. For convenience, there would need to a QEMU patch for

unplug to allow displacement of the emulated device with PV. I can document this as a shortcoming at the moment, if that's ok?

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

The unplug functionality, as I understand, is crucial to data integrity. Documenting this as shortcoming doesn't seem to be good enough. Do we need to wait until QEMU is ready before we can apply this patch?

It will take time to get a patch into QEMU and if you're going to use PV drivers then you have little interest in the emulation model. I think just documenting it would be ok.

Quoted 8 lines

This is OK provided there is no safety issue. If we can't rule that out,
...

Quoted 2 lines

For safety I guess I could explore the possibility of having libxl not create a PV backend for this vdev type.

... this is the best option for now.

And I realise if we are not going to have code in libxl for nvme pv disk, we can just use device_model_args to add the emulated device, which means this patch is not needed anymore.

Can you clarify the use case you anticipated for emulated NVMe disks?

Wei.

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

#7 lore raw
Quoted 1 line

-----Original Message-----

[snip]

Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

For safety I guess I could explore the possibility of having libxl not create a PV backend for this vdev type.

... this is the best option for now.

And I realise if we are not going to have code in libxl for nvme pv disk, we can just use device_model_args to add the emulated device, which means this patch is not needed anymore.

device_model_args is not exactly a user-friendly way to use emulated nvme disks, which was the main motivation for this patch.

Quoted 2 lines

Can you clarify the use case you anticipated for emulated NVMe disks?

My personal use is going to be to test performance, and maybe try to improve. The advantage with NVMe over PV is that the perf. is already not bad, and there's no need to install PV storage drivers since recent versions of Windows (and other OS) already have NVME drivers. The main problem with them is that seabios cannot (yet) boot from NVMe. I'm hoping OVMF might, but I need to experiment further. Given the push-back I guess I'll live with the device_model_args hassle for the moment and re-send once I've got an unplug patch into QEMU.

Paul

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

#8 lore raw
Quoted 13 lines · Paul Durrant
Quoted 1 line

-----Original Message-----

[snip]

Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

For safety I guess I could explore the possibility of having libxl not create a PV backend for this vdev type.

... this is the best option for now.

And I realise if we are not going to have code in libxl for nvme pv disk, we can just use device_model_args to add the emulated device, which means this patch is not needed anymore.

Quoted 8 lines

device_model_args is not exactly a user-friendly way to use emulated nvme disks, which was the main motivation for this patch.

Quoted 2 lines

Can you clarify the use case you anticipated for emulated NVMe disks?

My personal use is going to be to test performance, and maybe try to improve. The advantage with NVMe over PV is that the perf. is already not bad, and there's no need to install PV storage drivers since recent versions of Windows (and other OS) already have NVME drivers. The main problem with them is that seabios cannot (yet) boot from NVMe. I'm hoping OVMF might, but I need to experiment further. Given the push-back I guess I'll live with the device_model_args hassle for the moment and re-send once I've got an unplug patch into QEMU.

Thanks for clarification. It's best to resubmit until QEMU patch is ready.

Wei.

Quoted 1 line

Paul

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