[libvirt] [PATCH v2 0/4] domain: Support <address type='pci'/> allocation

This patch series allows the user to specify bare device <address type='pci'/> to explicitly request PCI address allocation. It's only wired up for qemu, and explicitly errors for all other drivers. This has several uses, but the motivating one is providing an easy way to request PCI address allocation where it normally isn't the default address type, like for aarch64 VMs. v1 posting was here: http://www.redhat.com/archives/libvir-list/2016-March/msg00268.html This series depends on calling qemuDomainAssignAddresses from PostParse: http://www.redhat.com/archives/libvir-list/2016-May/msg01075.html Changes since v1: - Rebased to master - Dropped patches that were merged - Split out AssignAddress bits to their own series - Add formatdomain docs Cole Robinson (4): util: xml: add virXMLPropertyCount domain: Make <address type='pci'/> request address allocation qemu: Wire up address type=pci auto_allocate tests: qemu: test <address type='pci'/> with aarch64 docs/formatdomain.html.in | 5 ++- docs/schemas/domaincommon.rng | 5 ++- src/conf/domain_conf.c | 30 +++++++++++++- src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + src/qemu/qemu_domain_address.c | 47 ++++++++++++++++++++++ src/util/virxml.c | 17 ++++++++ src/util/virxml.h | 1 + .../generic-pci-autofill-addr.xml | 27 +++++++++++++ tests/genericxml2xmltest.c | 3 ++ ...l2argv-aarch64-virtio-pci-manual-addresses.args | 4 +- ...ml2argv-aarch64-virtio-pci-manual-addresses.xml | 5 +++ .../qemuxml2argv-pci-autofill-addr.args | 25 ++++++++++++ .../qemuxml2argv-pci-autofill-addr.xml | 35 ++++++++++++++++ tests/qemuxml2argvtest.c | 1 + ...2xmlout-aarch64-virtio-pci-manual-addresses.xml | 5 +++ .../qemuxml2xmlout-pci-autofill-addr.xml | 41 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 18 files changed, 250 insertions(+), 4 deletions(-) create mode 100644 tests/genericxml2xmlindata/generic-pci-autofill-addr.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml -- 2.7.4

Returns an integer count of the number of XML properties an element has. Will be used in future patches. --- src/libvirt_private.syms | 1 + src/util/virxml.c | 17 +++++++++++++++++ src/util/virxml.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fb24808..40b70a1 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2550,6 +2550,7 @@ virXMLExtractNamespaceXML; virXMLNodeToString; virXMLParseHelper; virXMLPickShellSafeComment; +virXMLPropertyCount; virXMLPropString; virXMLSaveFile; virXMLValidateAgainstSchema; diff --git a/src/util/virxml.c b/src/util/virxml.c index 489bad8..86c021c 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -890,6 +890,23 @@ virXMLChildElementCount(xmlNodePtr node) return ret; } +/* Returns the number of node's properties, or -1 on error. */ +long +virXMLPropertyCount(xmlNodePtr node) +{ + long ret = 0; + xmlAttrPtr cur = NULL; + + if (!node || node->type != XML_ELEMENT_NODE) + return -1; + cur = node->properties; + while (cur) { + ret++; + cur = cur->next; + } + return ret; +} + /** * virXMLNodeToString: convert an XML node ptr to an XML string diff --git a/src/util/virxml.h b/src/util/virxml.h index b94de74..5cf082e 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -72,6 +72,7 @@ int virXPathNodeSet(const char *xpath, char * virXMLPropString(xmlNodePtr node, const char *name); long virXMLChildElementCount(xmlNodePtr node); +long virXMLPropertyCount(xmlNodePtr node); /* Internal function; prefer the macros below. */ xmlDocPtr virXMLParseHelper(int domcode, -- 2.7.4

On Sun, May 15, 2016 at 15:11:26 -0400, Cole Robinson wrote:
Returns an integer count of the number of XML properties an element has. Will be used in future patches. --- src/libvirt_private.syms | 1 + src/util/virxml.c | 17 +++++++++++++++++ src/util/virxml.h | 1 + 3 files changed, 19 insertions(+)
[...]
diff --git a/src/util/virxml.c b/src/util/virxml.c index 489bad8..86c021c 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -890,6 +890,23 @@ virXMLChildElementCount(xmlNodePtr node) return ret; }
+/* Returns the number of node's properties, or -1 on error. */ +long +virXMLPropertyCount(xmlNodePtr node) +{ + long ret = 0; + xmlAttrPtr cur = NULL; + + if (!node || node->type != XML_ELEMENT_NODE) + return -1; + cur = node->properties; + while (cur) { + ret++; + cur = cur->next; + } + return ret; +}
Function like this looks rather fishy. Checking according to the count of attributes is very likely to break. I'd rather see us checking explicitly that certain attributes are present or not. I think this will make the code more fragile in the long therm with little gain in the short term. Peter

