Some devices want to know their status, use this hook to allow them to get that notification. Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx> --- tools/kvm/include/kvm/virtio.h | 1 + tools/kvm/virtio/pci.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tools/kvm/include/kvm/virtio.h b/tools/kvm/include/kvm/virtio.h index 924279b..269ea4a 100644 --- a/tools/kvm/include/kvm/virtio.h +++ b/tools/kvm/include/kvm/virtio.h @@ -80,6 +80,7 @@ struct virtio_ops { void (*notify_vq_eventfd)(struct kvm *kvm, void *dev, u32 vq, u32 efd); int (*signal_vq)(struct kvm *kvm, struct virtio_device *vdev, u32 queueid); int (*signal_config)(struct kvm *kvm, struct virtio_device *vdev); + void (*notify_status)(struct kvm *kvm, void *dev, u8 status); int (*init)(struct kvm *kvm, void *dev, struct virtio_device *vdev, int device_id, int subsys_id, int class); int (*exit)(struct kvm *kvm, struct virtio_device *vdev); diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c index 227d567..fec8ce0 100644 --- a/tools/kvm/virtio/pci.c +++ b/tools/kvm/virtio/pci.c @@ -210,6 +210,8 @@ static bool virtio_pci__io_out(struct ioport *ioport, struct kvm *kvm, u16 port, break; case VIRTIO_PCI_STATUS: vpci->status = ioport__read8(data); + if (vdev->ops->notify_status) + vdev->ops->notify_status(kvm, vpci->dev, vpci->status); break; default: ret = virtio_pci__specific_io_out(kvm, vdev, port, data, size, offset); -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html