From: Amos Kong <akong@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, mst@redhat.com
Subject: [Qemu-devel] [PATCH v2] virtio: Define queue_size to unsigned
Date: Thu, 16 Jun 2011 10:10:13 +0800 [thread overview]
Message-ID: <20110616021013.4160.89565.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <4DF940E3.2020603@codemonkey.ws>
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(-)
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 *));
prev parent reply other threads:[~2011-06-16 2:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110615142524.26726.13785.stgit@localhost6.localdomain6>
[not found] ` <20110615142533.26726.54603.stgit@localhost6.localdomain6>
[not found] ` <20110615203602.GB8362@redhat.com>
2011-06-15 22:53 ` [Qemu-devel] [PATCH 2/3] virtio: Strictly check queue_size when adding virtqueue Amos Kong
2011-06-15 23:31 ` Anthony Liguori
2011-06-16 2:10 ` Amos Kong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110616021013.4160.89565.stgit@localhost6.localdomain6 \
--to=akong@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).