diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 13337965b48c92fc2c31e8cfa5d8c8d64de035f7..72bfa35f30fbf90bfedca69e82d9526b4dd8a089 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2930,7 +2930,13 @@ (since 0.9.7, requires QEMU 0.13). multifunction defaults to 'off', but should be set to 'on' for function 0 of a slot that will - have multiple functions used. + have multiple functions used.
+ Since 1.3.5, some hypervisor + drivers may accept an <address type='pci'/> + element with no other attributes as an explicit request to + assign a PCI address for the device rather than some other + type of address that may also be appropriate for that same + device (e.g. virtio-mmio).
drive
Drive addresses have the following additional diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index e2936d87f7b06f1841c6d06e8d6c71ec3fcfb145..83fd4ec24dfef9c9a3fa8983c967c1e7fbe38e14 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -83,9 +83,11 @@ - - - + + + + + diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 9d9f6a79151a39e184f9cae69fe140c2f1712ed5..4280513b0fe917770cdd05250386c23d875b7db2 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -1,7 +1,7 @@ /* * device_conf.c: device XML handling * - * Copyright (C) 2006-2015 Red Hat, Inc. + * Copyright (C) 2006-2016 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -90,7 +90,7 @@ int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, addr->function); return 0; } - if (!(addr->domain || addr->bus || addr->slot)) { + if (virPCIDeviceAddressIsEmpty(addr)) { if (report) virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid PCI address 0000:00:00, at least " @@ -152,7 +152,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, goto cleanup; } - if (!virPCIDeviceAddressIsValid(addr, true)) + if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(addr, true)) goto cleanup; ret = 0; diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d6e044faeb4c5951d3b69292986b9fe6cef5a28a..fb05bf734c0ee70715a39c2bb82b54ce76007c1f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4522,11 +4522,14 @@ virDomainDeviceInfoFormat(virBufferPtr buf, switch ((virDomainDeviceAddressType) info->type) { case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: - virBufferAsprintf(buf, " domain='0x%.4x' bus='0x%.2x' slot='0x%.2x' function='0x%.1x'", - info->addr.pci.domain, - info->addr.pci.bus, - info->addr.pci.slot, - info->addr.pci.function); + if (!virPCIDeviceAddressIsEmpty(&info->addr.pci)) { + virBufferAsprintf(buf, " domain='0x%.4x' bus='0x%.2x' " + "slot='0x%.2x' function='0x%.1x'", + info->addr.pci.domain, + info->addr.pci.bus, + info->addr.pci.slot, + info->addr.pci.function); + } if (info->addr.pci.multi) { virBufferAsprintf(buf, " multifunction='%s'", virTristateSwitchTypeToString(info->addr.pci.multi));