daemon: move libvirtd code into src/remote/ directory

Having a daemon/ directory makes little sense from a code structure
point of view, as 90% of the code that is built into libvirtd already
lives in the src/ directory. The virtlockd and virlogd daemons also live
entirely in src/{locking,logging} directories. This moves the source
code for libvirtd into src/remote/, alongside the client code.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-02-20 13:16:28 +00:00
parent 6d394819ab
commit 91fd3dc932
13 changed files with 155 additions and 197 deletions

5
.gitignore vendored
View File

@ -59,9 +59,6 @@
/configure /configure
/configure.lineno /configure.lineno
/conftest.* /conftest.*
/daemon/*_dispatch.h
/daemon/libvirt_qemud
/daemon/libvirtd
/daemon/libvirtd*.logrotate /daemon/libvirtd*.logrotate
/daemon/libvirtd.policy /daemon/libvirtd.policy
/daemon/test_libvirtd.aug /daemon/test_libvirtd.aug
@ -139,6 +136,7 @@
/src/libvirt_*helper /src/libvirt_*helper
/src/libvirt_*probes.h /src/libvirt_*probes.h
/src/libvirt_lxc /src/libvirt_lxc
/src/libvirtd
/src/locking/libxl-lockd.conf /src/locking/libxl-lockd.conf
/src/locking/libxl-sanlock.conf /src/locking/libxl-sanlock.conf
/src/locking/lock_daemon_dispatch_stubs.h /src/locking/lock_daemon_dispatch_stubs.h
@ -157,6 +155,7 @@
/src/qemu/test_libvirtd_qemu.aug /src/qemu/test_libvirtd_qemu.aug
/src/remote/*_client_bodies.h /src/remote/*_client_bodies.h
/src/remote/*_protocol.[ch] /src/remote/*_protocol.[ch]
/src/remote/*_stubs.h
/src/rpc/virkeepaliveprotocol.[ch] /src/rpc/virkeepaliveprotocol.[ch]
/src/rpc/virnetprotocol.[ch] /src/rpc/virnetprotocol.[ch]
/src/test_libvirt*.aug /src/test_libvirt*.aug

23
cfg.mk
View File

@ -32,8 +32,7 @@ gnulib_dir = $(srcdir)/.gnulib
# List of additional files that we want to pick up in our POTFILES.in # List of additional files that we want to pick up in our POTFILES.in
# This is all gnulib files, as well as generated files for RPC code. # This is all gnulib files, as well as generated files for RPC code.
generated_files = \ generated_files = \
$(srcdir)/daemon/{lxc,qemu,remote}_dispatch.h \ $(srcdir)/src/*/{remote_daemon,admin_server,log_daemon,lock_daemon}_dispatch_*stubs.h \
$(srcdir)/src/*/{admin_server,log_daemon,lock_daemon}_dispatch_stubs.h \
$(srcdir)/src/lxc/{lxc_monitor,lxc_controller}_dispatch.h \ $(srcdir)/src/lxc/{lxc_monitor,lxc_controller}_dispatch.h \
$(srcdir)/src/remote/*_client_bodies.h \ $(srcdir)/src/remote/*_client_bodies.h \
$(srcdir)/src/*/*_protocol.[ch] \ $(srcdir)/src/*/*_protocol.[ch] \
@ -1116,15 +1115,15 @@ test-wrap-argv:
# sc_po_check can fail if generated files are not built first # sc_po_check can fail if generated files are not built first
sc_po_check: \ sc_po_check: \
$(srcdir)/daemon/remote_dispatch.h \ $(srcdir)/src/remote/remote_daemon_dispatch_stubs.h \
$(srcdir)/daemon/qemu_dispatch.h \ $(srcdir)/src/remote/remote_daemon_dispatch_qemu_stubs.h \
$(srcdir)/src/remote/remote_client_bodies.h \ $(srcdir)/src/remote/remote_client_bodies.h \
$(srcdir)/src/admin/admin_server_dispatch_stubs.h \ $(srcdir)/src/admin/admin_server_dispatch_stubs.h \
$(srcdir)/src/admin/admin_client.h $(srcdir)/src/admin/admin_client.h
$(srcdir)/daemon/remote_dispatch.h: $(srcdir)/src/remote/remote_protocol.x $(srcdir)/src/remote/remote_daemon_dispatch_stubs.h: $(srcdir)/src/remote/remote_protocol.x
$(MAKE) -C daemon remote_dispatch.h $(MAKE) -C src remote/remote_daemon_dispatch_stubs.h
$(srcdir)/daemon/qemu_dispatch.h: $(srcdir)/src/remote/qemu_protocol.x $(srcdir)/src/remote/remote_daemon_dispatch_qemu_stubs.h: $(srcdir)/src/remote/qemu_protocol.x
$(MAKE) -C daemon qemu_dispatch.h $(MAKE) -C src remote/remote_daemon_dispatch_qemu_stubs.h
$(srcdir)/src/remote/remote_client_bodies.h: $(srcdir)/src/remote/remote_protocol.x $(srcdir)/src/remote/remote_client_bodies.h: $(srcdir)/src/remote/remote_protocol.x
$(MAKE) -C src remote/remote_client_bodies.h $(MAKE) -C src remote/remote_client_bodies.h
$(srcdir)/src/admin/admin_server_dispatch_stubs.h: $(srcdir)/src/admin/admin_protocol.x $(srcdir)/src/admin/admin_server_dispatch_stubs.h: $(srcdir)/src/admin/admin_protocol.x
@ -1138,7 +1137,7 @@ exclude_file_name_regexp--sc_avoid_strcase = ^tools/vsh\.h$$
_src1=libvirt-stream|qemu/qemu_monitor|util/vir(command|file|fdstream)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon _src1=libvirt-stream|qemu/qemu_monitor|util/vir(command|file|fdstream)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon
_test1=shunloadtest|virnettlscontexttest|virnettlssessiontest|vircgroupmock|commandhelper _test1=shunloadtest|virnettlscontexttest|virnettlssessiontest|vircgroupmock|commandhelper
exclude_file_name_regexp--sc_avoid_write = \ exclude_file_name_regexp--sc_avoid_write = \
^(src/($(_src1))|daemon/libvirtd|tools/virsh-console|tests/($(_test1)))\.c$$ ^(src/($(_src1))|tools/virsh-console|tests/($(_test1)))\.c$$
exclude_file_name_regexp--sc_bindtextdomain = .* exclude_file_name_regexp--sc_bindtextdomain = .*
@ -1159,7 +1158,7 @@ exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$) exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$)
exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \ exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \
^(cfg\.mk|include/libvirt/virterror\.h|daemon/dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$ ^(cfg\.mk|include/libvirt/virterror\.h|src/remote/remote_daemon_dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$
exclude_file_name_regexp--sc_prohibit_PATH_MAX = \ exclude_file_name_regexp--sc_prohibit_PATH_MAX = \
^cfg\.mk$$ ^cfg\.mk$$
@ -1179,9 +1178,9 @@ exclude_file_name_regexp--sc_prohibit_close = \
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \ exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
(^tests/(qemuhelp|virhostcpu|virpcitest)data/|docs/js/.*\.js|docs/fonts/.*\.woff|\.diff|tests/virconfdata/no-newline\.conf$$) (^tests/(qemuhelp|virhostcpu|virpcitest)data/|docs/js/.*\.js|docs/fonts/.*\.woff|\.diff|tests/virconfdata/no-newline\.conf$$)
_src2=src/(util/vircommand|libvirt|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon) _src2=src/(util/vircommand|libvirt|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon|remote/remote_daemon)
exclude_file_name_regexp--sc_prohibit_fork_wrappers = \ exclude_file_name_regexp--sc_prohibit_fork_wrappers = \
(^($(_src2)|tests/testutils|daemon/libvirtd)\.c$$) (^($(_src2)|tests/testutils)\.c$$)
exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/vir(util|log)\.c$$ exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/vir(util|log)\.c$$

View File

@ -16,37 +16,8 @@
## License along with this library. If not, see ## License along with this library. If not, see
## <http://www.gnu.org/licenses/>. ## <http://www.gnu.org/licenses/>.
INCLUDES = \
-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
-I$(top_srcdir) \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/src -I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \
-I$(top_srcdir)/src/conf \
-I$(top_srcdir)/src/rpc \
-I$(top_srcdir)/src/remote \
-I$(top_srcdir)/src/admin \
-I$(top_srcdir)/src/access \
$(GETTEXT_CPPFLAGS)
CLEANFILES = CLEANFILES =
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)
DAEMON_GENERATED = \
remote_dispatch.h \
lxc_dispatch.h \
qemu_dispatch.h \
$(NULL)
DAEMON_SOURCES = \
libvirtd.c libvirtd.h \
remote.c remote.h \
stream.c stream.h \
$(DAEMON_GENERATED)
LIBVIRTD_CONF_SOURCES = libvirtd-config.c libvirtd-config.h
PODFILES = \ PODFILES = \
libvirtd.pod \ libvirtd.pod \
$(NULL) $(NULL)
@ -57,9 +28,6 @@ MANINFILES = \
DISTCLEANFILES = DISTCLEANFILES =
EXTRA_DIST = \ EXTRA_DIST = \
remote_dispatch.h \
lxc_dispatch.h \
qemu_dispatch.h \
libvirtd.conf \ libvirtd.conf \
libvirtd.init.in \ libvirtd.init.in \
libvirtd.upstart \ libvirtd.upstart \
@ -79,59 +47,14 @@ EXTRA_DIST = \
test_libvirtd.aug.in \ test_libvirtd.aug.in \
$(PODFILES) \ $(PODFILES) \
$(MANINFILES) \ $(MANINFILES) \
$(DAEMON_SOURCES) \
$(LIBVIRTD_CONF_SOURCES) \
$(NULL) $(NULL)
BUILT_SOURCES = BUILT_SOURCES =
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
LXC_PROTOCOL = $(top_srcdir)/src/remote/lxc_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
ADMIN_PROTOCOL = $(top_srcdir)/src/admin/admin_protocol.x
remote_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server remote REMOTE $(REMOTE_PROTOCOL) \
> $(srcdir)/remote_dispatch.h
lxc_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server lxc LXC $(LXC_PROTOCOL) \
> $(srcdir)/lxc_dispatch.h
qemu_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/qemu_dispatch.h
if WITH_LIBVIRTD if WITH_LIBVIRTD
# Build a convenience library, for reuse in tests/libvirtdconftest
noinst_LTLIBRARIES = libvirtd_conf.la
libvirtd_conf_la_SOURCES = $(LIBVIRTD_CONF_SOURCES)
libvirtd_conf_la_CFLAGS = \
$(LIBXML_CFLAGS) \
$(XDR_CFLAGS) \
$(WARN_CFLAGS) $(PIE_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(NULL)
libvirtd_conf_la_LDFLAGS = \
$(RELRO_LDFLAGS) \
$(PIE_LDFLAGS) \
$(COVERAGE_LDFLAGS) \
$(NO_INDIRECT_LDFLAGS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
libvirtd_conf_la_LIBADD = $(LIBXML_LIBS)
man8_MANS = libvirtd.8 man8_MANS = libvirtd.8
sbin_PROGRAMS = libvirtd
confdir = $(sysconfdir)/libvirt/ confdir = $(sysconfdir)/libvirt/
conf_DATA = libvirtd.conf conf_DATA = libvirtd.conf
@ -143,44 +66,6 @@ augeastests_DATA = test_libvirtd.aug
CLEANFILES += test_libvirtd.aug CLEANFILES += test_libvirtd.aug
libvirtd_SOURCES = $(DAEMON_SOURCES)
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
libvirtd_CFLAGS = \
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
$(XDR_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
$(WARN_CFLAGS) $(PIE_CFLAGS) \
$(COVERAGE_CFLAGS) \
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
libvirtd_LDFLAGS = \
$(RELRO_LDFLAGS) \
$(PIE_LDFLAGS) \
$(COVERAGE_LDFLAGS) \
$(NO_INDIRECT_LDFLAGS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
libvirtd_LDADD = \
$(LIBXML_LIBS) \
$(GNUTLS_LIBS) \
$(SASL_LIBS) \
$(DBUS_LIBS) \
$(LIBNL_LIBS)
if WITH_DTRACE_PROBES
libvirtd_LDADD += ../src/libvirt_probes.lo
endif WITH_DTRACE_PROBES
libvirtd_LDADD += \
libvirtd_conf.la \
../src/libvirt_driver_admin.la \
../src/libvirt-lxc.la \
../src/libvirt-qemu.la \
$(NULL)
libvirtd_LDADD += ../src/libvirt.la
if WITH_POLKIT if WITH_POLKIT
if WITH_POLKIT0 if WITH_POLKIT0
policydir = $(datadir)/PolicyKit/policy policydir = $(datadir)/PolicyKit/policy
@ -238,9 +123,6 @@ install-data-polkit::
uninstall-data-polkit:: uninstall-data-polkit::
endif ! WITH_POLKIT endif ! WITH_POLKIT
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \ LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
libvirtd.libxl.logrotate libvirtd.uml.logrotate \ libvirtd.libxl.logrotate libvirtd.uml.logrotate \
libvirtd.logrotate libvirtd.logrotate
@ -413,11 +295,6 @@ check-augeas: test_libvirtd.aug
'$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \ '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
fi fi
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
else ! WITH_LIBVIRTD else ! WITH_LIBVIRTD
install-data-local: install-data-sasl install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl uninstall-local:: uninstall-data-sasl
@ -461,4 +338,4 @@ endif ! WITH_SASL
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS) CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
MAINTAINERCLEANFILES = $(MANINFILES) $(DAEMON_GENERATED) MAINTAINERCLEANFILES = $(MANINFILES)

View File

@ -1,9 +1,3 @@
daemon/libvirtd-config.c
daemon/libvirtd.c
daemon/qemu_dispatch.h
daemon/remote.c
daemon/remote_dispatch.h
daemon/stream.c
gnulib/lib/gai_strerror.c gnulib/lib/gai_strerror.c
gnulib/lib/getopt.c gnulib/lib/getopt.c
gnulib/lib/regcomp.c gnulib/lib/regcomp.c
@ -148,6 +142,12 @@ src/qemu/qemu_monitor_text.c
src/qemu/qemu_parse_command.c src/qemu/qemu_parse_command.c
src/qemu/qemu_process.c src/qemu/qemu_process.c
src/remote/remote_client_bodies.h src/remote/remote_client_bodies.h
src/remote/remote_daemon.c
src/remote/remote_daemon_config.c
src/remote/remote_daemon_dispatch.c
src/remote/remote_daemon_dispatch_stubs.h
src/remote/remote_daemon_dispatch_qemu_stubs.h
src/remote/remote_daemon_stream.c
src/remote/remote_driver.c src/remote/remote_driver.c
src/rpc/virkeepalive.c src/rpc/virkeepalive.c
src/rpc/virnetclient.c src/rpc/virnetclient.c

View File

@ -85,6 +85,7 @@ lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
moddir = $(libdir)/libvirt/connection-driver moddir = $(libdir)/libvirt/connection-driver
mod_LTLIBRARIES = mod_LTLIBRARIES =
sbin_PROGRAMS =
confdir = $(sysconfdir)/libvirt confdir = $(sysconfdir)/libvirt
conf_DATA = libvirt.conf libvirt-admin.conf conf_DATA = libvirt.conf libvirt-admin.conf
@ -537,12 +538,45 @@ remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
qemu QEMU $(QEMU_PROTOCOL) \ qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/remote/qemu_client_bodies.h > $(srcdir)/remote/qemu_client_bodies.h
remote/remote_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server remote REMOTE $(REMOTE_PROTOCOL) \
> $(srcdir)/remote/remote_daemon_dispatch_stubs.h
remote/remote_daemon_dispatch_lxc_stubs.h: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server lxc LXC $(LXC_PROTOCOL) \
> $(srcdir)/remote/remote_daemon_dispatch_lxc_stubs.h
remote/remote_daemon_dispatch_qemu_stubs.h: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/remote/remote_daemon_dispatch_qemu_stubs.h
REMOTE_DRIVER_SOURCES = \ REMOTE_DRIVER_SOURCES = \
remote/remote_driver.c remote/remote_driver.h \ remote/remote_driver.c remote/remote_driver.h \
$(REMOTE_DRIVER_GENERATED) $(REMOTE_DRIVER_GENERATED)
LIBVIRTD_GENERATED = \
remote/remote_daemon_dispatch_stubs.h \
remote/remote_daemon_dispatch_lxc_stubs.h \
remote/remote_daemon_dispatch_qemu_stubs.h \
$(NULL)
LIBVIRTD_SOURCES = \
remote/remote_daemon.c remote/remote_daemon.h \
remote/remote_daemon_config.c remote/remote_daemon_config.h \
remote/remote_daemon_dispatch.c remote/remote_daemon_dispatch.h \
remote/remote_daemon_stream.c remote/remote_daemon_stream.h \
$(LIBVIRTD_GENERATED)
EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \ EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \
$(REMOTE_DRIVER_GENERATED) $(REMOTE_DRIVER_GENERATED) \
$(LIBVIRTD_SOURCES) \
$(NULL)
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x
@ -1329,6 +1363,55 @@ BUILT_SOURCES += $(REMOTE_DRIVER_GENERATED)
endif WITH_REMOTE endif WITH_REMOTE
if WITH_LIBVIRTD
sbin_PROGRAMS += libvirtd
BUILT_SOURCES += $(LIBVIRTD_GENERATED)
libvirtd_SOURCES = $(LIBVIRTD_SOURCES)
libvirtd_CFLAGS = \
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
$(XDR_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
$(WARN_CFLAGS) $(PIE_CFLAGS) \
$(COVERAGE_CFLAGS) \
-I$(srcdir)/access \
-I$(srcdir)/conf \
-I$(srcdir)/rpc \
$(NULL)
libvirtd_LDFLAGS = \
$(RELRO_LDFLAGS) \
$(PIE_LDFLAGS) \
$(COVERAGE_LDFLAGS) \
$(NO_INDIRECT_LDFLAGS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
libvirtd_LDADD = \
$(LIBXML_LIBS) \
$(GNUTLS_LIBS) \
$(SASL_LIBS) \
$(DBUS_LIBS) \
$(LIBNL_LIBS) \
$(NULL)
if WITH_DTRACE_PROBES
libvirtd_LDADD += ../src/libvirt_probes.lo
endif WITH_DTRACE_PROBES
libvirtd_LDADD += \
libvirt_driver_admin.la \
libvirt-lxc.la \
libvirt-qemu.la \
libvirt.la \
../gnulib/lib/libgnu.la $(LIBSOCKET) \
$(NULL)
endif WITH_LIBVIRTD
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl %protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
$< $(srcdir)/$(subst $(srcdir)/,,$@) $< $(srcdir)/$(subst $(srcdir)/,,$@)
@ -2620,7 +2703,7 @@ locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
cp $< $@ cp $< $@
sbin_PROGRAMS = virtlockd virtlogd sbin_PROGRAMS += virtlockd virtlogd
virtlockd_SOURCES = \ virtlockd_SOURCES = \
$(LOCK_DAEMON_SOURCES) \ $(LOCK_DAEMON_SOURCES) \
@ -3370,4 +3453,8 @@ endif WITH_NETWORK
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES) DISTCLEANFILES += $(GENERATED_SYM_FILES)
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED) MAINTAINERCLEANFILES += \
$(REMOTE_DRIVER_GENERATED) \
$(LIBVIRTD_GENERATED) \
$(VIR_NET_RPC_GENERATED) \
$(NULL)

View File

@ -1,7 +1,7 @@
/* /*
* libvirtd.c: daemon start of day, guest process & i/o management * remote_daemon.c: daemon start of day, guest process & i/o management
* *
* Copyright (C) 2006-2015 Red Hat, Inc. * Copyright (C) 2006-2018 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -40,8 +40,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU #define VIR_FROM_THIS VIR_FROM_QEMU
#include "libvirtd.h" #include "remote_daemon.h"
#include "libvirtd-config.h" #include "remote_daemon_config.h"
#include "admin/admin_server_dispatch.h" #include "admin/admin_server_dispatch.h"
#include "viruuid.h" #include "viruuid.h"
@ -50,7 +50,7 @@
#include "virconf.h" #include "virconf.h"
#include "virnetlink.h" #include "virnetlink.h"
#include "virnetdaemon.h" #include "virnetdaemon.h"
#include "remote.h" #include "remote_daemon_dispatch.h"
#include "virhook.h" #include "virhook.h"
#include "viraudit.h" #include "viraudit.h"
#include "virstring.h" #include "virstring.h"
@ -1466,9 +1466,7 @@ int main(int argc, char **argv) {
*/ */
if (statuswrite != -1) { if (statuswrite != -1) {
char status = 0; char status = 0;
while (write(statuswrite, &status, 1) == -1 && ignore_value(safewrite(statuswrite, &status, 1));
errno == EINTR)
;
VIR_FORCE_CLOSE(statuswrite); VIR_FORCE_CLOSE(statuswrite);
} }
@ -1534,9 +1532,7 @@ int main(int argc, char **argv) {
if (ret != 0) { if (ret != 0) {
/* Tell parent of daemon what failed */ /* Tell parent of daemon what failed */
char status = ret; char status = ret;
while (write(statuswrite, &status, 1) == -1 && ignore_value(safewrite(statuswrite, &status, 1));
errno == EINTR)
;
} }
VIR_FORCE_CLOSE(statuswrite); VIR_FORCE_CLOSE(statuswrite);
} }

