From nobody Mon Feb 9 23:42:54 2026 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558352301; cv=none; d=zoho.com; s=zohoarc; b=h6uLasorzQtQlYEeOTLcDvhhv0S9vNV0muG+eq/YkkWsLv0yL01EOLn1cbcKU6hn6q3jFiIfvpjhxPnldkdqZNeZuw2w1pmhiIbOaVpitrP3JzqOMgIIU/I3kPfoTeb4VefWqcaFMcj8orNFli1h0lEAmjg4qDpKEKc+QP21I6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558352301; 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:ARC-Authentication-Results; bh=TJ/QlA9X6Y5k1oT7qgjNBcI/2FoaF0503w2DdXzRUH8=; b=G4p6zOIKNq4neiS5IlYatbVMRGD+tIDx5a6Mlny2E+NzpHV9iOYxkmJE5R8WqZ8G3f/nNzxGUbkmi79f/Sw+kBX1r12B3SKD4M2EVu/wJHCc4mTEL/AEVFcl/6ikbYwvCD0SG+SM0OMuct2BtLYkmil/FL+meexEfyDcXYs7HkI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558352301277851.6888175725825; Mon, 20 May 2019 04:38:21 -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 D0571308125C; Mon, 20 May 2019 11:38:19 +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 AB8F778376; Mon, 20 May 2019 11:38:19 +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 6E8B91806B1F; Mon, 20 May 2019 11:38:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4KBc8k5019692 for ; Mon, 20 May 2019 07:38:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 176DD5D9D1; Mon, 20 May 2019 11:38:08 +0000 (UTC) Received: from kinshicho.redhat.com (ovpn-204-17.brq.redhat.com [10.40.204.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70EF85D967 for ; Mon, 20 May 2019 11:38:07 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 20 May 2019 13:37:53 +0200 Message-Id: <20190520113753.12345-9-abologna@redhat.com> In-Reply-To: <20190520113753.12345-1-abologna@redhat.com> References: <20190520113753.12345-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/8] qemu: Tweak Intel IOMMU command line generation 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.49]); Mon, 20 May 2019 11:38:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Mostly add comments explaining why there are two capabilites for the same feature and how they interact. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e16c748d31..73f570c419 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6935,8 +6935,12 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, if (!iommu) return 0; =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) - return 0; /* Already handled via -machine */ + /* qemuDomainDeviceDefValidate() already made sure we have one of + * QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU: here we + * handle the former case, while the latter is taken care of in + * qemuBuildMachineCommandLine() */ + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU)) + return 0; =20 switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_INTEL: @@ -7594,7 +7598,10 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } } =20 - /* We don't report errors on missing cap here - -device code will do t= hat */ + /* qemuDomainDeviceDefValidate() already made sure we have one of + * QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU: here we + * handle the latter case, while the former is taken care of in + * qemuBuildIOMMUCommandLine() */ if (def->iommu && virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) { switch (def->iommu->model) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list