From nobody Sun Feb 8 13:09:32 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 ARC-Seal: i=1; a=rsa-sha256; t=1590009162; cv=none; d=zohomail.com; s=zohoarc; b=FoRmltRpNXNtStVxoRejeRngU2/UREl4EwnrYTwOEBYLhBrD/pz1EDqQ3AfRJJ+vUu3TuwdHC/XY5kqc6uUrbzfKTEupA4DWH+S/VXfwn6D85RGfG/N/laHLgzEpx/YBGwqc/7RW6I50HqLFOm5f38b3nYVvgtEJ+00/Mh6Pk/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590009162; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=d38x1/1Cl1Qccrx7vhQM4LXsQcfdwz0bmB42n9Lbh0Q=; b=fNxvHHu2TJBKCrn58BhyNKPS4H/BZbdhGALr0/21a4zCRHspQZ8eTrpYeDIXVl4EEzFzQy6aItsnEjkIuBV/lRyPt64MJIj6NBb7yaU/FaCP7FFdjkyqv+SaJvAvcJa2vI8R/IlN+6TdpmY4kXPdWcKokBGwVeqNKTc2ihg53AE= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= 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 1590009162950971.235271170148; Wed, 20 May 2020 14:12:42 -0700 (PDT) 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-328-YKrne5LoPoeznRpLuIfYBA-1; Wed, 20 May 2020 17:12:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4DF483631B; Wed, 20 May 2020 21:12:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 286695D9CC; Wed, 20 May 2020 21:12:30 +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 E0E8A1809563; Wed, 20 May 2020 21:12:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04KLCHA6002050 for ; Wed, 20 May 2020 17:12:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 779F410031E4; Wed, 20 May 2020 21:12:17 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56D151007A45 for ; Wed, 20 May 2020 21:12:17 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 B87CD811E7A for ; Wed, 20 May 2020 21:12:16 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-o3BVGmVvOQi6UNtsY1NDmw-1; Wed, 20 May 2020 17:12:13 -0400 Received: by mail-qk1-f196.google.com with SMTP id i14so5112459qka.10 for ; Wed, 20 May 2020 14:12:12 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:fbf2:bc5e:c314:af31:7070]) by smtp.gmail.com with ESMTPSA id z14sm2992031qki.83.2020.05.20.14.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 14:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590009161; 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=d38x1/1Cl1Qccrx7vhQM4LXsQcfdwz0bmB42n9Lbh0Q=; b=Reuu+jqv0+L2pFiXwe8cQiMqApuLEzqx/Pe0fms68/y01GUiv+r9O3U4sBlPlJPB9Lcu2s M2a7KzOenY7y820BU+LN7y/Rtr/ydQP+vc+YGYUEE09KwH5eahkQXI1MTwEoI9eoZayuSs NbdJPnzDz0H4AU/++5785VWqDPgVQ9U= X-MC-Unique: YKrne5LoPoeznRpLuIfYBA-1 X-MC-Unique: o3BVGmVvOQi6UNtsY1NDmw-1 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=d38x1/1Cl1Qccrx7vhQM4LXsQcfdwz0bmB42n9Lbh0Q=; b=srytsSFGNHjPTKCtE2jvwnhB71l+C8qOKoMNCZRPXqKFRpaiz4JuP4aDUoaVdsFKe1 EjvZ7TMpoYOwA2qq9FAMRcpiPLMwdTxbW5TSy3Of0x/VIlLBm29cbfJmZmH/ptSrtNIG E2otiy69/XHvEeB9CX01k6akRW14Hv6eMQmlmI1LWnINsHcZ56k4t1ZLXS3kF9ymFIve jGp86iQYRCIJzrN8ebygnAdBv7AN/Jktl5IHJfChVJu5V7SAurkEVX0u7Afx0L1j+8eF /+8qQeVu6YOqq9Ac04sqOB0ZYkgm1sNo3vaUdv8uWnpthvrOAUo+CFCn+GJC9Kea0vl6 Sutg== X-Gm-Message-State: AOAM533qAU2+KxbdWswZrM4fSOy6m8+NW+UJiqOSTysv8LrR/NhqEYvl vtzlGeVibr7oJrqJ2LOKule5DHiH X-Google-Smtp-Source: ABdhPJyF0e4cbB0GJFb4yApmTBTyX/f/7nfcuTzGkrOJXt9tj8ZCmiHgCx8lOYhI6DKemXjKXTrIeQ== X-Received: by 2002:a37:9dc2:: with SMTP id g185mr4030952qke.102.1590009131912; Wed, 20 May 2020 14:12:11 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 04/21] qemu: address: Enable auto addressing multifunction cards Date: Wed, 20 May 2020 18:11:26 -0300 Message-Id: <20200520211143.2980117-5-danielhb413@gmail.com> In-Reply-To: <20200520211143.2980117-1-danielhb413@gmail.com> References: <20200520211143.2980117-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.79 on 10.5.11.14 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 | 150 +++++++++++++++++- 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, 206 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 41d3f1561d..b601d52126 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -636,6 +636,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 f86c85eaa9..f431f4bb15 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1420,11 +1420,136 @@ 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 assigned 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, + qemuDomainDefHostdevGe= tSlotAggregateIdx); + + 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; @@ -1437,6 +1562,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; @@ -2379,10 +2510,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 && @@ -2396,9 +2529,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 ba3fc4d814..57f64d191c 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -89,6 +89,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SPICE_FILE_XFER_DISABLE); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_BLOCK); + 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 4f613e8f1a..df11669cd5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1442,7 +1442,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, @@ -2033,14 +2034,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.26.2