usb: fix boot paths
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Nov 2011 14:59:24 +0000 (15:59 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 22 Nov 2011 13:41:44 +0000 (08:41 -0500)
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.

src/boot.c

index 119f29007de5fa8b14ad590f281e07ccc4b90145..93928d38dd5ff3df57d100b5e57e08cb0621992f 100644 (file)
@@ -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);
 }