View File

@ -1,7 +1,7 @@
/* /*
* libvirtd.h: daemon data structure definitions * remote_daemon.h: daemon data structure definitions
* *
* Copyright (C) 2006-2015 Red Hat, Inc. * Copyright (C) 2006-2018 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -22,8 +22,8 @@
*/ */
#ifndef LIBVIRTD_H__ #ifndef __REMOTE_DAEMON_H__
# define LIBVIRTD_H__ # define __REMOTE_DAEMON_H__
# define VIR_ENUM_SENTINELS # define VIR_ENUM_SENTINELS
@ -85,4 +85,4 @@ extern virNetSASLContextPtr saslCtxt;
extern virNetServerProgramPtr remoteProgram; extern virNetServerProgramPtr remoteProgram;
extern virNetServerProgramPtr qemuProgram; extern virNetServerProgramPtr qemuProgram;
#endif #endif /* __REMOTE_DAEMON_H__ */

View File

@ -1,7 +1,7 @@
/* /*
* libvirtd-config.c: daemon start of day, guest process & i/o management * remote_daemon_config.c: libvirtd config file handling
* *
* Copyright (C) 2006-2012, 2014, 2015 Red Hat, Inc. * Copyright (C) 2006-2018 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -23,15 +23,15 @@
#include <config.h> #include <config.h>
#include "libvirtd-config.h" #include "remote_daemon_config.h"
#include "virconf.h" #include "virconf.h"
#include "viralloc.h" #include "viralloc.h"
#include "virerror.h" #include "virerror.h"
#include "virlog.h" #include "virlog.h"
#include "rpc/virnetserver.h" #include "rpc/virnetserver.h"
#include "configmake.h" #include "configmake.h"
#include "remote/remote_protocol.h" #include "remote_protocol.h"
#include "remote/remote_driver.h" #include "remote_driver.h"
#include "util/virnetdevopenvswitch.h" #include "util/virnetdevopenvswitch.h"
#include "virstring.h" #include "virstring.h"
#include "virutil.h" #include "virutil.h"

View File

@ -1,7 +1,7 @@
/* /*
* libvirtd-config.h: daemon start of day, guest process & i/o management * remote_daemon_config.h: libvirtd config file handling
* *
* Copyright (C) 2006-2012, 2015 Red Hat, Inc. * Copyright (C) 2006-2018 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -21,8 +21,8 @@
* Author: Daniel P. Berrange <berrange@redhat.com> * Author: Daniel P. Berrange <berrange@redhat.com>
*/ */
#ifndef __LIBVIRTD_CONFIG_H__ #ifndef __REMOTE_DAEMON_CONFIG_H__
# define __LIBVIRTD_CONFIG_H__ # define __REMOTE_DAEMON_CONFIG_H__
# include "internal.h" # include "internal.h"
@ -106,4 +106,4 @@ int daemonConfigLoadData(struct daemonConfig *data,
const char *filename, const char *filename,
const char *filedata); const char *filedata);
#endif /* __LIBVIRTD_CONFIG_H__ */ #endif /* __REMOTE_DAEMON_CONFIG_H__ */

