Blame SOURCES/kvm-pc-bios-s390-ccw-Move-ipl-related-code-from-main-int.patch

a19a21
From 740590240bec03dc6ca208963112d3c2999f353e Mon Sep 17 00:00:00 2001
a19a21
From: Thomas Huth <thuth@redhat.com>
a19a21
Date: Fri, 9 Oct 2020 10:08:42 -0400
a19a21
Subject: [PATCH 06/14] pc-bios/s390-ccw: Move ipl-related code from main()
a19a21
 into a separate function
a19a21
a19a21
RH-Author: Thomas Huth <thuth@redhat.com>
a19a21
Message-id: <20201009100849.264994-3-thuth@redhat.com>
a19a21
Patchwork-id: 98596
a19a21
O-Subject: [RHEL-8.4.0 qemu-kvm PATCH 2/9] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function
a19a21
Bugzilla: 1846975
a19a21
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
a19a21
RH-Acked-by: David Hildenbrand <david@redhat.com>
a19a21
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
a19a21
a19a21
Let's move this part of the code into a separate function to be able
a19a21
to use it from multiple spots later.
a19a21
a19a21
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
a19a21
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
a19a21
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
a19a21
Message-Id: <20200806105349.632-3-thuth@redhat.com>
a19a21
Signed-off-by: Thomas Huth <thuth@redhat.com>
a19a21
(cherry picked from commit d1f060a8b515a0b1d14c38f2c8f86ab54e79c3dc)
a19a21
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
a19a21
---
a19a21
 pc-bios/s390-ccw/main.c | 20 ++++++++++++--------
a19a21
 1 file changed, 12 insertions(+), 8 deletions(-)
a19a21
a19a21
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
a19a21
index 4e65b411e1..5e565be5b1 100644
a19a21
--- a/pc-bios/s390-ccw/main.c
a19a21
+++ b/pc-bios/s390-ccw/main.c
a19a21
@@ -232,14 +232,8 @@ static void virtio_setup(void)
a19a21
     }
a19a21
 }
a19a21
 
a19a21
-int main(void)
a19a21
+static void ipl_boot_device(void)
a19a21
 {
a19a21
-    sclp_setup();
a19a21
-    css_setup();
a19a21
-    boot_setup();
a19a21
-    find_boot_device();
a19a21
-    enable_subchannel(blk_schid);
a19a21
-
a19a21
     switch (cutype) {
a19a21
     case CU_TYPE_DASD_3990:
a19a21
     case CU_TYPE_DASD_2107:
a19a21
@@ -251,8 +245,18 @@ int main(void)
a19a21
         break;
a19a21
     default:
a19a21
         print_int("Attempting to boot from unexpected device type", cutype);
a19a21
-        panic("");
a19a21
+        panic("\nBoot failed.\n");
a19a21
     }
a19a21
+}
a19a21
+
a19a21
+int main(void)
a19a21
+{
a19a21
+    sclp_setup();
a19a21
+    css_setup();
a19a21
+    boot_setup();
a19a21
+    find_boot_device();
a19a21
+    enable_subchannel(blk_schid);
a19a21
+    ipl_boot_device();
a19a21
 
a19a21
     panic("Failed to load OS from hard disk\n");
a19a21
     return 0; /* make compiler happy */
a19a21
-- 
a19a21
2.27.0
a19a21