Blame SOURCES/seabios-boot-Fix-boot-order-for-SCSI-target-lun-9.patch

51d367
From 4ca7fbed401c2aa39fea49859f4b89c839a36684 Mon Sep 17 00:00:00 2001
51d367
From: Markus Armbruster <armbru@pond.sub.org>
51d367
Date: Fri, 15 Aug 2014 15:05:26 +0200
51d367
Subject: [PATCH 2/2] boot: Fix boot order for SCSI target, lun > 9
51d367
51d367
Message-id: <1408115126-2841-2-git-send-email-armbru@pond.sub.org>
51d367
Patchwork-id: 60594
51d367
O-Subject: [PATCH RHEL-7.1 seabios 1/1] boot: Fix boot order for SCSI target, lun > 9
51d367
Bugzilla: 1096560
51d367
RH-Acked-by: Amos Kong <akong@redhat.com>
51d367
RH-Acked-by: Jeff Nelson <jenelson@redhat.com>
51d367
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
51d367
51d367
From: Markus Armbruster <armbru@redhat.com>
51d367
51d367
We identify devices by their Open Firmware device paths.  The path
51d367
component for the logical unit on a bus is incorrect:
51d367
bootprio_find_scsi_device() and bootprio_find_usb() format target
51d367
(a.k.a. SCSI ID) and lun in decimal, while QEMU uses hexadecimal.
51d367
Bootorder list entries with target, lun > 9 aren't found (lucky case),
51d367
or attributed to the wrong logical unit (unlucky case).
51d367
51d367
The relevant spec[*] agrees with QEMU (and OVMF, for that matter).
51d367
Change %d to %x.
51d367
51d367
No actual impact on USB, because QEMU only uses LUN 0 there.
51d367
51d367
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1096560
51d367
51d367
[*] Open Firmware Recommended Practice: SCSI-3 Parallel Interface,
51d367
Version 1, Section 3.1 Physical Address Formats and Representations
51d367
http://www.openfirmware.org/1275/practice/spi/spi1_0.ps
51d367
IEEE Standard for Boot (Initialization Configuration) Firmware: Core
51d367
Requirements and Practices, IEEE Std 1275-1994, Annex E SCSI host
51d367
adapter package class, section E.2.1 Physical address formats and
51d367
representations
51d367
51d367
Signed-off-by: Markus Armbruster <armbru@redhat.com>
51d367
(cherry picked from commit 275672eb70efdf81c51b997d41a4409b404aa8f6)
51d367
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
51d367
---
51d367
 src/boot.c | 4 ++--
51d367
 1 file changed, 2 insertions(+), 2 deletions(-)
51d367
51d367
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
51d367
---
51d367
 src/boot.c |    4 ++--
51d367
 1 files changed, 2 insertions(+), 2 deletions(-)
51d367
51d367
diff --git a/src/boot.c b/src/boot.c
51d367
index 133e206..e60ed3e 100644
51d367
--- a/src/boot.c
51d367
+++ b/src/boot.c
51d367
@@ -145,7 +145,7 @@ int bootprio_find_scsi_device(struct pci_device *pci, int target, int lun)
51d367
     // Find scsi drive - for example: /pci@i0cf8/scsi@5/channel@0/disk@1,0
51d367
     char desc[256], *p;
51d367
     p = build_pci_path(desc, sizeof(desc), "*", pci);
51d367
-    snprintf(p, desc+sizeof(desc)-p, "/*@0/*@%d,%d", target, lun);
51d367
+    snprintf(p, desc+sizeof(desc)-p, "/*@0/*@%x,%x", target, lun);
51d367
     return find_prio(desc);
51d367
 }
51d367
 
51d367
@@ -224,7 +224,7 @@ int bootprio_find_usb(struct usbdevice_s *usbdev, int lun)
51d367
     char desc[256], *p;
51d367
     p = build_pci_path(desc, sizeof(desc), "usb", usbdev->hub->cntl->pci);
51d367
     p = build_usb_path(p, desc+sizeof(desc)-p, usbdev->hub);
51d367
-    snprintf(p, desc+sizeof(desc)-p, "/storage@%x/*@0/*@0,%d"
51d367
+    snprintf(p, desc+sizeof(desc)-p, "/storage@%x/*@0/*@0,%x"
51d367
              , usbdev->port+1, lun);
51d367
     int ret = find_prio(desc);
51d367
     if (ret >= 0)
51d367
-- 
51d367
1.7.1
51d367