[tip:tools/kvm] kvm tools: Add set_size_vq for virtio-net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  e0fce3562c99294f94f5671d90cee8b6fde24c4f
Gitweb:     http://git.kernel.org/tip/e0fce3562c99294f94f5671d90cee8b6fde24c4f
Author:     Asias He <asias.hejun@xxxxxxxxx>
AuthorDate: Sat, 7 Apr 2012 20:01:51 +0800
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Mon, 9 Apr 2012 11:34:47 +0300

kvm tools: Add set_size_vq for virtio-net

set_size_vq does not do the actual work, we can implement this later.

Signed-off-by: Asias He <asias.hejun@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/virtio/net.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c
index 11581ce..35e51aa 100644
--- a/tools/kvm/virtio/net.c
+++ b/tools/kvm/virtio/net.c
@@ -340,6 +340,7 @@ static int init_vq(struct kvm *kvm, void *dev, u32 vq, u32 pfn)
 	queue->pfn	= pfn;
 	p		= guest_pfn_to_host(kvm, queue->pfn);
 
+	/* FIXME: respect pci and mmio vring alignment */
 	vring_init(&queue->vring, VIRTIO_NET_QUEUE_SIZE, p, VIRTIO_PCI_VRING_ALIGN);
 
 	if (ndev->vhost_fd == 0)
@@ -436,18 +437,26 @@ static int get_pfn_vq(struct kvm *kvm, void *dev, u32 vq)
 
 static int get_size_vq(struct kvm *kvm, void *dev, u32 vq)
 {
+	/* FIXME: dynamic */
 	return VIRTIO_NET_QUEUE_SIZE;
 }
 
+static int set_size_vq(struct kvm *kvm, void *dev, u32 vq, int size)
+{
+	/* FIXME: dynamic */
+	return size;
+}
+
 static struct virtio_ops net_dev_virtio_ops = (struct virtio_ops) {
 	.set_config		= set_config,
 	.get_config		= get_config,
 	.get_host_features	= get_host_features,
 	.set_guest_features	= set_guest_features,
 	.init_vq		= init_vq,
-	.notify_vq		= notify_vq,
 	.get_pfn_vq		= get_pfn_vq,
 	.get_size_vq		= get_size_vq,
+	.set_size_vq		= set_size_vq,
+	.notify_vq		= notify_vq,
 	.notify_vq_gsi		= notify_vq_gsi,
 	.notify_vq_eventfd	= notify_vq_eventfd,
 };
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux