(<span class="since">since 0.9.7, requires QEMU
0.13</span>). <code>multifunction</code> 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.<br/>
+ <span class="since">Since 1.3.5</span>, some hypervisor
+ drivers may accept an <code><address type='pci'/></code>
+ 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).
</dd>
<dt><code>drive</code></dt>
<dd>Drive addresses have the following additional
<ref name="pciDomain"/>
</attribute>
</optional>
- <attribute name="bus">
- <ref name="pciBus"/>
- </attribute>
+ <optional>
+ <attribute name="bus">
+ <ref name="pciBus"/>
+ </attribute>
+ </optional>
<optional>
<attribute name="slot">
<ref name="pciSlot"/>
/*
* 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
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 "
goto cleanup;
}
- if (!virPCIDeviceAddressIsValid(addr, true))
+ if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(addr, true))
goto cleanup;
ret = 0;
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));