On 05/16/2016 10:39 AM, Peter Krempa wrote:
On Sun, May 15, 2016 at 15:11:26 -0400, Cole Robinson wrote:
Returns an integer count of the number of XML properties an element has. Will be used in future patches. --- src/libvirt_private.syms | 1 + src/util/virxml.c | 17 +++++++++++++++++ src/util/virxml.h | 1 + 3 files changed, 19 insertions(+)
[...]
diff --git a/src/util/virxml.c b/src/util/virxml.c index 489bad8..86c021c 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -890,6 +890,23 @@ virXMLChildElementCount(xmlNodePtr node) return ret; }
+/* Returns the number of node's properties, or -1 on error. */ +long +virXMLPropertyCount(xmlNodePtr node) +{ + long ret = 0; + xmlAttrPtr cur = NULL; + + if (!node || node->type != XML_ELEMENT_NODE) + return -1; + cur = node->properties; + while (cur) { + ret++; + cur = cur->next; + } + return ret; +}
Function like this looks rather fishy. Checking according to the count of attributes is very likely to break. I'd rather see us checking explicitly that certain attributes are present or not.
I think this will make the code more fragile in the long therm with little gain in the short term.
The pattern could be abused, but the way it's used in the next patch is to check type=pci and count=1, so I don't see how that is fragile in this context. Maybe if PCI addresses grew sub elements one day we might do the wrong thing... I could add a check for that too. IMO what _is_ fragile is trying to check if (!domain && !bus && !slot && !function && !multi) info->auto_allocate = true; since a new property added in the future may forget to update that list. Plus the only clear place to put that is in PCIDeviceAddressParseXML which is used in several other places that explicitly do _not_ deal with auto_allocate, so it could warrant an extra argument to the function, or more logic at the call sites to reject auto_allocate. I'm certainly not in love with the approach but I can't think of anything cleaner at the moment... Thanks, Cole

If a bare device <address type='pci'/> is specified, set an internal flag address->auto_allocate. Individual hv drivers can then check for this and act on it if they want, nothing is allocated in generic code. If drivers allocate an address, they are expected to unset auto_allocate. Generic domain conf code then checks at the end of PostParse to ensure no device addresses still have auto_allocate set; this ensures we aren't formatting any bogus address XML, and it informs the user if their request didn't work. Add a genericxml2xml test case for this. The auto_allocate property is a part of the generic address structure and not the PCI specific bits, this will make it easier to reuse with other address types too. One note: we detect <address type='pci'/> by counting its XML properties, rather than comparing specifically against parsed values, which seems easier to maintain. --- docs/formatdomain.html.in | 5 +++- docs/schemas/domaincommon.rng | 5 +++- src/conf/domain_conf.c | 30 +++++++++++++++++++++- src/conf/domain_conf.h | 1 + .../generic-pci-autofill-addr.xml | 27 +++++++++++++++++++ tests/genericxml2xmltest.c | 3 +++ 6 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 tests/genericxml2xmlindata/generic-pci-autofill-addr.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 58b8cb6..150938d 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2930,7 +2930,10 @@ (<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 a bare <code><address type='pci'/></code> XML block + as an explicit request to allocate a PCI address for the device. </dd> <dt><code>drive</code></dt> <dd>Drive addresses have the following additional diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8798001..94ffab2 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4538,7 +4538,10 @@ <attribute name="type"> <value>pci</value> </attribute> - <ref name="pciaddress"/> + <choice> + <ref name="pciaddress"/> + <empty/> + </choice> </group> <group> <attribute name="type"> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1c8d326..fd21dba 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3924,6 +3924,23 @@ virDomainDefPostParseTimer(virDomainDefPtr def) } +static int +virDomainCheckUnallocatedDeviceAddrs(virDomainDefPtr def ATTRIBUTE_UNUSED, + virDomainDeviceDefPtr dev, + virDomainDeviceInfoPtr info, + void *data ATTRIBUTE_UNUSED) +{ + if (!info->auto_allocate) + return 0; + + virReportError(VIR_ERR_INTERNAL_ERROR, + _("driver didn't allocate requested address type '%s' for device '%s'"), + virDomainDeviceAddressTypeToString(info->type), + virDomainDeviceTypeToString(dev->type)); + return -1; +} + + /* Check if a drive type address $controller:$bus:$target:$unit is already * taken by a disk or not. */ @@ -4455,6 +4472,12 @@ virDomainDefPostParse(virDomainDefPtr def, return ret; } + /* Ensure the driver filled in any auto_allocate addresses. + This must come after the assignAddressesCallback */ + if (virDomainDeviceInfoIterate(def, virDomainCheckUnallocatedDeviceAddrs, + NULL) < 0) + return -1; + if (virDomainDefPostParseCheckFeatures(def, xmlopt) < 0) return -1; @@ -5091,8 +5114,13 @@ virDomainDeviceInfoParseXML(xmlNodePtr node, switch ((virDomainDeviceAddressType) info->type) { case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: - if (virPCIDeviceAddressParseXML(address, &info->addr.pci) < 0) + if (virXMLPropertyCount(address) == 1) { + /* Bare <address type='pci'/> is a request to allocate + the address. */ + info->auto_allocate = true; + } else if (virPCIDeviceAddressParseXML(address, &info->addr.pci) < 0) { goto cleanup; + } break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 02594fe..d347e8f 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -347,6 +347,7 @@ struct _virDomainDeviceInfo { */ char *alias; int type; /* virDomainDeviceAddressType */ + bool auto_allocate; union { virPCIDeviceAddress pci; virDomainDeviceDriveAddress drive; diff --git a/tests/genericxml2xmlindata/generic-pci-autofill-addr.xml b/tests/genericxml2xmlindata/generic-pci-autofill-addr.xml new file mode 100644 index 0000000..06eadb6 --- /dev/null +++ b/tests/genericxml2xmlindata/generic-pci-autofill-addr.xml @@ -0,0 +1,27 @@ +<domain type='test'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='vda' bus='virtio'/> + <address type='pci'/> + </disk> + <controller type='usb' index='0'> + <address type='pci'/> + </controller> + </devices> +</domain> diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 70ecd2d..2c492c3 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -91,6 +91,9 @@ mymain(void) DO_TEST_FULL("name-slash-parse", 0, false, TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); + DO_TEST_FULL("pci-autofill-addr", 0, false, + TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); + virObjectUnref(caps); virObjectUnref(xmlopt); -- 2.7.4

We do this in 2 passes: before PCI addresses are about to be collected, we convert type=pci auto_allocate=true to type=none auto_allocate=true, since the existing code is already expecting type=none here. After all PCI allocation should be complete, we do another pass of the device addresses converting type=pci auto_allocate=true to auto_allocate=false, so we don't trigger the unallocated address validation check in generic domain code. --- src/qemu/qemu_domain_address.c | 47 ++++++++++++++++++++++ .../qemuxml2argv-pci-autofill-addr.args | 25 ++++++++++++ .../qemuxml2argv-pci-autofill-addr.xml | 35 ++++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../qemuxml2xmlout-pci-autofill-addr.xml | 41 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 6 files changed, 150 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 9d09b3a..90050ec 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1456,6 +1456,45 @@ qemuDomainAddressFindNewBusNr(virDomainDefPtr def) static int +qemuDomainPrepPCIAutoAllocate(virDomainDefPtr def ATTRIBUTE_UNUSED, + virDomainDeviceDefPtr device ATTRIBUTE_UNUSED, + virDomainDeviceInfoPtr info, + void *opaque ATTRIBUTE_UNUSED) +{ + /* If PCI auto_allocate requested, set type to NONE since the rest + of the code expects it. */ + if (info->auto_allocate && + info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) + info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; + + return 0; +} + + +static int +qemuDomainFinishPCIAutoAllocate(virDomainDefPtr def ATTRIBUTE_UNUSED, + virDomainDeviceDefPtr device ATTRIBUTE_UNUSED, + virDomainDeviceInfoPtr info, + void *opaque ATTRIBUTE_UNUSED) +{ + /* A PCI device was allocated as requested, unset auto_allocate so + we don't trip the domain error about unallocated addresses */ + if (info->auto_allocate && + info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) + info->auto_allocate = false; + + /* We wanted to allocate a PCI address but it was never filled in... + this is likely an XML error. Re-set type=PCI to give a correct + error from domain conf */ + if (info->auto_allocate && + info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) + info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; + + return 0; +} + + +static int qemuDomainAssignPCIAddresses(virDomainDefPtr def, virQEMUCapsPtr qemuCaps, virDomainObjPtr obj) @@ -1471,6 +1510,10 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, virDomainPCIConnectFlags flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE; + if (virDomainDeviceInfoIterate(def, qemuDomainPrepPCIAutoAllocate, + NULL) < 0) + goto cleanup; + for (i = 0; i < def->ncontrollers; i++) { if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { if ((int) def->controllers[i]->idx > max_idx) @@ -1616,6 +1659,10 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, } } + if (virDomainDeviceInfoIterate(def, qemuDomainFinishPCIAutoAllocate, + NULL) < 0) + goto cleanup; + if (obj && obj->privateData) { priv = obj->privateData; if (addrs) { diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args new file mode 100644 index 0000000..ddb8c8d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args @@ -0,0 +1,25 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/libexec/qemu-kvm \ +-name fdr-br \ +-S \ +-M pc-1.2 \ +-m 2048 \ +-smp 2 \ +-uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-fdr-br/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-drive file=/var/iso/f18kde.iso,format=raw,if=none,media=cdrom,\ +id=drive-virtio-disk0 \ +-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\ +id=virtio-disk0 \ +-vga cirrus \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml new file mode 100644 index 0000000..e5256fe --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml @@ -0,0 +1,35 @@ +<domain type='qemu'> + <name>fdr-br</name> + <uuid>3ec6cbe1-b5a2-4515-b800-31a61855df41</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static' cpuset='0-1'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.2'>hvm</type> + <boot dev='hd'/> + </os> + <devices> + <emulator>/usr/libexec/qemu-kvm</emulator> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='/var/iso/f18kde.iso'/> + <target dev='vda' bus='virtio'/> + <readonly/> + <address type='pci'/> + </disk> + <controller type='usb' index='0'> + <address type='pci'/> + </controller> + <controller type='ide' index='0'> + <address type='pci'/> + </controller> + <input type='mouse' bus='ps2'/> + <video> + <model type='cirrus' vram='16384' heads='1'/> + <address type='pci'/> + </video> + <memballoon model='virtio'> + <address type='pci'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a83102d..7ab0f31 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1501,6 +1501,7 @@ mymain(void) DO_TEST("pci-autoadd-addr", QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("pci-autoadd-idx", QEMU_CAPS_DEVICE_PCI_BRIDGE); + DO_TEST("pci-autofill-addr", NONE); DO_TEST("pci-many", QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST("pci-bridge-many-disks", diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml new file mode 100644 index 0000000..6259044 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml @@ -0,0 +1,41 @@ +<domain type='qemu'> + <name>fdr-br</name> + <uuid>3ec6cbe1-b5a2-4515-b800-31a61855df41</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static' cpuset='0-1'>2</vcpu> + <os> + <type arch='x86_64' machine='pc-1.2'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/libexec/qemu-kvm</emulator> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='/var/iso/f18kde.iso'/> + <target dev='vda' bus='virtio'/> + <readonly/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9eb2625..6f39ca9 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -587,6 +587,7 @@ mymain(void) QEMU_CAPS_DEVICE_PCI_BRIDGE); DO_TEST_FULL("pci-autoadd-idx", WHEN_ACTIVE, QEMU_CAPS_DEVICE_PCI_BRIDGE); + DO_TEST("pci-autofill-addr"); DO_TEST_FULL("q35", WHEN_ACTIVE, QEMU_CAPS_DEVICE_PCI_BRIDGE, -- 2.7.4

This is an interesting test case since PCI isn't the default for aarch64. --- .../qemuxml2argv-aarch64-virtio-pci-manual-addresses.args | 4 +++- .../qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml | 5 +++++ .../qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args index 2dfcd1e..0234404 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args @@ -29,4 +29,6 @@ QEMU_AUDIO_DRV=none \ -device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,\ id=scsi0-0-0-0 \ -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:09:a4:37,bus=pcie.0,addr=0x2 \ --net user,vlan=0,name=hostnet0 +-net user,vlan=0,name=hostnet0 \ +-device virtio-net-pci,vlan=1,id=net1,mac=52:54:00:09:a4:38,bus=pci.2,addr=0x1 \ +-net user,vlan=1,name=hostnet1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml index 6a44f19..bf0f249 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml @@ -39,5 +39,10 @@ <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </interface> + <interface type='user'> + <mac address='52:54:00:09:a4:38'/> + <model type='virtio'/> + <address type='pci'/> + </interface> </devices> </domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml index 0d69169..4fdedac 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml @@ -50,5 +50,10 @@ <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </interface> + <interface type='user'> + <mac address='52:54:00:09:a4:38'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </interface> </devices> </domain> -- 2.7.4
participants (2)
-
Cole Robinson
-
Peter Krempa