From nobody Sun Feb 8 12:18:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1580402754995363.6668475619076; Thu, 30 Jan 2020 08:45:54 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-82-vSN8KUuEMi-w8B6MWrOqwA-1; Thu, 30 Jan 2020 11:45:50 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39E321034B21; Thu, 30 Jan 2020 16:45:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D791CFE0; Thu, 30 Jan 2020 16:45:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B453C87A9E; Thu, 30 Jan 2020 16:45:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00UGjELB031992 for ; Thu, 30 Jan 2020 11:45:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0726F2166B29; Thu, 30 Jan 2020 16:45:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 027392166B27 for ; Thu, 30 Jan 2020 16:45:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C73458047C4 for ; Thu, 30 Jan 2020 16:45:13 +0000 (UTC) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-57-jHEjQAdROiu6goP6UK5oOg-1; Thu, 30 Jan 2020 11:45:06 -0500 Received: by mail-qv1-f68.google.com with SMTP id u10so1813441qvi.2 for ; Thu, 30 Jan 2020 08:44:56 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:c177:887c:ce1b:6a44:15ec]) by smtp.gmail.com with ESMTPSA id 135sm3007157qkj.55.2020.01.30.08.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 08:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580402753; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Us6DVtGaAaD9e0ndZaAL8o//DSCquJwXpGTjovb6qN4=; b=BX7md3NUXiZ67ljdJ8vX8sP5zW8at057kEXWa4Lv8CFOA4QO79u9P/b9f7XhkH6UGdBD+V YIgMHsNHf86mUHgJY/wLD3GhSnowqmSLGt+qxSVzkhhoqgmtt9pBNNpySKVIlwekCD7JRq maZBKsDE1EDmTuwtv165kJr9lcRXoGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D4P3SI2kxVJkL90+eM+IrEk7Ja3wgBe2OKFppA8wTdQ=; b=csy8NhZFZgIAebzgxP27QYQLm41h9ttrYSvmRx58tM6ILdcyzF6uwb2KCtgBw+L7dF RmyjIAT4LFEz1Sfm4l4R7dI4rZZxv78Q/31tQAgsb2Rpbc3Hlz7Q0cpVla2X8l6v4bbq msHM+W2Joj+/SIuxHg+oRG6qJRQw48Sc486cAGAtJH4sa0bz6mp6YJq1zWyi94rvr5eC P2chP0OhKu8rvfknwdMdQzuibuUrPk2NENln8MQWlcIhEiD9uAJIO7iy1FfPVigkrEQI Ns0VuRO++DSDVO9fh8bkXPPoh1KlLe2+QKBKojp/MJh68PMURP9wv1L/5FNY5qjONgXk jU0A== X-Gm-Message-State: APjAAAXpJW7hd8s+LH1rC/ffkgg/Hi7whRiRO2n1dbZxyGBRHP2ESQdA yaz70hZ61ZPj8AaKHTLspUkC5tl4t6c= X-Google-Smtp-Source: APXvYqw5oF6h4YojZzU6hIYv/amUbqdDEB73esNEk2bAuMdSfXb3H9AQbXdYxejIqHdVliJmlMH2oQ== X-Received: by 2002:ad4:4f90:: with SMTP id em16mr1849178qvb.38.1580402695392; Thu, 30 Jan 2020 08:44:55 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 04/21] qemu: address: Enable auto addressing multifunction cards Date: Thu, 30 Jan 2020 13:44:16 -0300 Message-Id: <20200130164433.2694119-5-danielhb413@gmail.com> In-Reply-To: <20200130164433.2694119-1-danielhb413@gmail.com> References: <20200130164433.2694119-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: jHEjQAdROiu6goP6UK5oOg-1 X-MC-Unique: vSN8KUuEMi-w8B6MWrOqwA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00UGjELB031992 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , sbhat@linux.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Shivaprasad G Bhat For existing domains using the primary function alone of a multifunction card, the card is still treated as a multifunction card. This is done to prevent hotplug of other functions when the primary function is already hotplugged. If the secondary functions are part of the xml without the primary function being part of the xml, this has never been supported. So, Libvirt doesn't consider this either as a multifunction card. Since we're now checking PCI headers via virHostdevIsPCIMultifunctionDevice(), changes in virpcitestdata files were required to allow the test suit to recognize the 0005:90:01.N test device as multifunction. Signed-off-by: Shivaprasad G Bhat Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.h | 11 ++ src/qemu/qemu_domain_address.c | 148 +++++++++++++++++- tests/qemuhotplugtest.c | 1 + .../hostdev-pci-address-unassigned.args | 9 +- .../hostdev-pci-multifunction.args | 18 ++- .../hostdev-pci-multifunction.xml | 8 +- .../qemuxml2argvdata/pseries-hostdevs-1.args | 5 +- .../qemuxml2argvdata/pseries-hostdevs-3.args | 5 +- tests/qemuxml2argvtest.c | 6 +- .../hostdev-pci-address-unassigned.xml | 8 +- .../hostdev-pci-multifunction.xml | 24 +-- .../qemuxml2xmloutdata/pseries-hostdevs-1.xml | 4 +- .../qemuxml2xmloutdata/pseries-hostdevs-3.xml | 4 +- tests/virpcitestdata/0005-90-01.1.config | Bin 256 -> 256 bytes tests/virpcitestdata/0005-90-01.2.config | Bin 256 -> 256 bytes tests/virpcitestdata/0005-90-01.3.config | Bin 0 -> 256 bytes 16 files changed, 204 insertions(+), 47 deletions(-) create mode 100644 tests/virpcitestdata/0005-90-01.3.config diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index c581b3a162..c54af16fa5 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -612,6 +612,17 @@ struct _qemuDomainSaveCookie { =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainSaveCookie, virObjectUnref); =20 +typedef struct _qemuDomainPCIHostdevdata qemuDomainPCIHostdevdata; +typedef qemuDomainPCIHostdevdata *qemuDomainPCIHostdevDataPtr; +struct _qemuDomainPCIHostdevdata { + const virDomainDef *def; + virDomainPCIAddressSetPtr addrs; + virDomainHostdevDefPtr device; +}; + +typedef int (*virDomainPCIHostdevCallback)(qemuDomainPCIHostdevDataPtr dat= a, + virDomainHostdevDefPtr hostdev); + typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef; typedef qemuDomainXmlNsDef *qemuDomainXmlNsDefPtr; struct _qemuDomainXmlNsDef { diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index bff81082ef..3fed22d720 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1409,11 +1409,134 @@ qemuDomainSetupIsolationGroups(virDomainDefPtr def) } =20 =20 +#define PCI_MAX_BRIDGE_NUMBER 0xff +#define PCI_MAX_DEVICES 32 + + +/** + * qemuDomainPCIHostDevicesIter: + * @data - The data->device is the one which is called-back with for + * each hostdev + * cb() - callback to be called for each hostdev + * Return : + * If the callback for any of the hostdev fails, the Iter returns + * with the return value for that callback. + * Zero on success. + */ +static +int qemuDomainPCIHostDevicesIter(qemuDomainPCIHostdevDataPtr data, + virDomainPCIHostdevCallback cb) +{ + size_t i; + int ret =3D -1; + + /* Iterate through the PCI Hostdevices, the Mdev source is of type + * UUID, so skip that. */ + for (i =3D 0; i < data->def->nhostdevs; i++) { + virDomainHostdevSubsysPtr subsys =3D &data->def->hostdevs[i]->sour= ce.subsys; + virDomainHostdevDefPtr hostdev =3D data->def->hostdevs[i]; + if (data->device =3D=3D hostdev) + continue; + if (data->def->hostdevs[i]->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBS= YS) + continue; + if (subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && + subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST && + (subsys->type =3D=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV && + subsys->u.mdev.model =3D=3D VIR_MDEV_MODEL_TYPE_VFIO_PCI)) { + continue; + } + + if ((ret =3D cb(data, hostdev)) !=3D 0) + return ret; + } + + return 0; +} + + + +static int +qemuDomainFindNextAggregationSlotIdxIter(virDomainDefPtr def G_GNUC_UNUSED, + virDomainDeviceDefPtr dev G_GNUC_= UNUSED, + virDomainDeviceInfoPtr info, + void *opaque) +{ + int *aggregationSlotIdx =3D opaque; + + if (info && info->aggregateSlotIdx =3D=3D *aggregationSlotIdx) + return -1; + + return 0; +} + + +static unsigned int +qemuDomainFindNextSlotAggregationIdx(virDomainDefPtr def) +{ + int aggregateSlotIdx =3D 2; + + while (aggregateSlotIdx < PCI_MAX_BRIDGE_NUMBER * PCI_MAX_DEVICES && + virDomainDeviceInfoIterate(def, + qemuDomainFindNextAggregationSlotIdx= Iter, + &aggregateSlotIdx) < 0) { + aggregateSlotIdx++; + } + + return aggregateSlotIdx; +} + + +static int +qemuDomainDefHostdevGetSlotAggregateIdx(qemuDomainPCIHostdevDataPtr data, + virDomainHostdevDefPtr hostdev) +{ + if (data->device && + virHostdevPCIDevicesBelongToSameSlot(data->device, hostdev)) { + if (hostdev->info->aggregateSlotIdx > 0) + return hostdev->info->aggregateSlotIdx; + } + + return 0; +} + +/** + * qemuDomainDefDeviceFindSlotAggregateIdx: + * @def : domain def + * @dev : Find the slot aggregate for the device if other + * functions are already part of the def and have + * a slot aggreate idx assigned. + * Return: + * -1: if not assigned. + * 0: If the device is not a hostdev or not a + * multifunction device. + * >0: If assinged a value; + **/ +int +qemuDomainDefDeviceFindSlotAggregateIdx(virDomainDefPtr def, + virDomainDeviceDefPtr dev) +{ + int aggregateSlotIdx =3D 0; + virDomainHostdevDefPtr hostdev =3D dev->data.hostdev; + qemuDomainPCIHostdevdata temp =3D {def, NULL, hostdev}; + + /* Only PCI host devices are subject to isolation */ + if (!virHostdevIsPCIMultifunctionDevice(hostdev)) + return 0; + + aggregateSlotIdx =3D qemuDomainPCIHostDevicesIter(&temp, qemuDomainDef= HostdevGetSlotAggregateIdx); + if (aggregateSlotIdx > 0) + return aggregateSlotIdx; + + return -1; +} + + void -qemuDomainSetDeviceSlotAggregateIdx(virDomainDefPtr def G_GNUC_UNUSED, +qemuDomainSetDeviceSlotAggregateIdx(virDomainDefPtr def, virDomainDeviceDefPtr dev) { virDomainDeviceInfoPtr info =3D virDomainDeviceGetInfo(dev); + int aggregateSlotIdx =3D 0; =20 if (!info) return; @@ -1426,6 +1549,12 @@ qemuDomainSetDeviceSlotAggregateIdx(virDomainDefPtr = def G_GNUC_UNUSED, cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT)= { info->aggregateSlotIdx =3D 1; } + } else if (dev->type =3D=3D VIR_DOMAIN_DEVICE_HOSTDEV) { + aggregateSlotIdx =3D qemuDomainDefDeviceFindSlotAggregateIdx(def, = dev); + if (aggregateSlotIdx > 0) + info->aggregateSlotIdx =3D aggregateSlotIdx; + else if (aggregateSlotIdx < 0) + info->aggregateSlotIdx =3D qemuDomainFindNextSlotAggregationId= x(def); } =20 return; @@ -2364,10 +2493,12 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, =20 /* Host PCI devices */ for (i =3D 0; i < def->nhostdevs; i++) { - virDomainHostdevSubsysPtr subsys =3D &def->hostdevs[i]->source.sub= sys; - if (!virDeviceInfoPCIAddressIsWanted(def->hostdevs[i]->info)) + int function =3D 0; + virDomainHostdevDefPtr hostdev =3D def->hostdevs[i]; + virDomainHostdevSubsysPtr subsys =3D &hostdev->source.subsys; + if (!virDeviceInfoPCIAddressIsWanted(hostdev->info)) continue; - if (def->hostdevs[i]->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) + if (hostdev->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) continue; if (subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST && @@ -2381,9 +2512,14 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED) continue; =20 - if (qemuDomainPCIAddressReserveNextAddr(addrs, - def->hostdevs[i]->info) < = 0) + if (hostdev->info->aggregateSlotIdx > 1) + function =3D hostdev->source.subsys.u.pci.addr.function; + + if (virDomainPCIAddressReserveNextAddr(addrs, hostdev->info, + hostdev->info->pciConnectFl= ags, + function) < 0) { return -1; + } } =20 /* memballoon. the qemu driver only accepts virtio memballoon devices = */ diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 6a3e61c54b..48284fdb3e 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -87,6 +87,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VNC); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SPICE); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY); =20 if (qemuTestCapsCacheInsert(driver.qemuCapsCache, priv->qemuCaps) < 0) return -1; diff --git a/tests/qemuxml2argvdata/hostdev-pci-address-unassigned.args b/t= ests/qemuxml2argvdata/hostdev-pci-address-unassigned.args index 42fae17444..8e031c0f1f 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-address-unassigned.args +++ b/tests/qemuxml2argvdata/hostdev-pci-address-unassigned.args @@ -25,7 +25,8 @@ server,nowait \ -no-shutdown \ -no-acpi \ -usb \ --device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ --device vfio-pci,host=3D0005:90:01.2,id=3Dhostdev2,bus=3Dpci.0,addr=3D0x4 \ --device vfio-pci,host=3D0005:90:01.3,id=3Dhostdev3,bus=3Dpci.0,addr=3D0x5 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x6 +-device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev0,bus=3Dpci.0,multifuncti= on=3Don,\ +addr=3D0x3 \ +-device vfio-pci,host=3D0005:90:01.2,id=3Dhostdev2,bus=3Dpci.0,addr=3D0x3.= 0x2 \ +-device vfio-pci,host=3D0005:90:01.3,id=3Dhostdev3,bus=3Dpci.0,addr=3D0x3.= 0x3 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/hostdev-pci-multifunction.args b/tests/= qemuxml2argvdata/hostdev-pci-multifunction.args index d8690c010b..3bf3629d48 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-multifunction.args +++ b/tests/qemuxml2argvdata/hostdev-pci-multifunction.args @@ -25,11 +25,13 @@ server,nowait \ -no-shutdown \ -no-acpi \ -usb \ --device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ --device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x4 \ --device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev2,bus=3Dpci.0,addr=3D0x5 \ --device vfio-pci,host=3D0005:90:01.2,id=3Dhostdev3,bus=3Dpci.0,addr=3D0x6 \ --device vfio-pci,host=3D0005:90:01.3,id=3Dhostdev4,bus=3Dpci.0,addr=3D0x7 \ --device vfio-pci,host=3D0000:06:12.1,id=3Dhostdev5,bus=3Dpci.0,addr=3D0x8 \ --device vfio-pci,host=3D0000:06:12.2,id=3Dhostdev6,bus=3Dpci.0,addr=3D0x9 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0xa +-device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev0,bus=3Dpci.0,multifuncti= on=3Don,\ +addr=3D0x3 \ +-device vfio-pci,host=3D0005:90:01.2,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x3.= 0x2 \ +-device vfio-pci,host=3D0005:90:01.3,id=3Dhostdev2,bus=3Dpci.0,addr=3D0x3.= 0x3 \ +-device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev3,bus=3Dpci.0,addr=3D0x4.= 0x1 \ +-device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev4,bus=3Dpci.0,multifuncti= on=3Don,\ +addr=3D0x4 \ +-device vfio-pci,host=3D0000:06:12.1,id=3Dhostdev5,bus=3Dpci.0,addr=3D0x5 \ +-device vfio-pci,host=3D0000:06:12.2,id=3Dhostdev6,bus=3Dpci.0,addr=3D0x6 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x7 diff --git a/tests/qemuxml2argvdata/hostdev-pci-multifunction.xml b/tests/q= emuxml2argvdata/hostdev-pci-multifunction.xml index 06c889c64d..a0af6c5a90 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-multifunction.xml +++ b/tests/qemuxml2argvdata/hostdev-pci-multifunction.xml @@ -22,25 +22,25 @@ -
+
-
+
-
+
-
+
diff --git a/tests/qemuxml2argvdata/pseries-hostdevs-1.args b/tests/qemuxml= 2argvdata/pseries-hostdevs-1.args index 51ec025dce..d745f5bae6 100644 --- a/tests/qemuxml2argvdata/pseries-hostdevs-1.args +++ b/tests/qemuxml2argvdata/pseries-hostdevs-1.args @@ -26,5 +26,6 @@ server,nowait \ -device spapr-pci-host-bridge,index=3D1,id=3Dpci.1 \ -device spapr-pci-host-bridge,index=3D2,id=3Dpci.2 \ -device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev0,bus=3Dpci.1.0,addr=3D0x= 1 \ --device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev1,bus=3Dpci.2.0,addr=3D0x= 1 \ --device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev2,bus=3Dpci.2.0,addr=3D0x2 +-device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev1,bus=3Dpci.2.0,multifunc= tion=3Don,\ +addr=3D0x1 \ +-device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev2,bus=3Dpci.2.0,addr=3D0x= 1.0x1 diff --git a/tests/qemuxml2argvdata/pseries-hostdevs-3.args b/tests/qemuxml= 2argvdata/pseries-hostdevs-3.args index 5820140065..d29b01f4d8 100644 --- a/tests/qemuxml2argvdata/pseries-hostdevs-3.args +++ b/tests/qemuxml2argvdata/pseries-hostdevs-3.args @@ -25,5 +25,6 @@ server,nowait \ -no-shutdown \ -device spapr-pci-host-bridge,index=3D1,id=3Dpci.1 \ -device spapr-pci-host-bridge,index=3D2,id=3Dpci.2 \ --device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev0,bus=3Dpci.2.0,addr=3D0x= 1 \ --device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev1,bus=3Dpci.2.0,addr=3D0x2 +-device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev0,bus=3Dpci.2.0,multifunc= tion=3Don,\ +addr=3D0x1 \ +-device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev1,bus=3Dpci.2.0,addr=3D0x= 1.0x1 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a36183bf34..dad03f1dec 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1334,7 +1334,8 @@ mymain(void) =20 DO_TEST("hostdev-pci-multifunction", QEMU_CAPS_KVM, - QEMU_CAPS_DEVICE_VFIO_PCI); + QEMU_CAPS_DEVICE_VFIO_PCI, + QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY); =20 DO_TEST("hostdev-pci-address-unassigned", QEMU_CAPS_KVM, @@ -1927,14 +1928,17 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI); DO_TEST("pseries-hostdevs-1", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + X_QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("pseries-hostdevs-2", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + X_QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST("pseries-hostdevs-3", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + X_QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); =20 diff --git a/tests/qemuxml2xmloutdata/hostdev-pci-address-unassigned.xml b/= tests/qemuxml2xmloutdata/hostdev-pci-address-unassigned.xml index 2341e8432b..d6c26c3252 100644 --- a/tests/qemuxml2xmloutdata/hostdev-pci-address-unassigned.xml +++ b/tests/qemuxml2xmloutdata/hostdev-pci-address-unassigned.xml @@ -28,7 +28,7 @@
-
+
@@ -42,17 +42,17 @@
-
+
-
+
-
+
diff --git a/tests/qemuxml2xmloutdata/hostdev-pci-multifunction.xml b/tests= /qemuxml2xmloutdata/hostdev-pci-multifunction.xml index 52ed86e305..c40b2130df 100644 --- a/tests/qemuxml2xmloutdata/hostdev-pci-multifunction.xml +++ b/tests/qemuxml2xmloutdata/hostdev-pci-multifunction.xml @@ -28,52 +28,52 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/tests/qemuxml2xmloutdata/pseries-hostdevs-1.xml b/tests/qemuxm= l2xmloutdata/pseries-hostdevs-1.xml index e77a060a38..c09588de9d 100644 --- a/tests/qemuxml2xmloutdata/pseries-hostdevs-1.xml +++ b/tests/qemuxml2xmloutdata/pseries-hostdevs-1.xml @@ -40,14 +40,14 @@
-
+
-
+
diff --git a/tests/qemuxml2xmloutdata/pseries-hostdevs-3.xml b/tests/qemuxm= l2xmloutdata/pseries-hostdevs-3.xml index f91959b805..f01adf6d25 100644 --- a/tests/qemuxml2xmloutdata/pseries-hostdevs-3.xml +++ b/tests/qemuxml2xmloutdata/pseries-hostdevs-3.xml @@ -32,14 +32,14 @@
-
+
-
+
diff --git a/tests/virpcitestdata/0005-90-01.1.config b/tests/virpcitestdat= a/0005-90-01.1.config index beee76534041a7020c08ae9ac03d9a349c6ea12e..a60599bd342d3ebcdc7b8367ca3= 6ad337f602fde 100644 GIT binary patch delta 44 ycmZo*YG4vE7BFRCV-R3+7GUOK;Amg~f~JXq5)*X<85t+qEn;Cc-jFjfPzC^<7YL>R delta 39 ucmZo*YG4vE7BFRCV-R3+7GUOK;9y{25MXGU7$`AON05CJ=3D!Q7z5RUfCHEW5{!&mj0{Y5Fz#TaS&cX3;ByxM DCDjDB literal 256 zcmXpOc)-BMAi%_;z|6zo!oa|wz|aIFu>xbDS`csmlR$!5K#7rosSd`)Mk^@TV-u#E T7_0Gy9FS#<5E~CbCCJ=3D!Q7z5RUfCHEW5{!&mj0{Y5Fz#TaS&cX3;ByxM DCDjDB literal 0 HcmV?d00001 --=20 2.24.1