From 430e76fd964390db86c8486f76b916a1cf7f74c2 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 8 Jul 2022 20:49:01 +0200 Subject: [PATCH 12/17] pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration RH-Author: Thomas Huth RH-MergeRequest: 106: pc-bios/s390-ccw: Fix boot from disks with 4k sectors that do not have the typical DASD geometry RH-Commit: [7/10] b15c06b4c5431837672b6cb5d57d09da20718441 (thuth/qemu-kvm-cs9) RH-Bugzilla: 2098077 RH-Acked-by: Miroslav Rezanina RH-Acked-by: David Hildenbrand RH-Acked-by: Cornelia Huck Bugzilla: http://bugzilla.redhat.com/2098077 commit 070824885741f5d2a66626d3c4ecb2773c8e0552 Author: Thomas Huth Date: Mon Jul 4 13:18:59 2022 +0200 pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration It looks nicer if we separate the run_ccw() from the IPL_assert() statement, and the error message should talk about "virtio device" instead of "block device", since this code is nowadays used for non-block (i.e. network) devices, too. Message-Id: <20220704111903.62400-9-thuth@redhat.com> Reviewed-by: Cornelia Huck Reviewed-by: Eric Farman Signed-off-by: Thomas Huth Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/virtio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index d8c2b52710..f37510f312 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -289,9 +289,8 @@ void virtio_setup_ccw(VDev *vdev) .num = 0, }; - IPL_assert( - run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0, - "Could not get block device VQ configuration"); + rc = run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false); + IPL_assert(rc == 0, "Could not get virtio device VQ configuration"); info.num = config.num; vring_init(&vdev->vrings[i], &info); vdev->vrings[i].schid = vdev->schid; -- 2.31.1