From nobody Fri May 16 04:47:21 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1499690840819463.9499214496524; Mon, 10 Jul 2017 05:47:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 38E15C04B92B; Mon, 10 Jul 2017 12:47:19 +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 1332B757A9; Mon, 10 Jul 2017 12:47: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 AC87D281; Mon, 10 Jul 2017 12:47:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6ACl1aV024865 for ; Mon, 10 Jul 2017 08:47:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4D7D417A6B; Mon, 10 Jul 2017 12:47:01 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8BDC5C6A1 for ; Mon, 10 Jul 2017 12:47:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 38E15C04B92B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 38E15C04B92B From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 10 Jul 2017 14:46:45 +0200 Message-Id: <2e6721735499ac94daab6c0d55c54592d8353811.1499690733.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/11] qemu: move libvirt ctime and version check into virQEMUCapsIsValid 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: , MIME-Version: 1.0 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 10 Jul 2017 12:47:19 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8a2a73dc5b..4d8890aaaf 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4293,6 +4293,18 @@ virQEMUCapsIsValid(virQEMUCapsPtr qemuCaps, if (!qemuCaps->binary) return true; =20 + if (qemuCaps->libvirtCtime !=3D virGetSelfLastChanged() || + qemuCaps->libvirtVersion !=3D LIBVIR_VERSION_NUMBER) { + VIR_DEBUG("Outdated capabilities for '%s': libvirt changed " + "(%lld vs %lld, %lu vs %lu)", + qemuCaps->binary, + (long long)qemuCaps->libvirtCtime, + (long long)virGetSelfLastChanged(), + (unsigned long)qemuCaps->libvirtVersion, + (unsigned long)LIBVIR_VERSION_NUMBER); + return false; + } + if (!qemuctime) { struct stat sb; =20 @@ -4393,19 +4405,6 @@ virQEMUCapsInitCached(virCapsPtr caps, if (!virQEMUCapsIsValid(qemuCaps, qemuctime, runUid, runGid)) goto discard; =20 - /* Discard cache if QEMU binary or libvirtd changed */ - if (qemuCaps->libvirtCtime !=3D virGetSelfLastChanged() || - qemuCaps->libvirtVersion !=3D LIBVIR_VERSION_NUMBER) { - VIR_DEBUG("Outdated capabilities for '%s': libvirt changed " - "(%lld vs %lld, %lu vs %lu)", - qemuCaps->binary, - (long long)qemuCaps->libvirtCtime, - (long long)virGetSelfLastChanged(), - (unsigned long)qemuCaps->libvirtVersion, - (unsigned long)LIBVIR_VERSION_NUMBER); - goto discard; - } - VIR_DEBUG("Loaded '%s' for '%s' ctime %lld usedQMP=3D%d", capsfile, qemuCaps->binary, (long long)qemuCaps->ctime, qemuCaps->usedQMP); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list