From nobody Thu Nov 28 16:32:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521099419539938.481700011771; Thu, 15 Mar 2018 00:36:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1435F80083; Thu, 15 Mar 2018 07:36:58 +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 BFFA060A9E; Thu, 15 Mar 2018 07:36:57 +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 859C14CAAF; Thu, 15 Mar 2018 07:36:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2EHGnNe024289 for ; Wed, 14 Mar 2018 13:17:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id A71CB5C552; Wed, 14 Mar 2018 17:16:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D6CA5C542 for ; Wed, 14 Mar 2018 17:16:47 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9087D3EA6C2 for ; Wed, 14 Mar 2018 17:16:46 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2EHEBj0032654 for ; Wed, 14 Mar 2018 13:16:46 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gq7172ncw-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 14 Mar 2018 13:16:45 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Mar 2018 17:16:43 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Mar 2018 17:16:41 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2EHGfWq53018706 for ; Wed, 14 Mar 2018 17:16:41 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4524C52043 for ; Wed, 14 Mar 2018 16:08:11 +0000 (GMT) Received: from localhost.localdomain (unknown [9.79.182.166]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id AD5BE5203F for ; Wed, 14 Mar 2018 16:08:10 +0000 (GMT) From: Shivaprasad G Bhat To: libvir-list@redhat.com Date: Wed, 14 Mar 2018 22:46:39 +0530 In-Reply-To: <152104711186.10112.1077788328340024644.stgit@localhost.localdomain> References: <152104711186.10112.1077788328340024644.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18031417-0040-0000-0000-0000044078C8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031417-0041-0000-0000-000020E37E90 Message-Id: <152104779126.10112.368308401648522270.stgit@localhost.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-14_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803140192 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 14 Mar 2018 17:16:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 14 Mar 2018 17:16:46 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'sbhat@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 04/28] virpcitest: Change the stub driver to vfio from pci-stub 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 15 Mar 2018 07:36:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The pci-stub is obsolete for a while now. Upcoming test cases try to test the VFIO hotplug/unplug cases. Change the default test driver to vfio-pci instead of pci-stub, and fail bind for pci-stub instead. Signed-off-by: Shivaprasad G Bhat --- tests/virhostdevtest.c | 8 ++++---- tests/virpcimock.c | 5 ++--- tests/virpcitest.c | 12 ++++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index e4fee567a2..41062ebf3c 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -97,7 +97,7 @@ myInit(void) subsys.u.pci.addr.bus =3D 0; subsys.u.pci.addr.slot =3D i + 1; subsys.u.pci.addr.function =3D 0; - subsys.u.pci.backend =3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM; + subsys.u.pci.backend =3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO; hostdevs[i]->source.subsys =3D subsys; } =20 @@ -105,7 +105,7 @@ myInit(void) if (!(dev[i] =3D virPCIDeviceNew(0, 0, i + 1, 0))) goto cleanup; =20 - virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_KVM); + virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO); } =20 if (VIR_ALLOC(mgr) < 0) @@ -485,7 +485,7 @@ testVirHostdevRoundtripManaged(const void *opaque ATTRI= BUTE_UNUSED) { int ret =3D -1; =20 - if (virHostdevHostSupportsPassthroughKVM()) { + if (virHostdevHostSupportsPassthroughVFIO()) { if (testVirHostdevPreparePCIHostdevs_managed(false) < 0) goto out; if (testVirHostdevReAttachPCIHostdevs_managed(false) < 0) @@ -517,7 +517,7 @@ testVirHostdevRoundtripMixed(const void *opaque ATTRIBU= TE_UNUSED) =20 if (testVirHostdevDetachPCINodeDevice() < 0) goto out; - if (virHostdevHostSupportsPassthroughKVM()) { + if (virHostdevHostSupportsPassthroughVFIO()) { if (testVirHostdevPreparePCIHostdevs_managed(true) < 0) goto out; if (testVirHostdevReAttachPCIHostdevs_managed(true) < 0) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 22adc740b8..c9b7434c9a 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -982,9 +982,8 @@ init_env(void) =20 MAKE_PCI_DRIVER("iwlwifi", 0x8086, 0x0044); MAKE_PCI_DRIVER("i915", 0x8086, 0x0046, 0x8086, 0x0047); - MAKE_PCI_DRIVER("pci-stub", -1, -1); - pci_driver_new("vfio-pci", PCI_ACTION_BIND, -1, -1); - + pci_driver_new("pci-stub", PCI_ACTION_BIND, -1, -1); + MAKE_PCI_DRIVER("vfio-pci", -1, -1); =20 # define MAKE_PCI_DEVICE(Id, Vendor, Device, ...) \ do { \ diff --git a/tests/virpcitest.c b/tests/virpcitest.c index 80e994ae52..fa7acb85a2 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -110,12 +110,12 @@ testVirPCIDeviceDetach(const void *opaque ATTRIBUTE_U= NUSED) if (!(dev[i] =3D virPCIDeviceNew(0, 0, i + 1, 0))) goto cleanup; =20 - virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_KVM); + virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO); =20 if (virPCIDeviceDetach(dev[i], activeDevs, inactiveDevs) < 0) goto cleanup; =20 - if (testVirPCIDeviceCheckDriver(dev[i], "pci-stub") < 0) + if (testVirPCIDeviceCheckDriver(dev[i], "vfio-pci") < 0) goto cleanup; =20 CHECK_LIST_COUNT(activeDevs, 0); @@ -249,7 +249,7 @@ testVirPCIDeviceDetachSingle(const void *opaque) if (!dev) goto cleanup; =20 - virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_KVM); + virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_VFIO); =20 if (virPCIDeviceDetach(dev, NULL, NULL) < 0) goto cleanup; @@ -271,7 +271,7 @@ testVirPCIDeviceDetachFail(const void *opaque) if (!dev) goto cleanup; =20 - virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_VFIO); + virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_KVM); =20 if (virPCIDeviceDetach(dev, NULL, NULL) < 0) { if (virTestGetVerbose() || virTestGetDebug()) @@ -282,7 +282,7 @@ testVirPCIDeviceDetachFail(const void *opaque) virReportError(VIR_ERR_INTERNAL_ERROR, "Attaching device %s to %s should have failed", virPCIDeviceGetName(dev), - virPCIStubDriverTypeToString(VIR_PCI_STUB_DRIVER_VF= IO)); + virPCIStubDriverTypeToString(VIR_PCI_STUB_DRIVER_KV= M)); } =20 cleanup: @@ -441,7 +441,7 @@ mymain(void) /* Detach an unbound device */ DO_TEST_PCI_DRIVER(0, 0x0a, 2, 0, NULL); DO_TEST_PCI(testVirPCIDeviceDetachSingle, 0, 0x0a, 2, 0); - DO_TEST_PCI_DRIVER(0, 0x0a, 2, 0, "pci-stub"); + DO_TEST_PCI_DRIVER(0, 0x0a, 2, 0, "vfio-pci"); =20 /* Reattach an unknown unbound device */ DO_TEST_PCI_DRIVER(0, 0x0a, 3, 0, NULL); -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list