Re: [PATCH v2 6/8] logging: support truncation of logfiles when opening

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

 



On Fri, Mar 04, 2016 at 09:33:42AM -0500, John Ferlan wrote:
> 
> 
> On 02/29/2016 08:33 AM, Daniel P. Berrange wrote:
> > The virtlogd daemon currently opens all files for append, but
> > in some cases the user may wish to discard existing data. Define
> > a new flag to indicate that logfiles should be truncated when
> > opening.
> > ---
> >  src/logging/log_daemon_dispatch.c | 3 ++-
> >  src/logging/log_handler.c         | 6 ++----
> >  src/logging/log_handler.h         | 2 +-
> >  src/logging/log_manager.h         | 2 ++
> >  src/logging/log_protocol.x        | 4 ++++
> >  5 files changed, 11 insertions(+), 6 deletions(-)
> > 
> 
> [...]
> 
> > diff --git a/src/logging/log_protocol.x b/src/logging/log_protocol.x
> > index b0ac31b..0363c75 100644
> > --- a/src/logging/log_protocol.x
> > +++ b/src/logging/log_protocol.x
> > @@ -30,6 +30,10 @@ struct virLogManagerProtocolLogFilePosition {
> >  };
> >  typedef struct virLogManagerProtocolLogFilePosition virLogManagerProtocolLogFilePosition;
> >  
> > +enum virLogManagerProtocolDomainOpenLogFileFlags {
> > +    VIR_LOG_MANAGER_PROTOCOL_DOMAIN_OPEN_LOG_FILE_TRUNCATE = 1
> > +};
> > +
> 
> Use "= (1 << 0)" (just to be painfully obvious for the next adjustment)
> 
> Since the trunc setting is "flags & VIR_LOG_*_TRUNCATE"

Sadly you can't use  (1 << 0) in .x files


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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