[libvirt PATCH v3 07/18] qemu: use file cache for nbdkit caps

Peter Krempa pkrempa at redhat.com
Wed Dec 7 12:19:04 UTC 2022


On Thu, Oct 20, 2022 at 16:58:58 -0500, Jonathon Jongsma wrote:
> 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 <jjongsma at redhat.com>
> ---
>  src/qemu/qemu_conf.h   | 3 +++
>  src/qemu/qemu_driver.c | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
> index a39510b0b1..95c05e6888 100644
> --- a/src/qemu/qemu_conf.h
> +++ b/src/qemu/qemu_conf.h
> @@ -320,6 +320,9 @@ struct _virQEMUDriver {
>  
>      /* Immutable pointer, self-locking APIs */
>      virHashAtomic *migrationErrors;
> +
> +    /* Immutable pointer, self-locking APIs */
> +    virFileCache *nbdkitCapsCache;
>  };
>  
>  virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 59a3b37b98..d42f3c2d2a 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -833,6 +833,9 @@ qemuStateInitialize(bool privileged,
>                                                             defsecmodel)))
>          goto error;
>  
> +    /* find whether nbdkit is available and query its capabilities */

This comment doesn't seem accurate. IIUC  virFileCacheNew simply creates
the object but doesn't interrogate or load anything.

Reviewed-by: Peter Krempa <pkrempa at redhat.com>


More information about the libvir-list mailing list