Right now, BCVs have DefaultHDPrio priority, while BEVs have DefaultBEVPrio priority. The right thing to do instead is to look at the PCI class, while keeping DefaultHDPrio priority for legacy option ROMs.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 7 +++++-- 1 file modificato, 5 inserzioni(+), 2 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index 2835008..5101167 100644 --- a/src/boot.c +++ b/src/boot.c @@ -342,7 +342,8 @@ void boot_add_bev(u16 seg, u16 bev, u16 desc, u16 class, int prio) { class &= 0xF; - bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, DefaultBEVPrio) + int def_prio = class == PCI_BASE_CLASS_STORAGE ? DefaultHDPrio : DefaultBEVPrio; + bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, def_prio) , SEGOFF(seg, bev).segoff , desc ? MAKE_FLATPTR(seg, desc) : "Unknown"); DefaultBEVPrio = DEFAULT_PRIO; @@ -353,7 +354,9 @@ void boot_add_bcv(u16 seg, u16 ip, u16 desc, u16 class, int prio) { class &= 0xF; - bootentry_add(IPL_TYPE_BCV | class, defPrio(prio, DefaultHDPrio) + // Legacy option ROMs have class == 0; make them DefaultHDPrio + int def_prio = class <= PCI_BASE_CLASS_STORAGE ? DefaultHDPrio : DefaultBEVPrio; + bootentry_add(IPL_TYPE_BCV | class, defPrio(prio, def_prio) , SEGOFF(seg, ip).segoff , desc ? MAKE_FLATPTR(seg, desc) : "Legacy option rom"); }