virPCIDeviceAddress addr,
bool includeTypeInAddr)
{
- virBufferAsprintf(buf, "<address %sdomain='0x%.4x' bus='0x%.2x' "
- "slot='0x%.2x' function='0x%.1x'/>\n",
+ virBufferAsprintf(buf, "<address %sdomain='0x%04x' bus='0x%02x' "
+ "slot='0x%02x' function='0x%d'/>\n",
includeTypeInAddr ? "type='pci' " : "",
addr.domain,
addr.bus,
/* The first device decides the isolation group for the
* entire bus */
bus->isolationGroup = isolationGroup;
- VIR_DEBUG("PCI bus %.4x:%.2x assigned isolation group %u because of "
+ VIR_DEBUG("PCI bus %04x:%02x assigned isolation group %u because of "
"first device %s",
addr->domain, addr->bus, isolationGroup, addrStr);
} else if (bus->isolationGroup != isolationGroup && fromConfig) {
* back to the default (because at that point isolation can't
* be guaranteed anymore) */
bus->isolationGroup = 0;
- VIR_DEBUG("PCI bus %.4x:%.2x assigned isolation group %u because of "
+ VIR_DEBUG("PCI bus %04x:%02x assigned isolation group %u because of "
"user assigned address %s",
addr->domain, addr->bus, isolationGroup, addrStr);
}
if (!virDomainPCIAddressFlagsCompatible(searchAddr, addrStr, bus->flags,
flags, false, false)) {
- VIR_DEBUG("PCI bus %.4x:%.2x is not compatible with the device",
+ VIR_DEBUG("PCI bus %04x:%02x is not compatible with the device",
searchAddr->domain, searchAddr->bus);
} else {
while (searchAddr->slot <= bus->maxSlot) {
}
}
- VIR_DEBUG("PCI slot %.4x:%.2x:%.2x already in use",
+ VIR_DEBUG("PCI slot %04x:%02x:%02x already in use",
searchAddr->domain, searchAddr->bus, searchAddr->slot);
searchAddr->slot++;
}
return -1;
success:
- VIR_DEBUG("Found free PCI slot %.4x:%.2x:%.2x",
+ VIR_DEBUG("Found free PCI slot %04x:%02x:%02x",
a.domain, a.bus, a.slot);
*next_addr = a;
return 0;
switch ((virDomainDeviceAddressType) info->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
if (!virPCIDeviceAddressIsEmpty(&info->addr.pci)) {
- virBufferAsprintf(&attrBuf, " domain='0x%.4x' bus='0x%.2x' "
- "slot='0x%.2x' function='0x%.1x'",
+ virBufferAsprintf(&attrBuf, " domain='0x%04x' bus='0x%02x' "
+ "slot='0x%02x' function='0x%d'",
info->addr.pci.domain,
info->addr.pci.bus,
info->addr.pci.slot,
virBufferAddLit(buf, "<capability type='phys_function'>\n");
virBufferAdjustIndent(buf, 2);
virBufferAsprintf(buf,
- "<address domain='0x%.4x' bus='0x%.2x' "
- "slot='0x%.2x' function='0x%.1x'/>\n",
+ "<address domain='0x%04x' bus='0x%02x' "
+ "slot='0x%02x' function='0x%d'/>\n",
data->pci_dev.physical_function->domain,
data->pci_dev.physical_function->bus,
data->pci_dev.physical_function->slot,
virBufferAdjustIndent(buf, 2);
for (i = 0; i < data->pci_dev.num_virtual_functions; i++) {
virBufferAsprintf(buf,
- "<address domain='0x%.4x' bus='0x%.2x' "
- "slot='0x%.2x' function='0x%.1x'/>\n",
+ "<address domain='0x%04x' bus='0x%02x' "
+ "slot='0x%02x' function='0x%d'/>\n",
data->pci_dev.virtual_functions[i]->domain,
data->pci_dev.virtual_functions[i]->bus,
data->pci_dev.virtual_functions[i]->slot,
virBufferAdjustIndent(buf, 2);
for (i = 0; i < data->pci_dev.nIommuGroupDevices; i++) {
virBufferAsprintf(buf,
- "<address domain='0x%.4x' bus='0x%.2x' "
- "slot='0x%.2x' function='0x%.1x'/>\n",
+ "<address domain='0x%04x' bus='0x%02x' "
+ "slot='0x%02x' function='0x%d'/>\n",
data->pci_dev.iommuGroupDevices[i]->domain,
data->pci_dev.iommuGroupDevices[i]->bus,
data->pci_dev.iommuGroupDevices[i]->slot,
unsigned int fid;
};
-#define VIR_PCI_DEVICE_ADDRESS_FMT "%.4x:%.2x:%.2x.%.1x"
+#define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d"
struct _virPCIDeviceAddress {
unsigned int domain;
virBufferAddLit(&buf, "<source>\n");
virBufferAdjustIndent(&buf, 2);
- virBufferAsprintf(&buf, "<address type='pci' domain='0x%.4x'"
- " bus='0x%.2x' slot='0x%.2x' function='0x%.1x'/>\n",
+ virBufferAsprintf(&buf, "<address type='pci' domain='0x%04x'"
+ " bus='0x%02x' slot='0x%02x' function='0x%d'/>\n",
pciAddr.domain, pciAddr.bus,
pciAddr.slot, pciAddr.function);
virBufferAdjustIndent(&buf, -2);