We save all used PCI address in the hash table. The key is generated by domain,
bus and slot now. We will support multi function PCI device, so the key should
be generated by domain, bus, slot and function.
return NULL;
}
- if (virAsprintf(&addr, "%d:%d:%d",
+ if (virAsprintf(&addr, "%d:%d:%d.%d",
dev->addr.pci.domain,
dev->addr.pci.bus,
- dev->addr.pci.slot) < 0) {
+ dev->addr.pci.slot,
+ dev->addr.pci.function) < 0) {
virReportOOMError();
return NULL;
}
dev.addr.pci.domain = 0;
dev.addr.pci.bus = 0;
dev.addr.pci.slot = slot;
+ dev.addr.pci.function = 0;
return qemuDomainPCIAddressReserveAddr(addrs, &dev);
}
maybe.addr.pci.domain = 0;
maybe.addr.pci.bus = 0;
maybe.addr.pci.slot = i;
+ maybe.addr.pci.function = 0;
if (!(addr = qemuPCIAddressAsString(&maybe)))
return -1;