yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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