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

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