[libvirt] [[PATCH v2] 3/4] virtlogd: add flag to wait for log end on read
Peter Krempa
pkrempa at redhat.com
Wed Oct 5 15:08:40 UTC 2016
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161005/3ec54b8f/attachment-0001.sig>
More information about the libvir-list
mailing list