From nobody Mon Feb 9 07:43: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=1558448791; cv=none; d=zoho.com; s=zohoarc; b=KS6eVi6vQBwNKudvUtCU16buIhLPHMqmzHUrGuOCNI9znRi9keoGpCuoreguBwko2MdqTJ1ziNsDTH/SF3foHmDwgztYswXk2XAy1JUIzI0mGSlTrzIG63f4Ars245qcH5kcyWTjjThlgoEMnKoYuzKqpQHI0kzXljthi3wACF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558448791; 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=0sHZUWf9dJ79nhzLVkrqUZEe8jq4/PCKdwVS/IPUMIM=; b=FuOGSv/RC25Nsq2U4ROnHXsharEfHtI+AzaCLLdtM4vr7dJgQ/p/PV08WRceyAXalLEVsH7TTnG1Yy6WO2eFSG4IP7q8Oq/AhVPTfr9j43tUIjBvCbEa0NoxZuSjVfPyUPje3NGyB9g5Nw6CZ0DyNXVCE9V0zzJbbt077dBC1K4= 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 1558448791062875.5170970248349; Tue, 21 May 2019 07:26:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D79CE3007149; Tue, 21 May 2019 14:26:15 +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 A97B31017E36; Tue, 21 May 2019 14:26:11 +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 6278A5B428; Tue, 21 May 2019 14:26:09 +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 x4LEQ7Cd011950 for ; Tue, 21 May 2019 10:26:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9334C66846; Tue, 21 May 2019 14:26:07 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BD4F66842 for ; Tue, 21 May 2019 14:26:06 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 21 May 2019 16:26:00 +0200 Message-Id: <0377e5660aa7310b0e63f1331f7b884588414260.1558448715.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] Introduce DOMAIN_DEVICE_ITERATE_MISSING_INFO 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 21 May 2019 14:26:29 +0000 (UTC) Rename the DOMAIN_DEVICE_ITERATE_GRAPHICS flag. It was introduced by commit dd45c2710f6fd2d4f8a47f97960532d0e0091e7d with the intention to run the Validate callback even on the graphics device. However, enumerating every single device in virDomainDeviceIterateFlags is unsustainable and what really was special about the graphics device was the lack of DeviceInfo. Rename the flag and iterate over more info-less devices. (and leases) Signed-off-by: J=C3=A1n Tomko Inspired-by: Andrea Bolognani --- src/conf/domain_conf.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fb1256f640..0fe440a2cf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4077,7 +4077,7 @@ virDomainSkipBackcompatConsole(virDomainDefPtr def, =20 enum { DOMAIN_DEVICE_ITERATE_ALL_CONSOLES =3D 1 << 0, - DOMAIN_DEVICE_ITERATE_GRAPHICS =3D 1 << 1 + DOMAIN_DEVICE_ITERATE_MISSING_INFO =3D 1 << 1, } virDomainDeviceIterateFlags; =20 /* @@ -4243,15 +4243,26 @@ virDomainDeviceInfoIterateInternal(virDomainDefPtr = def, return rc; } =20 - /* If the flag below is set, make sure @cb can handle @info being NULL= , as - * graphics don't have any boot info */ - if (iteratorFlags & DOMAIN_DEVICE_ITERATE_GRAPHICS) { + /* If the flag below is set, make sure @cb can handle @info being NULL= */ + if (iteratorFlags & DOMAIN_DEVICE_ITERATE_MISSING_INFO) { device.type =3D VIR_DOMAIN_DEVICE_GRAPHICS; for (i =3D 0; i < def->ngraphics; i++) { device.data.graphics =3D def->graphics[i]; if ((rc =3D cb(def, &device, NULL, opaque)) !=3D 0) return rc; } + device.type =3D VIR_DOMAIN_DEVICE_LEASE; + for (i =3D 0; i < def->nleases; i++) { + device.data.lease =3D def->leases[i]; + if ((rc =3D cb(def, &device, NULL, opaque)) !=3D 0) + return rc; + } + device.type =3D VIR_DOMAIN_DEVICE_IOMMU; + if (def->iommu) { + device.data.iommu =3D def->iommu; + if ((rc =3D cb(def, &device, NULL, opaque)) !=3D 0) + return rc; + } } =20 /* Coverity is not very happy with this - all dead_error_condition */ @@ -4305,7 +4316,7 @@ virDomainDeviceIterate(virDomainDefPtr def, return virDomainDeviceInfoIterateInternal(def, cb, DOMAIN_DEVICE_ITERATE_ALL_CO= NSOLES | - DOMAIN_DEVICE_ITERATE_GRAPHI= CS, + DOMAIN_DEVICE_ITERATE_MISSIN= G_INFO, opaque); } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list