Re: [PATCH v2 1/3] Add helper APIs to track if libvirtd or loadable modules have changed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---

> +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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]