From nobody Sun Feb 8 09:30:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1576849655; cv=none; d=zohomail.com; s=zohoarc; b=dNwjazqAzihFAZgTsMTOOflcYnnfHN0mRs0Wtdrvyc6LhPxkBXanXMOYqxENRkWymkeFazxN/G4Z1xNobb8nJdfdGTPVGcfKCIbMEwunmentK8bYdyxy/TuccFkghnPm2Bk8CVDvnDNkVgk7vDxoQnBoPI5Rhc9CUmprD84LtRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576849655; 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=L6LaIHvGFtah+YAcAyqEA0+avj42AsjLKOJRQ/7BUDc=; b=UwFCTThzbnKot7kvK84qZsGT+EeYfZnBnk8jIsf9DWYapEZ5UiQ8+k/fQGScv7MEvBOAJKrv4g7JeNZXmzgx1xjoSRtkMYh4bq8LCiKgRmb2pOQBvwzhiER2XInchReI9vp8SHLUYR08gT0NN2++Av2rigz3CLZ8r+x6pExFITo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576849655925827.0424014599894; Fri, 20 Dec 2019 05:47:35 -0800 (PST) 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-45-W0_r6_X5N7OlNfHKz3EWPw-1; Fri, 20 Dec 2019 08:47:33 -0500 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 13D571083E9B; Fri, 20 Dec 2019 13:47:27 +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 B09FF6B8E5; Fri, 20 Dec 2019 13:47:26 +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 1A0B118089CD; Fri, 20 Dec 2019 13:47:26 +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 xBKDl4kt029873 for ; Fri, 20 Dec 2019 08:47:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5E4915C7DD; Fri, 20 Dec 2019 13:47:04 +0000 (UTC) Received: from dhcp-16-105.lcy.redhat.com (unknown [10.42.16.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2DE163B89; Fri, 20 Dec 2019 13:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576849654; 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=L6LaIHvGFtah+YAcAyqEA0+avj42AsjLKOJRQ/7BUDc=; b=cGLJM4RNoT8oca1ImWKJGFs1k9M+BUK8aTVvYfyPUYUUgVh/3ND5M1gwNPYTlP7dPATCV3 b/+BHOoU0JYsjEZLnX7Bqg0P4U9PPF64davghyqnDe3S9DFMv2cIg+0RyHl2FNScmsnm56 jx+pU3shwEZixMsGk82wS+kxtudHDiQ= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 13:47:01 +0000 Message-Id: <20191220134703.2164946-2-berrange@redhat.com> In-Reply-To: <20191220134703.2164946-1-berrange@redhat.com> References: <20191220134703.2164946-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/3] qemu: add explicit flag to skip qemu caps invalidation 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 X-MC-Unique: W0_r6_X5N7OlNfHKz3EWPw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Currently if the binary path is NULL in the qemu capabilities object, cache invalidation is skipped. A future patch will ensure that the binary path is always non-NULL, so a way to explicitly skip invalidation is required. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 14 ++++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2223589058..cc6d9bbd44 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -612,6 +612,7 @@ struct _virQEMUCaps { char *binary; time_t ctime; time_t libvirtCtime; + bool invalidation; =20 virBitmapPtr flags; =20 @@ -1633,6 +1634,7 @@ virQEMUCapsNew(void) if (!(qemuCaps =3D virObjectNew(virQEMUCapsClass))) return NULL; =20 + qemuCaps->invalidation =3D true; if (!(qemuCaps->flags =3D virBitmapNew(QEMU_CAPS_LAST))) goto error; =20 @@ -1647,6 +1649,14 @@ virQEMUCapsNew(void) } =20 =20 +void +virQEMUCapsSetInvalidation(virQEMUCapsPtr qemuCaps, + bool enabled) +{ + qemuCaps->invalidation =3D enabled; +} + + static int virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst, virQEMUCapsHostCPUDataPtr src) @@ -1746,6 +1756,7 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemu= Caps) if (!ret) return NULL; =20 + ret->invalidation =3D qemuCaps->invalidation; ret->usedQMP =3D qemuCaps->usedQMP; ret->kvmSupportsNesting =3D qemuCaps->kvmSupportsNesting; =20 @@ -4423,6 +4434,9 @@ virQEMUCapsIsValid(void *data, struct stat sb; bool kvmSupportsNesting; =20 + if (!qemuCaps->invalidation) + return true; + if (!qemuCaps->binary) return true; =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1b2522126c..7488b9ddb8 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -545,6 +545,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUCaps, virObjectUnr= ef); =20 virQEMUCapsPtr virQEMUCapsNew(void); =20 +void virQEMUCapsSetInvalidation(virQEMUCapsPtr qemuCaps, + bool enabled); + void virQEMUCapsSet(virQEMUCapsPtr qemuCaps, virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list