Blob Blame History Raw
commit a3fea015398d7c41db5b5d348fe3f6d76236b6be
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 18 15:59:24 2011 +0100

    usb: fix boot paths
    
    The fw paths for USB devices that SeaBIOS computes are off-by-one,
    because QEMU builds those paths with a numbering that starts from one
    (see usb_fill_port and usb_hub_initfn in QEMU).  Fix that so that
    the numbering agrees.

diff --git a/src/boot.c b/src/boot.c
index 119f290..93928d3 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -191,9 +191,9 @@ int bootprio_find_usb(struct pci_device *pci, u64 path)
     for (i=56; i>0; i-=8) {
         int port = (path >> i) & 0xff;
         if (port != 0xff)
-            p += snprintf(p, desc+sizeof(desc)-p, "/hub@%x", port);
+            p += snprintf(p, desc+sizeof(desc)-p, "/hub@%x", port+1);
     }
-    snprintf(p, desc+sizeof(desc)-p, "/*@%x", (u32)(path & 0xff));
+    snprintf(p, desc+sizeof(desc)-p, "/*@%x", (u32)(path & 0xff)+1);
     return find_prio(desc);
 }