From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
borntraeger@de.ibm.com, jasowang@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 2/4] virtio-ccw: support ring size changes
Date: Fri, 4 Sep 2015 10:54:27 +0200 [thread overview]
Message-ID: <1441356869-57861-3-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1441356869-57861-1-git-send-email-cornelia.huck@de.ibm.com>
Wire up changing the ring size for virtio-1 devices.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
hw/s390x/virtio-ccw.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index d36373e..85e2a5d 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -307,11 +307,18 @@ static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBlock *info,
if (!desc) {
virtio_queue_set_vector(vdev, index, VIRTIO_NO_VECTOR);
} else {
- /* Fail if we don't have a big enough queue. */
- /* TODO: Add interface to handle vring.num changing */
- if (virtio_queue_get_num(vdev, index) > num) {
+ if (info) {
+ /* virtio-1 allows changing the ring size. */
+ if (virtio_queue_get_num(vdev, index) < num) {
+ /* Fail if we exceed the maximum number. */
+ return -EINVAL;
+ }
+ virtio_queue_set_num(vdev, index, num);
+ } else if (virtio_queue_get_num(vdev, index) > num) {
+ /* Fail if we don't have a big enough queue. */
return -EINVAL;
}
+ /* We ignore possible increased num for legacy for compatibility. */
virtio_queue_set_vector(vdev, index, index);
}
/* tell notify handler in case of config change */
--
2.3.8
next prev parent reply other threads:[~2015-09-04 8:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 8:54 [Qemu-devel] [PATCH 0/4] virtio-1/virtio-ccw related patches Cornelia Huck
2015-09-04 8:54 ` [Qemu-devel] [PATCH 1/4] virtio: ring sizes vs. reset Cornelia Huck
2015-09-10 9:02 ` Michael S. Tsirkin
2015-09-10 10:22 ` Cornelia Huck
2015-09-10 10:43 ` Michael S. Tsirkin
2015-09-10 11:48 ` [Qemu-devel] [PATCH v2] " Cornelia Huck
2015-09-11 2:53 ` Jason Wang
2015-09-04 8:54 ` Cornelia Huck [this message]
2015-09-04 8:54 ` [Qemu-devel] [PATCH 3/4] virtio-ccw: feature bits > 31 handling Cornelia Huck
2015-09-07 10:50 ` David Hildenbrand
2015-09-04 8:54 ` [Qemu-devel] [PATCH 4/4] virtio-ccw: enable virtio-1 Cornelia Huck
2015-09-10 9:07 ` Michael S. Tsirkin
2015-09-10 9:11 ` Cornelia Huck
2015-09-10 9:22 ` Michael S. Tsirkin
2015-09-10 10:29 ` Cornelia Huck
2015-09-11 13:11 ` Cornelia Huck
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=1441356869-57861-3-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=jasowang@redhat.com \
--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).