View File

@ -1,7 +1,7 @@
/* /*
* remote.c: handlers for RPC method calls * remote_daemon_dispatch.c: handlers for RPC method calls
* *
* Copyright (C) 2007-2015 Red Hat, Inc. * Copyright (C) 2007-2018 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -24,13 +24,13 @@
#include "virerror.h" #include "virerror.h"
#include "remote.h" #include "remote_daemon_dispatch.h"
#include "libvirtd.h" #include "remote_daemon.h"
#include "libvirt_internal.h" #include "libvirt_internal.h"
#include "datatypes.h" #include "datatypes.h"
#include "viralloc.h" #include "viralloc.h"
#include "virlog.h" #include "virlog.h"
#include "stream.h" #include "remote_daemon_stream.h"
#include "viruuid.h" #include "viruuid.h"
#include "vircommand.h" #include "vircommand.h"
#include "intprops.h" #include "intprops.h"
@ -108,9 +108,9 @@ remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors,
remote_domain_disk_error **ret_errors_val, remote_domain_disk_error **ret_errors_val,
u_int *ret_errors_len); u_int *ret_errors_len);
#include "remote_dispatch.h" #include "remote_daemon_dispatch_stubs.h"
#include "qemu_dispatch.h" #include "remote_daemon_dispatch_qemu_stubs.h"
#include "lxc_dispatch.h" #include "remote_daemon_dispatch_lxc_stubs.h"
/* Prototypes */ /* Prototypes */

