mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: use file cache for nbdkit caps
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@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
d0fd04556c
commit
0c00059a72
@ -318,6 +318,9 @@ struct _virQEMUDriver {
|
||||
|
||||
/* Immutable pointer, self-locking APIs */
|
||||
virHashAtomic *migrationErrors;
|
||||
|
||||
/* Immutable pointer, self-locking APIs */
|
||||
virFileCache *nbdkitCapsCache;
|
||||
};
|
||||
|
||||
virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
|
||||
|
@ -845,6 +845,8 @@ qemuStateInitialize(bool privileged,
|
||||
defsecmodel)))
|
||||
goto error;
|
||||
|
||||
qemu_driver->nbdkitCapsCache = qemuNbdkitCapsCacheNew(cfg->cacheDir);
|
||||
|
||||
/* If hugetlbfs is present, then we need to create a sub-directory within
|
||||
* 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);
|
||||
|
||||
if (qemu_driver->lockFD != -1)
|
||||
virPidFileRelease(qemu_driver->config->stateDir, "driver", qemu_driver->lockFD);
|
||||
|
Loading…
Reference in New Issue
Block a user