From nobody Tue Feb 10 02:49:21 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=1693518138; cv=none; d=zohomail.com; s=zohoarc; b=aFYMBi5aJIaMBVn0B1WT/coE9soGnjyO2GlIpgNxtrgnARiVrXkO16xKE9qoW0JalrQLBrfufoe46AEWIOq9c45iy28WeAiBppSL8kyxeglA6ZubwSo3NcxrrmhtuV6Hsm6rDUhBXn3zpyF/tCEYBj2ujhhuRX2PjT5DgIA7ULs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693518138; 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=maBmUo6RNqcJ3XZPDU8ntQ2Fhl1O08kte7lWqAY4Qn6n4pyptARsG/3wOzgkSTXdyZxSW8yUAY9K4pb/oz03U3h8gVFnOvqv+ydVGGOsejzFFLYOLMVXHj32APOc/SFYNVfEz1yUM5ZUwtr5uHz/0nZlZy6PKma7gtiLyxbxxCc= 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 169351813880122.598820401005696; Thu, 31 Aug 2023 14:42:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-685-2kE9rGLPOXOxLKoaxu6kKA-1; Thu, 31 Aug 2023 17:40:30 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA95485571A; Thu, 31 Aug 2023 21:40:26 +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 BAE9E46A3A0; Thu, 31 Aug 2023 21:40:26 +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 1B7C319465B9; Thu, 31 Aug 2023 21:40:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 938E61946A61 for ; Thu, 31 Aug 2023 21:40:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 83A39492C14; Thu, 31 Aug 2023 21:40:20 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.17.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58FF2492C13; Thu, 31 Aug 2023 21:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693518137; 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=Rnv7EB280tDB6vFyMz/YEXIAFJGAcM+Xp1v5MAdtFwU2hkTABh7bryZGbZgcmObVOKbgr+ 9HttK8kmrLYD7XSpnnVx7AYgAXi8IvUNlBVwNC5pq/qcNzn/hsTiNlZK+MGhCXycvjnhNu EjPTf5yTIWwVmY4DqIekoApGOpuTqLg= X-MC-Unique: 2kE9rGLPOXOxLKoaxu6kKA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v8 07/37] qemu: use file cache for nbdkit caps Date: Thu, 31 Aug 2023 16:39:47 -0500 Message-ID: <20230831214017.1536388-8-jjongsma@redhat.com> In-Reply-To: <20230831214017.1536388-1-jjongsma@redhat.com> References: <20230831214017.1536388-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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.10 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: 1693518140683100001 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