From: Asias He <asias.hejun@xxxxxxxxx> This patch adds virtio-mmio support in virtio_init. Signed-off-by: Asias He <asias.hejun@xxxxxxxxx> --- tools/kvm/virtio/core.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/tools/kvm/virtio/core.c b/tools/kvm/virtio/core.c index 20b90be..da27492 100644 --- a/tools/kvm/virtio/core.c +++ b/tools/kvm/virtio/core.c @@ -6,6 +6,7 @@ #include "kvm/barrier.h" #include "kvm/virtio.h" #include "kvm/virtio-pci.h" +#include "kvm/virtio-mmio.h" #include "kvm/util.h" #include "kvm/kvm.h" @@ -179,6 +180,18 @@ int virtio_init(struct kvm *kvm, void *dev, struct virtio_device *vdev, vdev->ops->exit = virtio_pci__exit; vdev->ops->init(kvm, dev, vdev, device_id, subsys_id, class); break; + case VIRTIO_MMIO: + virtio = calloc(sizeof(struct virtio_mmio), 1); + if (!virtio) + return -ENOMEM; + vdev->virtio = virtio; + vdev->ops = ops; + vdev->ops->signal_vq = virtio_mmio_signal_vq; + vdev->ops->signal_config = virtio_mmio_signal_config; + vdev->ops->init = virtio_mmio_init; + vdev->ops->exit = virtio_mmio_exit; + vdev->ops->init(kvm, dev, vdev, device_id, subsys_id, class); + break; default: return -1; }; -- 1.7.7.6 -- 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