Blame SOURCES/kvm-pc-bios-s390-ccw-Fix-problem-with-invalid-virtio-scs.patch

4a2fec
From 544ee34c5f878c51e72d75d1384eed8ae38cf2a5 Mon Sep 17 00:00:00 2001
4a2fec
From: Thomas Huth <thuth@redhat.com>
4a2fec
Date: Wed, 22 Nov 2017 10:43:31 +0100
4a2fec
Subject: [PATCH 14/15] pc-bios/s390-ccw: Fix problem with invalid virtio-scsi
4a2fec
 LUN when rebooting
4a2fec
4a2fec
RH-Author: Thomas Huth <thuth@redhat.com>
4a2fec
Message-id: <1511347411-16226-4-git-send-email-thuth@redhat.com>
4a2fec
Patchwork-id: 77776
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH 3/3] pc-bios/s390-ccw: Fix problem with invalid virtio-scsi LUN when rebooting
4a2fec
Bugzilla: 1514352
4a2fec
RH-Acked-by: David Hildenbrand <david@redhat.com>
4a2fec
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
When rebooting a guest that has a virtio-scsi disk, the s390-ccw
4a2fec
bios sometimes bails out with an error message like this:
4a2fec
4a2fec
! SCSI cannot report LUNs: STATUS=02 RSPN=70 KEY=05 CODE=25 QLFR=00, sure !
4a2fec
4a2fec
Enabling the scsi_req* tracing in QEMU shows that the ccw bios is
4a2fec
trying to execute the REPORT LUNS SCSI command with a LUN != 0, and
4a2fec
this causes the SCSI command to fail.
4a2fec
Looks like we neither clear the BSS of the s390-ccw bios during reboot,
4a2fec
nor do we explicitly set the default_scsi_device.lun value to 0, so
4a2fec
this variable can contain random values from the OS after the reboot.
4a2fec
By setting this variable explicitly to 0, the problem is fixed and
4a2fec
the reboots always succeed.
4a2fec
4a2fec
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1514352
4a2fec
Signed-off-by: Thomas Huth <thuth@redhat.com>
4a2fec
Message-Id: <1510942228-22822-1-git-send-email-thuth@redhat.com>
4a2fec
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
4a2fec
Reviewed-by: David Hildenbrand <david@redhat.com>
4a2fec
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
(cherry picked from commit 8775d91a0f42d016833330881bb587982db88a3c)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 pc-bios/s390-ccw/virtio-scsi.c | 3 ++-
4a2fec
 1 file changed, 2 insertions(+), 1 deletion(-)
4a2fec
4a2fec
diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c
4a2fec
index c92f5d3..4fe4b9d 100644
4a2fec
--- a/pc-bios/s390-ccw/virtio-scsi.c
4a2fec
+++ b/pc-bios/s390-ccw/virtio-scsi.c
4a2fec
@@ -223,7 +223,8 @@ static void virtio_scsi_locate_device(VDev *vdev)
4a2fec
 
4a2fec
     for (target = 0; target <= vdev->config.scsi.max_target; target++) {
4a2fec
         sdev->channel = channel;
4a2fec
-        sdev->target = target; /* sdev->lun will be 0 here */
4a2fec
+        sdev->target = target;
4a2fec
+        sdev->lun = 0;          /* LUN has to be 0 for REPORT LUNS */
4a2fec
         if (!scsi_report_luns(vdev, data, sizeof(data))) {
4a2fec
             if (resp.response == VIRTIO_SCSI_S_BAD_TARGET) {
4a2fec
                 continue;
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec