On 30/09/2024 09.48, Thomas Huth wrote:
On 27/09/2024 02.51, jro...@linux.ibm.com wrote:
From: Jared Rossi <jro...@linux.ibm.com>

Remove panic-on-error from virtio-scsi 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 <jro...@linux.ibm.com>

---
...
@@ -572,23 +575,37 @@ static void zipl_load_segment(ComponentEntry *entry)
              }
              address = virtio_load_direct(cur_desc[0], cur_desc[1], 0,
                                           (void *)address);
-            IPL_assert(address != -1, "zIPL load segment failed");
+            if (!address) {

Shouldn't that be "if (address == -1)" or "if (address < 0)" instead?

Hmm, virtio_load_direct() seems to return an "unsigned long", so maybe that one rather needs to be fixed, too?

(see my comments on patch 12)

+                puts("zIPL load segment failed");
+                return -EIO;
+            }
          }
      } while (blockno);
+
+    return 0;
  }
...
@@ -78,24 +84,30 @@ static void prepare_request(VDev *vdev, const void *cdb, int cdb_size,
      }
  }
-static inline void vs_io_assert(bool term, const char *msg)
+static inline bool vs_io_assert(bool term, const char *msg)
  {
-    if (!term) {
-        virtio_scsi_verify_response(&resp, msg);
+    if (!term && !virtio_scsi_verify_response(&resp, msg)) {

Should that be "||" instead of "&&" ?

Ah, never mind, I got it wrong, the "&&" should be fine here.

 Thomas


Reply via email to