
On Wed, Nov 18, 2015 at 03:54:37PM +0100, Peter Krempa wrote:
On Thu, Nov 12, 2015 at 17:18:59 +0000, Daniel Berrange wrote:
Copy the virtlockd codebase across to form the initial virlogd code. Simple search & replace of s/lock/log/ and gut the remote protocol & dispatcher. This gives us a daemon that starts up and listens for connections, but does nothing with them.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> ---
[...]
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c new file mode 100644 index 0000000..184076c --- /dev/null +++ b/src/logging/log_daemon.c @@ -0,0 +1,1177 @@ +/* + * log_daemon.c: log management daemon + * + * Copyright (C) 2006-2015 Red Hat, Inc.
Um 2006? Here and in every other header.
All this code is cut+paste from the virtlockd code, which is in turn cut+paste from libvirtd. So preserving the original copyright lines as-is is appropriate.
+VIR_ENUM_DECL(virDaemonErr) +VIR_ENUM_IMPL(virDaemonErr, VIR_LOG_DAEMON_ERR_LAST, + "Initialization successful", + "Unable to obtain pidfile", + "Unable to create rundir", + "Unable to initialize libvirt",
Will this need to call libvirt? Or should this be 'virtlogd'?
I think I can probably delete this error entirely - I think it is unused.
+/* + * Set up the logging environment + * By default if daemonized all errors go to the logfile libvirtd.log, + * but if verbose or error debugging is asked for then also output + * informational and debug messages. Default size if 64 kB.
The logging ring buffer isn't present any more.
Hah, yeah, should be killed.
diff --git a/src/logging/log_protocol.x b/src/logging/log_protocol.x new file mode 100644 index 0000000..9b8fa41 --- /dev/null +++ b/src/logging/log_protocol.x @@ -0,0 +1,22 @@ +/* -*- c -*- + */ + +%#include "internal.h" + +typedef opaque virLogManagerProtocolUUID[VIR_UUID_BUFLEN]; + +/* Length of long, but not unbounded, strings. + * This is an arbitrary limit designed to stop the decoder from trying + * to allocate unbounded amounts of memory when fed with a bad message. + */ +const VIR_LOG_MANAGER_PROTOCOL_STRING_MAX = 65536;
This is going to be modified in the next patch. Shouldn't you use the right value directly here?
Yep, good point.
+ +# The maximum number of concurrent client connections to allow +# over all sockets combined. +# Each running virtual machine will require one open connection +# to virtlogd. So 'max_clients' will affect how many VMs can +# be run on a host +#max_clients = 1024
Should we mention this also in the libvirtd config file?
No, this doesn't have an impact on the max_clients requirement for libvirtd. 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 :|