Re: [[PATCH v2] 3/4] virtlogd: add flag to wait for log end on read

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

 



On Mon, Sep 12, 2016 at 17:34:42 +0300, Nikolay Shirokovskiy wrote:

This is a pretty big change but you did not write anything to describe
or justify it.

> ---
>  src/logging/log_handler.c  | 38 ++++++++++++++++++++++++++++++++++++--
>  src/logging/log_protocol.x |  5 +++++
>  2 files changed, 41 insertions(+), 2 deletions(-)

[...]

> @@ -492,10 +517,19 @@ virLogHandlerDomainReadLogFile(virLogHandlerPtr handler,
>      char *data = NULL;
>      ssize_t got;
>  
> -    virCheckFlags(0, NULL);
> +    virCheckFlags(VIR_LOG_MANAGER_PROTOCOL_DOMAIN_READ_LOG_FILE_WAIT, NULL);
>  
>      virObjectLock(handler);
>  
> +    if (flags & VIR_LOG_MANAGER_PROTOCOL_DOMAIN_READ_LOG_FILE_WAIT) {
> +        while (virLogHandlerGetLogFileFromPath(handler, path)) {
> +            if (virCondWait(&handler->condition, &handler->parent.lock) < 0) {
> +                virReportSystemError(errno, "%s", _("failed to wait for EOF"));
> +                goto error;
> +            }
> +        }

E.g why do you need this? The qemu process is dead at the point when
libvirt attempts to read the log file so I don't see a reason to wait
here.

Peter

Attachment: signature.asc
Description: 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]