Il 17/03/2014 06:32, Nicholas A. Bellinger ha scritto: > + if (vq->iov[0].iov_len == sizeof(v_req_pi)) { > + req = (unsigned char *)&v_req_pi; > + target = &v_req_pi.lun[1]; > + req_size = sizeof(v_req_pi); > + hdr_pi = true; > + } else if (vq->iov[0].iov_len == sizeof(v_req)) { > + req = (unsigned char *)&v_req; > + target = &v_req.lun[1]; > + req_size = sizeof(v_req); > + hdr_pi = false; The right check here is on the negotiated features. You need a matching QEMU patch to enable the protection information feature, like this (untested): diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 3983a5b..4c8d5cd 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -154,6 +154,9 @@ static uint32_t vhost_scsi_get_features(VirtIODevice *vdev, if (!(s->dev.features & (1 << VIRTIO_SCSI_F_HOTPLUG))) { features &= ~(1 << VIRTIO_SCSI_F_HOTPLUG); } + if (!(s->dev.features & (1 << VIRTIO_SCSI_F_T10_PI))) { + features &= ~(1 << VIRTIO_SCSI_F_T10_PI); + } return features; } diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 6610b3a..4a551e9 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -629,6 +629,9 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp) return; } + /* Protection information is not supported yet. */ + dev->guest_features &= ~VIRTIO_SCSI_F_T10_PI; + scsi_bus_new(&s->bus, sizeof(s->bus), dev, &virtio_scsi_scsi_info, vdev->bus_name); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 9010246..8621fbf 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -267,6 +267,16 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); .value = "no",\ },\ {\ + .driver = "virtio-scsi-pci",\ + .property = "prot_info",\ + .value = "off",\ + },\ + {\ + .driver = "vhost-scsi-pci",\ + .property = "prot_info",\ + .value = "off",\ + },\ + {\ .driver = "PIIX4_PM",\ .property = "acpi-pci-hotplug-with-bridge-support",\ .value = "off",\ diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index 42b1024..a555f49 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -34,6 +34,7 @@ #define VIRTIO_SCSI_F_INOUT 0 #define VIRTIO_SCSI_F_HOTPLUG 1 #define VIRTIO_SCSI_F_CHANGE 2 +#define VIRTIO_SCSI_F_T10_PI 3 #define VIRTIO_SCSI_VQ_SIZE 128 #define VIRTIO_SCSI_CDB_SIZE 32 @@ -184,7 +185,9 @@ typedef struct { DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG, \ true), \ DEFINE_PROP_BIT("param_change", _state, _feature_field, \ - VIRTIO_SCSI_F_CHANGE, true) + VIRTIO_SCSI_F_CHANGE, true) \ + DEFINE_PROP_BIT("prot_info", _state, _feature_field, \ + VIRTIO_SCSI_F_T10_PI, true) void virtio_scsi_common_realize(DeviceState *dev, Error **errp); void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp); -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html