yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390-bios-Extend-find_dev-for-non-virtio-devices.patch

Pablo Greco e6a3ae
From edf2dd4c4eda49957b845ea90a084dde0951f92a Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Date: Mon, 14 Oct 2019 10:06:39 +0100
Pablo Greco e6a3ae
Subject: [PATCH 14/21] s390-bios: Extend find_dev() for non-virtio devices
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Message-id: <20191014100645.22862-12-thuth@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 91784
Pablo Greco e6a3ae
O-Subject: [RHEL-8.2.0 qemu-kvm PATCH v2 11/17] s390-bios: Extend find_dev() for non-virtio devices
Pablo Greco e6a3ae
Bugzilla: 1664376
Pablo Greco e6a3ae
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: David Hildenbrand <david@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: "Jason J. Herne" <jjherne@linux.ibm.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
We need a method for finding the subchannel of a dasd device. Let's
Pablo Greco e6a3ae
modify find_dev to handle this since it mostly does what we need. Up to
Pablo Greco e6a3ae
this point find_dev has been specific to only virtio devices.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
Pablo Greco e6a3ae
Acked-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Pablo Greco e6a3ae
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Message-Id: <1554388475-18329-11-git-send-email-jjherne@linux.ibm.com>
Pablo Greco e6a3ae
Signed-off-by: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 930072d2bf30986e57dac5c5945a32492f288944)
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 pc-bios/s390-ccw/main.c | 16 +++++++++++-----
Pablo Greco e6a3ae
 1 file changed, 11 insertions(+), 5 deletions(-)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
Pablo Greco e6a3ae
index e403b5f..d04ea89 100644
Pablo Greco e6a3ae
--- a/pc-bios/s390-ccw/main.c
Pablo Greco e6a3ae
+++ b/pc-bios/s390-ccw/main.c
Pablo Greco e6a3ae
@@ -52,6 +52,12 @@ unsigned int get_loadparm_index(void)
Pablo Greco e6a3ae
     return atoui(loadparm_str);
Pablo Greco e6a3ae
 }
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
+/*
Pablo Greco e6a3ae
+ * Find the subchannel connected to the given device (dev_no) and fill in the
Pablo Greco e6a3ae
+ * subchannel information block (schib) with the connected subchannel's info.
Pablo Greco e6a3ae
+ * NOTE: The global variable blk_schid is updated to contain the subchannel
Pablo Greco e6a3ae
+ * information.
Pablo Greco e6a3ae
+ */
Pablo Greco e6a3ae
 static bool find_dev(Schib *schib, int dev_no)
Pablo Greco e6a3ae
 {
Pablo Greco e6a3ae
     int i, r;
Pablo Greco e6a3ae
@@ -65,15 +71,15 @@ static bool find_dev(Schib *schib, int dev_no)
Pablo Greco e6a3ae
         if (!schib->pmcw.dnv) {
Pablo Greco e6a3ae
             continue;
Pablo Greco e6a3ae
         }
Pablo Greco e6a3ae
-        if (!virtio_is_supported(blk_schid)) {
Pablo Greco e6a3ae
-            continue;
Pablo Greco e6a3ae
-        }
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
         /* Skip net devices since no IPLB is created and therefore no
Pablo Greco e6a3ae
-         * no network bootloader has been loaded
Pablo Greco e6a3ae
+         * network bootloader has been loaded
Pablo Greco e6a3ae
          */
Pablo Greco e6a3ae
-        if (virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) {
Pablo Greco e6a3ae
+        if (virtio_is_supported(blk_schid) &&
Pablo Greco e6a3ae
+            virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) {
Pablo Greco e6a3ae
             continue;
Pablo Greco e6a3ae
         }
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
         if ((dev_no < 0) || (schib->pmcw.dev == dev_no)) {
Pablo Greco e6a3ae
             return true;
Pablo Greco e6a3ae
         }
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae