From nobody Sun Feb 8 12:37:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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=1575469448; cv=none; d=zohomail.com; s=zohoarc; b=M39uVDi6p2vWEFlOfnHmVor6C8lk2rT5gTJQfMoAzDpayxXeeHcn0L+jX/MagtVKza1T2wF/XL51yq2xq0Q6CsxxHuvbOzwUVD9wD1bHRquzUmExAWjlyTqrbMqLw+c/olihzMD96dIMegZxEiR3lABzdR3/BgTwsEXSalsXH1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575469448; 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=qkJ9oums/pq4ZFCOWu/VGy9o83pXdVRT0IuGSyVuAb0=; b=ZqVjnnqzqyGmsdql1/lf4rEJSQ74e1jA3AmpHBYTqwo4e6BG9fNyrj5w1A5ACipEcw7zBMQMM+kASftkfRjR7dJmvy+cVzJKPJckcpyDcRsjYt8INvoHA6/ujnx860FklTYYDbmq6ik7wmo75KGDN+oGG4Diimwg8uq8hK9m2jc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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 [205.139.110.61]) by mx.zohomail.com with SMTPS id 157546944814028.753669216586786; Wed, 4 Dec 2019 06:24:08 -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-116-vEVhx6jEPCuUEdSTR3sMBg-1; Wed, 04 Dec 2019 09:22:26 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14961183B714; Wed, 4 Dec 2019 14:22:20 +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 E5E43691BC; Wed, 4 Dec 2019 14:22: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 98DAB180350C; Wed, 4 Dec 2019 14:22:19 +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 xB4EM2Pt008394 for ; Wed, 4 Dec 2019 09:22:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id A3688691A3; Wed, 4 Dec 2019 14:22:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-55.ams2.redhat.com [10.36.112.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id C03DF67E62; Wed, 4 Dec 2019 14:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575469446; 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=qkJ9oums/pq4ZFCOWu/VGy9o83pXdVRT0IuGSyVuAb0=; b=S8CG3mck7tT3l75oToeQJPhIO7Rp6Y80e69lqe+9gzHmENwA36sCvp7n9B3GfmbRV2oETj NE+zonwXHOHQeguYnDjS5kysaKbY1z/nZEUkfkI3KpMQXmItYyXy11SV3p1X/ir/Ttgnxz NCBdG1XeufiRtZD8XXlc2C6qusJBPx8= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 4 Dec 2019 14:21:13 +0000 Message-Id: <20191204142113.2961028-31-berrange@redhat.com> In-Reply-To: <20191204142113.2961028-1-berrange@redhat.com> References: <20191204142113.2961028-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 30/30] qemu: stop creating capabilities at driver startup 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.13 X-MC-Unique: vEVhx6jEPCuUEdSTR3sMBg-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) Now that nearly all internal APIs use the QEMU capabilities or other QEMU driver data directly, there's no compelling benefit to create virCapsPtr at driver startup. Skipping this means we don't probe capabilities for all 30 system emulator targets at startup, only those emulators which are referenced by an XML doc. This massively improves libvirtd startup time when the capabilities cache is not populated. It even improves startup time when the cache is up to date, as we don't bother to load files from the cache until we need them. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_conf.c | 13 +++++++------ src/qemu/qemu_driver.c | 3 --- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 9df4ae1230..c24c99d129 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1318,13 +1318,14 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriv= erPtr driver, driver->caps =3D caps; } else { qemuDriverLock(driver); - } =20 - if (driver->caps->nguests =3D=3D 0 && !refresh) { - VIR_DEBUG("Capabilities didn't detect any guests. Forcing a " - "refresh."); - qemuDriverUnlock(driver); - return virQEMUDriverGetCapabilities(driver, true); + if (driver->caps =3D=3D NULL || + driver->caps->nguests =3D=3D 0) { + VIR_DEBUG("Capabilities didn't detect any guests. Forcing a " + "refresh."); + qemuDriverUnlock(driver); + return virQEMUDriverGetCapabilities(driver, true); + } } =20 ret =3D virObjectRef(driver->caps); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1fe310e16c..f50af3ee94 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -907,9 +907,6 @@ qemuStateInitialize(bool privileged, if (!qemu_driver->qemuCapsCache) goto error; =20 - if ((qemu_driver->caps =3D virQEMUDriverCreateCapabilities(qemu_driver= )) =3D=3D NULL) - goto error; - if (!(sec_managers =3D qemuSecurityGetNested(qemu_driver->securityMana= ger))) goto error; =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list