On Mon, Nov 16, 2015 at 05:40:07PM +0100, Martin Kletzander wrote:
On Fri, Nov 06, 2015 at 12:46:24PM +0100, Erik Skultety wrote:
>As we need a client disconnect handler, we also need a mechanism to register
>such handlers for a client. This patch introduced both the close callbacks and
>also the client vshAdmCatchDisconnect handler to be registered with it. By
>registering the handler we still need to make sure the client can react to
>daemon's events like disconnect or keepalive, so asynchronous I/O event polling
>is necessary to be enabled too.
>---
>cfg.mk | 2 +-
>include/libvirt/libvirt-admin.h | 21 ++++++++
>src/admin/admin_remote.c | 35 +++++++++++++
>src/datatypes.c | 24 +++++++++
>src/datatypes.h | 16 +++++-
>src/libvirt-admin.c | 112 ++++++++++++++++++++++++++++++++++++++++
>src/libvirt_admin_public.syms | 2 +
>tools/virt-admin.c | 50 ++++++++++++++++++
>8 files changed, 260 insertions(+), 2 deletions(-)
>
>diff --git a/cfg.mk b/cfg.mk
>index a9bba38..43ee945 100644
>--- a/cfg.mk
>+++ b/cfg.mk
>@@ -1192,7 +1192,7 @@
exclude_file_name_regexp--sc_prohibit_include_public_headers_quote = \
> ^(src/internal\.h$$|tools/wireshark/src/packet-libvirt.h$$)
>
>exclude_file_name_regexp--sc_prohibit_include_public_headers_brackets = \
>- ^(tools/|examples/|include/libvirt/(virterror|libvirt-(qemu|lxc))\.h$$)
>+ ^(tools/|examples/|include/libvirt/(virterror|libvirt-(admin|qemu|lxc))\.h$$)
>
>exclude_file_name_regexp--sc_prohibit_int_ijk = \
> ^(src/remote_protocol-structs|src/remote/remote_protocol.x|cfg.mk|include/)$
>diff --git a/include/libvirt/libvirt-admin.h b/include/libvirt/libvirt-admin.h
>index 145720d..5f9841c 100644
>--- a/include/libvirt/libvirt-admin.h
>+++ b/include/libvirt/libvirt-admin.h
>@@ -26,6 +26,8 @@
>#ifndef __VIR_ADMIN_H__
># define __VIR_ADMIN_H__
>
>+# include <libvirt/libvirt.h>
>+
Oh no you didn't... This means that including libvirt-admin.h will
allow seeing *everything* from libvirt. I see two things you need
this for. Enum values and a function. Enum values could be
defined somewhere else (e.g. datatypes.h) and that 'somewhere else'
could be included instead. The function should either be
re-implemented for both libraries or just moved outside and each
library should have a wrapper for it. Do anything to remove this
line, thanks.
Yeah we could just have a libvirt/libvirt-common.h file for stuff
that needs to be shared.
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 :|