diff mbox

[v2] virtio: Define queue_size to unsigned

Message ID 20110616021013.4160.89565.stgit@localhost6.localdomain6 (mailing list archive)
State New, archived
Headers show

Commit Message

Amos Kong June 16, 2011, 2:10 a.m. UTC
It's not valid for queue_size to be negative, then the type ought
to be unsigned.

Changes from V1:
- drop the check and just define it to unsigned.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 hw/virtio.c |    2 +-
 hw/virtio.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/hw/virtio.c b/hw/virtio.c
index 6e8814c..4c1e334 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -602,7 +602,7 @@  void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector)
         vdev->vq[n].vector = vector;
 }
 
-VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
+VirtQueue *virtio_add_queue(VirtIODevice *vdev, unsigned int queue_size,
                             void (*handle_output)(VirtIODevice *, VirtQueue *))
 {
     int i;
diff --git a/hw/virtio.h b/hw/virtio.h
index bc72289..ff0c9b5 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -138,7 +138,7 @@  static inline void virtio_set_status(VirtIODevice *vdev, uint8_t val)
     vdev->status = val;
 }
 
-VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
+VirtQueue *virtio_add_queue(VirtIODevice *vdev, unsigned int queue_size,
                             void (*handle_output)(VirtIODevice *,
                                                   VirtQueue *));