From nobody Tue Feb 10 16:18:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1693259125; cv=none; d=zohomail.com; s=zohoarc; b=jeAaZGuanHzh0g0ycsA4qmIDrmwK4S1YYbTl+u/sPtz2vrtmOLwqJeSbTOUj+J+Bnsa8PYPftb9Dr8v+KijZxlAJSyLLcQXJm4ABjDRLCcUuW8sJYPRZTW0e+OQA5I9HO6cMzu/sFiDHXN1iOCzy/nIP2CUtGZCtZQmi8iN1zxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693259125; h=Content-Type:Content-Transfer-Encoding:Cc: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=34myDEo1bLOMbLqCqXB3Y1/xShfJGhBuZE4SHOf4riY=; b=cK80xhgLAy+J4pr3GejIVsVdxTKEKvpBsHqF54nUiYjeObTjpof+VXKYNy7TimnzVEVI9QUtS2nfZcLvip1HvQ2xq9u/bIeP26Z0xwiwGTSg4LTtibi/cKhMjW6EoeUtU2MFlW/qHkY6DcU9kXCYX33QTQ3H+wlyLcqlKaHP97I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1693259125069792.1106342458102; Mon, 28 Aug 2023 14:45:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-280-UfgTOeHjPH-0PIf5zUZT4w-1; Mon, 28 Aug 2023 17:45:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 636F93C0FCB2; Mon, 28 Aug 2023 21:45:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 491362166B2B; Mon, 28 Aug 2023 21:45:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 880F61946A40; Mon, 28 Aug 2023 21:45:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 68BD31946A66 for ; Mon, 28 Aug 2023 21:45:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4B6D2140E963; Mon, 28 Aug 2023 21:45:13 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.17.242]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20612140E962; Mon, 28 Aug 2023 21:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693259124; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=34myDEo1bLOMbLqCqXB3Y1/xShfJGhBuZE4SHOf4riY=; b=fslGtUW46xO/kVDNPxRfKm+5TnPQChQ7ZvER338XQoTF1SmrgNqpibNQsIpeJ/pWtXdLfg qL+XWQ3lvu4dlLKIB+Btch9QyofAwZpBmydQgoI1i5eLz0+QN5JG9EJOF1B83ZAkDRCABW 3LBqenRZn9GoZbWHF6LCdWellY16ZtM= X-MC-Unique: UfgTOeHjPH-0PIf5zUZT4w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v7 07/35] qemu: use file cache for nbdkit caps Date: Mon, 28 Aug 2023 16:44:42 -0500 Message-ID: <20230828214510.903890-8-jjongsma@redhat.com> In-Reply-To: <20230828214510.903890-1-jjongsma@redhat.com> References: <20230828214510.903890-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Krempa Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693259125495100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add the virFileCache implementation for nbdkit capabilities to the qemu driver. This allows us to determine whether nbdkit is installed and which plugins are supported. it also has persistent caching and the capabilities are re-queried whenever something changes. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu/qemu_conf.h | 3 +++ src/qemu/qemu_driver.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 4f610d86a1..a44985fb8b 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -318,6 +318,9 @@ struct _virQEMUDriver { =20 /* Immutable pointer, self-locking APIs */ virHashAtomic *migrationErrors; + + /* Immutable pointer, self-locking APIs */ + virFileCache *nbdkitCapsCache; }; =20 virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5db42f0753..ad8428948b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -845,6 +845,8 @@ qemuStateInitialize(bool privileged, defsecmodel))) goto error; =20 + qemu_driver->nbdkitCapsCache =3D qemuNbdkitCapsCacheNew(cfg->cacheDir); + /* If hugetlbfs is present, then we need to create a sub-directory wit= hin * it, since we can't assume the root mount point has permissions that * will let our spawned QEMU instances use it. */ @@ -1078,6 +1080,7 @@ qemuStateCleanup(void) ebtablesContextFree(qemu_driver->ebtables); VIR_FREE(qemu_driver->qemuImgBinary); virObjectUnref(qemu_driver->domains); + virObjectUnref(qemu_driver->nbdkitCapsCache); =20 if (qemu_driver->lockFD !=3D -1) virPidFileRelease(qemu_driver->config->stateDir, "driver", qemu_dr= iver->lockFD); --=20 2.41.0