From nobody Sun Feb 8 21:41:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682332926; cv=none; d=zohomail.com; s=zohoarc; b=QzqHIsc4L2YxF0nt0IhrZXYXflCPKDtvNyBvRqEZABAHXWLzMIt6rdaM7qnLxcjDJbpQa5YAngDiDr3OI8+XJ+O2+T1B0MpmIMY+stAu2TXJ1SZ568in8n5oYPq1mCRckuYo3UfSTV11K3rav6lAMtUQN49wqK77rTCt1H5t8iE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682332926; h=Content-Type:Content-Transfer-Encoding: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=HREV4OIoBoVBo6ci4OdLpR8oo7hoVO8AaOIkmhm64CE=; b=BkVwfoA8DhOCusvUpq7dKIQN0eNihywB6Wme4zIiiFDnloxtHhc0un7C8QGDVTZSfOcfThb2kA3bvJ417NcfC0knsjPNcu662nwfbi7+k1jgh3T9duYEO5xS8INPTIiQDNlS3/a1kb14sQd1k3KlkQhuw7LZ/9Xy1jfBA5mNMpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1682332926911205.2988574957477; Mon, 24 Apr 2023 03:42:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-P5Vb__NOPDKtfYAuWfkBRg-1; Mon, 24 Apr 2023 06:42:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4F81185A79C; Mon, 24 Apr 2023 10:41:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2A972022ECD; Mon, 24 Apr 2023 10:41:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 62C1D19465A3; Mon, 24 Apr 2023 10:41:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D0C5F1946A4A for ; Mon, 24 Apr 2023 10:41:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B76501121318; Mon, 24 Apr 2023 10:41:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EEB11121319 for ; Mon, 24 Apr 2023 10:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682332925; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=HREV4OIoBoVBo6ci4OdLpR8oo7hoVO8AaOIkmhm64CE=; b=DUFwOe0RVhTaFIDT/6U3SwQevLfEX3nqNXCvcf65Za2oX0Y57nECmfaSQybehdOR284g7j i0h+2Gdz27zN+F3eAXF51krDpZEAgnq7v5WhwXM1D0gs3xMBAvlNcDiZkW+lzC+EGUAEKh BlpuGHAtG6rZvZt2xvjBICOOW0cBMWU= X-MC-Unique: P5Vb__NOPDKtfYAuWfkBRg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 5/9] qemu: Deny all but VFIO PCI backends in hostdev prepare phase Date: Mon, 24 Apr 2023 12:41:44 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682332927428100011 Content-Type: text/plain; charset="utf-8"; x-default="true" We used to support KVM and VFIO style of PCI assignment. The former was dropped in v5.7.0-rc1~103 and thus we only support VFIO. All other backends lead to an error (see qemuBuildPCIHostdevDevProps(), or qemuBuildPCIHostdevDevStr() as it used to be called in the era of aforementioned commit). Might as well report the error in prepare phase and save hassle of proceeding with device preparation (e.g. in case of hotplug overriding the device's driver, setting seclabels, etc.). Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/qemu/qemu_domain.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 58cd3dd710..72f36c807b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11326,12 +11326,11 @@ qemuDomainPrepareHostdevPCI(virDomainHostdevDef *= hostdev, break; =20 case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("host doesn't support legacy PCI passthrough")); - return false; - case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN: case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid PCI passthrough type '%1$s'"), + virDomainHostdevSubsysPCIBackendTypeToString(*backe= nd)); break; } =20 --=20 2.39.2