Re: [PATCH 1/2] Avoid taking lock in libvirt debug dump

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

 



On 03/17/2011 01:41 AM, Daniel Veillard wrote:
> As pointed out, locking the buffer from the signal handler
> cannot been garanteed to be safe, so to avoid any hazard

s/garanteed/guaranteed/

> we prefer the trade off of dumping logs possibly messed up
> by concurrent logging activity rather than risk a daemon
> crash.
> 
> * src/util/logging.c: change virLogEmergencyDumpAll() to not
>   take any lock on the log buffer but reset buffer content variables
> +    /*

> +     * Since we can't lock the buffer safely from a signal handler
> +     * we mark it as empty in case of concurrent access, and proceed
> +     * with the data, at worse we will output something a bit weird
> +     * if another thread start logging messages at the same time.
> +     * Note that virLogStr() uses virLogEnd for the computations and
> +     * writes to the buffer and then only update virLogLen and virLogStart

s/then only update/only then updates/

ACK with those nits fixed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]