[libvirt] [PATCH v2 1/3] Add helper APIs to track if libvirtd or loadable modules have changed
Eric Blake
eblake at redhat.com
Mon Mar 10 18:39:27 UTC 2014
On 03/10/2014 10:54 AM, Daniel P. Berrange wrote:
> The future QEMU capabilities cache needs to be able to invalidate
> itself if the libvirtd binary or any loadable modules are changed
> on disk. Record the 'ctime' value for these binaries and provide
> helper APIs to query it. This approach assumes that if libvirt.so
> is changed, then libvirtd will also change, which should usually
> be the case with libtool's wrapper scripts that cause libvirtd to
> get re-linked
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> +void virUpdateSelfLastChanged(const char *path)
> +{
> + struct stat sb;
> +
> + if (stat(path, &sb) < 0)
> + return;
> +
> + if (sb.st_ctime > selfLastChanged) {
> + VIR_DEBUG("Setting self last changed to %lld for '%s'",
> + (long long)sb.st_ctime, path);
> + selfLastChanged = sb.st_ctime;
No sub-second resolution? I suppose it's okay, although gnulib gives
you functions to access and compare full timestamp resolution.
ACK.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140310/a9f1ec18/attachment-0001.sig>
More information about the libvir-list
mailing list