On Wed, Aug 31, 2022 at 13:40:48 -0500, Jonathon Jongsma wrote: > In order to add caching of the nbdkit capabilities, we will need to > compare against file modification times, etc. So look up this > information when creating the nbdkit caps. > > Add a nbdkit_moddir build option to allow the builder to specify the > location to look for nbdkit plugins and filters. > > Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> > --- > meson.build | 6 ++++++ > meson_options.txt | 1 + > src/qemu/qemu_nbdkit.c | 39 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 46 insertions(+) > @@ -177,9 +185,40 @@ qemuNbdkitCapsNew(const char *path) > } > > > +static time_t > +getDirMtime(const char *moddir) Missing file prefix in function name. > +{ > + struct stat st; > + > + if (stat(moddir, &st) < 0) { > + VIR_DEBUG("Failed to stat nbdkit module directory '%s': %s", > + moddir, > + g_strerror(errno)); > + return 0; > + } > + > + return st.st_mtime; > +} > + > + > static void > qemuNbdkitCapsQuery(qemuNbdkitCaps *caps) > { > + struct stat st; > + > + if (stat(caps->path, &st) < 0) { > + VIR_DEBUG("Failed to stat nbdkit binary '%s': %s", > + caps->path, > + g_strerror(errno)); > + caps->ctime = 0; So does attempting to query the capabilities make sense after this point? > + } else { > + caps->ctime = st.st_ctime; > + } > + caps->filterDirMtime = getDirMtime(NBDKIT_FILTERDIR); > + caps->pluginDirMtime = getDirMtime(NBDKIT_PLUGINDIR); > + caps->libvirtCtime = virGetSelfLastChanged(); > + caps->libvirtVersion = LIBVIR_VERSION_NUMBER; > + > qemuNbdkitCapsQueryPlugins(caps); > qemuNbdkitCapsQueryFilters(caps); > qemuNbdkitCapsQueryVersion(caps); > -- > 2.37.1 >