[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/12] virtio-ccw: check flic->adapter_routes_max_ba
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH 08/12] virtio-ccw: check flic->adapter_routes_max_batch |
Date: |
Mon, 20 Feb 2017 10:57:30 +0100 |
From: Halil Pasic <address@hidden>
Currently VIRTIO_CCW_QUEUE_MAX is defined as ADAPTER_ROUTES_MAX_GSI.
That is when checking queue max we implicitly check the constraint
concerning the number of adapter routes. This won't be satisfactory any
more (due to backward migration considerations) if ADAPTER_ROUTES_MAX_GSI
changes (ADAPTER_ROUTES_MAX_GSI is going to change because we want to
support up to VIRTIO_QUEUE_MAX queues per virtio-ccw device).
Let us introduce a check on a recently introduce flic property which
gives us the compatibility machine aware limit on adapter routes.
Signed-off-by: Halil Pasic <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/virtio-ccw.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 771411ea3c..a2ea95947f 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1319,6 +1319,7 @@ static void virtio_ccw_device_plugged(DeviceState *d,
Error **errp)
CcwDevice *ccw_dev = CCW_DEVICE(d);
SubchDev *sch = ccw_dev->sch;
int n = virtio_get_num_queues(vdev);
+ S390FLICState *flic = s390_get_flic();
if (!virtio_has_feature(vdev->host_features, VIRTIO_F_VERSION_1)) {
dev->max_rev = 0;
@@ -1330,6 +1331,12 @@ static void virtio_ccw_device_plugged(DeviceState *d,
Error **errp)
VIRTIO_CCW_QUEUE_MAX);
return;
}
+ if (virtio_get_num_queues(vdev) > flic->adapter_routes_max_batch) {
+ error_setg(errp, "The number of virtqueues %d "
+ "exceeds flic adapter route limit %d", n,
+ flic->adapter_routes_max_batch);
+ return;
+ }
sch->id.cu_model = virtio_bus_get_vdev_id(&dev->bus);
--
2.11.0
- [Qemu-devel] [PATCH 00/12] more s390x patches for 2.9, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 02/12] s390x/kvm: detect some program check loops, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 01/12] s390x/s390-virtio: get rid of DPRINTF, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 05/12] virtio-ccw: add virtio-crypto-ccw device, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 03/12] s390x/flic: fail migration on source already, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 08/12] virtio-ccw: check flic->adapter_routes_max_batch,
Cornelia Huck <=
- [Qemu-devel] [PATCH 07/12] s390x: add property adapter_routes_max_batch, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 06/12] virtio-ccw: Check the number of vqs in CCW_CMD_SET_IND, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 04/12] virtio-ccw: handle virtio 1 only devices, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 09/12] s390x: bump ADAPTER_ROUTES_MAX_GSI, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 11/12] s390x/arch_dump: use proper note name and note size, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 12/12] s390x/arch_dump: pass cpuid into notes sections, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 10/12] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues, Cornelia Huck, 2017/02/20