From nobody Mon Feb 9 21:21:14 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=1634735034; cv=none; d=zohomail.com; s=zohoarc; b=GaLibiSN40bliC3x8fCdGOaoXumP9T84zLCGqgwaHP+Fn9UImvhgV69cL+df+QP8lj0uY7tbp1GHhFaX7C5kh/fZlg3fIKy0fh/nS9cIYogUxZeT7LcG0Gkke/Wu1KArzCmfBjbWRqH79BV5uH7G0r6w9nZGxl2AyQjL5PERJcg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634735034; 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=K34sOdPMWNf9ZOK4L9Xw+EP2744ThSB7a25dAW/2HfM=; b=De63gj2Sgw2nk0Dmv06MqMBUFWJAZC5ruhx7KmcMymUw6MmMSo8eD2awzaGQ2/ZjgvZMtZub0dfxYeh9sZxactSalBYTScpdhH0RwnHI2CFbQ3gzDhpF1Yiq0JaIuKpOdlm/3treQxYrwxu0lcmaHh2yEGdDc1TCyyUfm7TjiCE= 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 1634735034566392.7600896480193; Wed, 20 Oct 2021 06:03:54 -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-250-7q6NkyIxNt2uXCnAJ2kf8A-1; Wed, 20 Oct 2021 09:03:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57158879513; Wed, 20 Oct 2021 13:03:44 +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 35E70641A7; Wed, 20 Oct 2021 13:03:44 +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 F3AF84EA3A; Wed, 20 Oct 2021 13:03:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19KD3gFP029786 for ; Wed, 20 Oct 2021 09:03:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC2F61980E; Wed, 20 Oct 2021 13:03:42 +0000 (UTC) Received: from kinshicho.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.195.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3C9469C83 for ; Wed, 20 Oct 2021 13:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634735033; 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=K34sOdPMWNf9ZOK4L9Xw+EP2744ThSB7a25dAW/2HfM=; b=LElfhpOXKUGG9iNBDmU7XRXt4HriiCnxIrZGmQhGHTfUTQRx1uhCoH2ZWDR2rWBpzNiKhF BG3y3yuZwJ/UpsLR6bCopLWTUReDxzX7iSolz57BsLfxvyiMGoV1NBgbKwIbg7IhRCE6Nf pVPkBpVI2+8BHdxIogPCSEHGxOS6yVo= X-MC-Unique: 7q6NkyIxNt2uXCnAJ2kf8A-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v2 11/22] conf: Introduce virtio model for Date: Wed, 20 Oct 2021 15:02:46 +0200 Message-Id: <20211020130257.534296-12-abologna@redhat.com> In-Reply-To: <20211020130257.534296-1-abologna@redhat.com> References: <20211020130257.534296-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1634735048764100009 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 4 ++++ src/qemu/qemu_domain_address.c | 6 ++++++ src/qemu/qemu_validate.c | 3 +++ 6 files changed, 16 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 26990c4d6d..4d6bf906fb 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5415,6 +5415,7 @@ intel smmuv3 + virtio diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 15228d1e38..5102857d5e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1267,6 +1267,7 @@ VIR_ENUM_IMPL(virDomainIOMMUModel, VIR_DOMAIN_IOMMU_MODEL_LAST, "intel", "smmuv3", + "virtio", ); =20 VIR_ENUM_IMPL(virDomainVsockModel, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4624bad1f7..486f2f7a2e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2703,6 +2703,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSecDef, virDom= ainSecDefFree); typedef enum { VIR_DOMAIN_IOMMU_MODEL_INTEL, VIR_DOMAIN_IOMMU_MODEL_SMMUV3, + VIR_DOMAIN_IOMMU_MODEL_VIRTIO, =20 VIR_DOMAIN_IOMMU_MODEL_LAST } virDomainIOMMUModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 74e5bac7a2..41e487d056 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6564,6 +6564,9 @@ qemuBuildIOMMUCommandLine(virCommand *cmd, =20 return 0; =20 + case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: + break; + case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: /* There is no -device for SMMUv3, so nothing to be done here */ return 0; @@ -7159,6 +7162,7 @@ qemuBuildMachineCommandLine(virCommand *cmd, break; =20 case VIR_DOMAIN_IOMMU_MODEL_INTEL: + case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: /* These IOMMUs are formatted in qemuBuildIOMMUCommandLine */ break; =20 diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 733fa35444..e23de3bb83 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1003,6 +1003,9 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDev= iceDef *dev, =20 case VIR_DOMAIN_DEVICE_IOMMU: switch ((virDomainIOMMUModel) dev->data.iommu->model) { + case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: + return 0; + case VIR_DOMAIN_IOMMU_MODEL_INTEL: case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_LAST: @@ -2382,6 +2385,9 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, virDomainIOMMUDef *iommu =3D def->iommu; =20 switch ((virDomainIOMMUModel) iommu->model) { + case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: + break; + case VIR_DOMAIN_IOMMU_MODEL_INTEL: case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_LAST: diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3045e4b64b..bd4c7b2cd7 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4869,6 +4869,9 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMU= Def *iommu, } break; =20 + case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: + break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); --=20 2.31.1