[libvirt] [PATCH 0/2] Fix docs and handling of snapshots on SCSI passthrough devices

Libvirt didn't catch an attempt to do a snapshot of a SCSI passthrough disk when backed by iSCSI and the docs didn't state that disk type 'lun' works also with iSCSI. Peter Krempa (2): doc: domain: Clarify that disk type 'lun' works with iSCSI too qemu: snapshot: Forbid snapshots of iSCSI passthrough devices docs/formatdomain.html.in | 3 ++- src/qemu/qemu_driver.c | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) -- 2.0.0

Disk type 'lun' enables SCSI command passthrough for a disk. We stated that it works only with "block" disks. Qemu supports it also when using the iSCSI protocol. --- docs/formatdomain.html.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 3c85fc5..e74606d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1683,7 +1683,8 @@ defaulting to "disk". <p> Using "lun" (<span class="since">since 0.9.10</span>) is only - valid when type is "block", and behaves identically to "disk", + valid when type is "block" or "network" using the iSCSI protocol, + and behaves identically to "disk", except that generic SCSI commands from the guest are accepted and passed through to the physical device. Also note that device='lun' will only be recognized for actual raw devices, -- 2.0.0

On 07/18/2014 03:22 AM, Peter Krempa wrote:
Disk type 'lun' enables SCSI command passthrough for a disk. We stated that it works only with "block" disks. Qemu supports it also when using the iSCSI protocol. --- docs/formatdomain.html.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
ACK.
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 3c85fc5..e74606d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1683,7 +1683,8 @@ defaulting to "disk". <p> Using "lun" (<span class="since">since 0.9.10</span>) is only - valid when type is "block", and behaves identically to "disk", + valid when type is "block" or "network" using the iSCSI protocol, + and behaves identically to "disk", except that generic SCSI commands from the guest are accepted and passed through to the physical device. Also note that device='lun' will only be recognized for actual raw devices,
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

As with the local SCSI passthrough devicesm qemu can't support snapshots on those as the block ops are handled by the device. This is also true for iSCSI backing of the disk. Remove the check for the local block device and just forbid snapshot when the disk is of type 'lun'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073368 --- src/qemu/qemu_driver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 33541d3..3096688 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12434,10 +12434,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) static int qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk) { - int actualType = virStorageSourceGetActualType(disk->src); - - if (actualType == VIR_STORAGE_TYPE_BLOCK && - disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { + if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("external active snapshots are not supported on scsi " "passthrough devices")); -- 2.0.0

On 07/18/2014 03:22 AM, Peter Krempa wrote:
As with the local SCSI passthrough devicesm qemu can't support snapshots on those as the block ops are handled by the device. This is also true for iSCSI backing of the disk. Remove the check for the local block device and just forbid snapshot when the disk is of type 'lun'.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073368 --- src/qemu/qemu_driver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
ACK
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 33541d3..3096688 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12434,10 +12434,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) static int qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk) { - int actualType = virStorageSourceGetActualType(disk->src); - - if (actualType == VIR_STORAGE_TYPE_BLOCK && - disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { + if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("external active snapshots are not supported on scsi " "passthrough devices"));
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 07/18/14 15:24, Eric Blake wrote:
On 07/18/2014 03:22 AM, Peter Krempa wrote:
As with the local SCSI passthrough devicesm qemu can't support snapshots on those as the block ops are handled by the device. This is also true for iSCSI backing of the disk. Remove the check for the local block device and just forbid snapshot when the disk is of type 'lun'.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073368 --- src/qemu/qemu_driver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
ACK
Thanks; Series pushed. Peter
participants (2)
-
Eric Blake
-
Peter Krempa