View File

@ -1,7 +1,7 @@
/* /*
* remote.h: handlers for RPC method calls * remote_daemon_dispatch.h: handlers for RPC method calls
* *
* Copyright (C) 2007, 2008, 2009 Red Hat, Inc. * Copyright (C) 2007-2018 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,8 +21,8 @@
* Author: Daniel P. Berrange <berrange@redhat.com> * Author: Daniel P. Berrange <berrange@redhat.com>
*/ */
#ifndef __LIBVIRTD_REMOTE_H__ #ifndef __REMOTE_DAEMON_DISPATCH_H__
# define __LIBVIRTD_REMOTE_H__ # define __REMOTE_DAEMON_DISPATCH_H__
# include "remote_protocol.h" # include "remote_protocol.h"
# include "rpc/virnetserverprogram.h" # include "rpc/virnetserverprogram.h"
@ -42,4 +42,4 @@ void remoteClientFree(void *data);
void *remoteClientNew(virNetServerClientPtr client, void *remoteClientNew(virNetServerClientPtr client,
void *opaque); void *opaque);
#endif /* __LIBVIRTD_REMOTE_H__ */ #endif /* __REMOTE_DAEMON_DISPATCH_H__ */

View File

@ -1,7 +1,7 @@
/* /*
* stream.c: APIs for managing client streams * remote_daemon_stream.c: APIs for managing client streams
* *
* Copyright (C) 2009-2014 Red Hat, Inc. * Copyright (C) 2009-2018 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -23,8 +23,8 @@
#include <config.h> #include <config.h>
#include "stream.h" #include "remote_daemon_stream.h"
#include "remote.h" #include "remote_daemon_dispatch.h"
#include "viralloc.h" #include "viralloc.h"
#include "virlog.h" #include "virlog.h"
#include "virnetserverclient.h" #include "virnetserverclient.h"

View File

@ -1,7 +1,7 @@
/* /*
* stream.h: APIs for managing client streams * remote_daemon_stream.h: APIs for managing client streams
* *
* Copyright (C) 2009 Red Hat, Inc. * Copyright (C) 2009-2018 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,10 +21,10 @@
*/ */
#ifndef __LIBVIRTD_STREAM_H__ #ifndef __REMOTE_DAEMON_STREAM_H__
# define __LIBVIRTD_STREAM_H__ # define __REMOTE_DAEMON_STREAM_H__
# include "libvirtd.h" # include "remote_daemon.h"
daemonClientStream * daemonClientStream *
daemonCreateClientStream(virNetServerClientPtr client, daemonCreateClientStream(virNetServerClientPtr client,
@ -47,4 +47,4 @@ daemonRemoveClientStream(virNetServerClientPtr client,
void void
daemonRemoveAllClientStreams(daemonClientStream *stream); daemonRemoveAllClientStreams(daemonClientStream *stream);
#endif /* __LIBVIRTD_STREAM_H__ */ #endif /* __REMOTE_DAEMON_STREAM_H__ */