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

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