@@ -163,6 +163,12 @@ static const VMStateDescription vmstate_virtio_vhost_scsi = {
.pre_save = vhost_scsi_pre_save,
};
+void vhost_scsi_device_event(DeviceState *dev, int event, int queue,
+ Error **errp)
+{
+ virtio_device_event(dev, event, queue, true, errp);
+}
+
static void vhost_scsi_realize(DeviceState *dev, Error **errp)
{
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
@@ -44,6 +44,15 @@ static Property vhost_scsi_pci_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
+static void vhost_scsi_pci_event(DeviceState *dev, int event, int queue,
+ Error **errp)
+{
+ VHostSCSIPCI *vscsi = VHOST_SCSI_PCI(dev);
+ DeviceState *vdev = DEVICE(&vscsi->vdev);
+
+ vhost_scsi_device_event(vdev, event, queue, errp);
+}
+
static void vhost_scsi_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
{
VHostSCSIPCI *dev = VHOST_SCSI_PCI(vpci_dev);
@@ -70,6 +79,7 @@ static void vhost_scsi_pci_class_init(ObjectClass *klass, void *data)
k->realize = vhost_scsi_pci_realize;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
device_class_set_props(dc, vhost_scsi_pci_properties);
+ dc->event = vhost_scsi_pci_event;
pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SCSI;
pcidev_k->revision = 0x00;
@@ -32,4 +32,7 @@ struct VHostSCSI {
VHostSCSICommon parent_obj;
};
+void vhost_scsi_device_event(DeviceState *dev, int event, int queue,
+ Error **errp);
+
#endif
This is to implement the device event interface for vhost-scsi-pci. Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> --- hw/scsi/vhost-scsi.c | 6 ++++++ hw/virtio/vhost-scsi-pci.c | 10 ++++++++++ include/hw/virtio/vhost-scsi.h | 3 +++ 3 files changed, 19 insertions(+)