qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 08/18] pc-bios/s390-ccw: Remove panics from ECKD IPL path


From: Jared Rossi
Subject: Re: [PATCH 08/18] pc-bios/s390-ccw: Remove panics from ECKD IPL path
Date: Fri, 27 Sep 2024 13:25:28 -0400
User-agent: Mozilla Thunderbird



On 9/27/24 11:29 AM, Thomas Huth wrote:
On 27/09/2024 02.51, jrossi@linux.ibm.com wrote:
From: Jared Rossi <jrossi@linux.ibm.com>

Remove panic-on-error from ECKD block device IPL specific functions so that
error recovery may be possible in the future.

Functions that would previously panic now provide a return code.

Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>

---
  pc-bios/s390-ccw/bootmap.c | 183 +++++++++++++++++++++++++------------
  1 file changed, 125 insertions(+), 58 deletions(-)

diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 0751a225cd..dc7200c264 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -145,14 +145,17 @@ static block_number_t load_eckd_segments(block_number_t blk, bool ldipl,
      bool more_data;
        memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs));
-    read_block(blk, bprs, "BPRS read failed");
+    if (virtio_read(blk, bprs)) {
+        puts("BPRS read failed");
+        return -EIO;
+    }
        do {
          more_data = false;
          for (j = 0;; j++) {
              block_nr = gen_eckd_block_num(&bprs[j].xeckd, ldipl);
              if (is_null_block_number(block_nr)) { /* end of chunk */
-                break;
+                return 0; /* use 0 to indicate end of load, not real block 0 */

Can we be very sure that block 0 is never a valid one, so that returning 0 is OK here? Maybe you could use an error code instead (intruducing e.g. ENOENT ?)

Yes, because block 0 is an administrative block and is reserved in both CDL
and LDL disk formats.  That being said, it is simple enough to use a specific
RC instead, which would be more resilient to format changes in the future
(e.g. if CDL and LDL are no longer written for list-directed IPL formatted
disks), so it is probably worth while to add a new code as you suggest.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]