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

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