diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index bea37a6326f..9f9236eb322 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3437,24 +3437,6 @@ static int vfio_user_dma_write(VFIOPCIDevice *vdev, struct vfio_user_dma_rw *msg return 0; } -static int vfio_user_vm_intr(VFIOPCIDevice *vdev, struct vfio_user_vm_intr *msg) -{ - - /* TODO */ - switch (msg->index) { - case VFIO_PCI_INTX_IRQ_INDEX: - case VFIO_PCI_MSI_IRQ_INDEX: - case VFIO_PCI_MSIX_IRQ_INDEX: - default: - break; - } - - if ((msg->hdr.flags & VFIO_USER_NO_REPLY) == 0) { - vfio_user_send_reply(vdev->vbasedev.proxy, (char *)msg, 0); - } - return 0; -} - static int vfio_user_pci_process_req(void *opaque, char *buf, VFIOUserFDs *fds) { VFIOPCIDevice *vdev = opaque; @@ -3471,9 +3453,6 @@ static int vfio_user_pci_process_req(void *opaque, char *buf, VFIOUserFDs *fds) case VFIO_USER_DMA_WRITE: ret = vfio_user_dma_write(vdev, (struct vfio_user_dma_rw *)hdr); break; - case VFIO_USER_VM_INTERRUPT: - ret = vfio_user_vm_intr(vdev, (struct vfio_user_vm_intr *)hdr); - break; default: error_printf("vfio_user_process_req unknown cmd %d\n", hdr->command); ret = -ENOSYS; diff --git a/hw/vfio/user.c b/hw/vfio/user.c index ee6aac596a5..371d2799017 100644 --- a/hw/vfio/user.c +++ b/hw/vfio/user.c @@ -715,7 +715,7 @@ int vfio_user_dma_unmap(VFIOProxy *proxy, vfio_user_request_msg(&msgp->msg.hdr, VFIO_USER_DMA_UNMAP, msize, 0); msgp->msg.argsz = unmap->argsz; - msgp->msg.flags = unmap->size; + msgp->msg.flags = unmap->flags; msgp->msg.iova = unmap->iova; msgp->msg.size = unmap->size; diff --git a/hw/vfio/user.h b/hw/vfio/user.h index cb1080df5ce..bd2c8c5e6f2 100644 --- a/hw/vfio/user.h +++ b/hw/vfio/user.h @@ -24,21 +24,23 @@ typedef struct vfio_user_hdr { } vfio_user_hdr_t; /* commands */ -#define VFIO_USER_VERSION 1 -#define VFIO_USER_DMA_MAP 2 -#define VFIO_USER_DMA_UNMAP 3 -#define VFIO_USER_DEVICE_GET_INFO 4 -#define VFIO_USER_DEVICE_GET_REGION_INFO 5 -#define VFIO_USER_DEVICE_GET_IRQ_INFO 6 -#define VFIO_USER_DEVICE_SET_IRQS 7 -#define VFIO_USER_REGION_READ 8 -#define VFIO_USER_REGION_WRITE 9 -#define VFIO_USER_DMA_READ 10 -#define VFIO_USER_DMA_WRITE 11 -#define VFIO_USER_VM_INTERRUPT 12 -#define VFIO_USER_DEVICE_RESET 13 -#define VFIO_USER_DIRTY_PAGES 14 -#define VFIO_USER_DMA_UNMAP_DIRTY 15 +enum vfio_user_command { + VFIO_USER_VERSION = 1, + VFIO_USER_DMA_MAP = 2, + VFIO_USER_DMA_UNMAP = 3, + VFIO_USER_DEVICE_GET_INFO = 4, + VFIO_USER_DEVICE_GET_REGION_INFO = 5, + VFIO_USER_DEVICE_GET_REGION_IO_FDS = 6, + VFIO_USER_DEVICE_GET_IRQ_INFO = 7, + VFIO_USER_DEVICE_SET_IRQS = 8, + VFIO_USER_REGION_READ = 9, + VFIO_USER_REGION_WRITE = 10, + VFIO_USER_DMA_READ = 11, + VFIO_USER_DMA_WRITE = 12, + VFIO_USER_DEVICE_RESET = 13, + VFIO_USER_DIRTY_PAGES = 14, + VFIO_USER_MAX, +}; /* flags */ #define VFIO_USER_REQUEST 0x0