There is no need to have the libvirt-admin.so library definition in the
src directory. In addition the library uses directly code from admin
sub-directory so move the remaining bits there as well.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
docs/Makefile.am | 2 +-
docs/apibuild.py | 3 +-
m4/virt-win-symbols.m4 | 4 +-
po/POTFILES | 2 +-
src/Makefile.am | 81 +-------------------
src/admin/Makefile.inc.am | 87 +++++++++++++++++++++-
src/{ => admin}/libvirt-admin.c | 0
src/{ => admin}/libvirt-admin.conf | 0
src/{ => admin}/libvirt_admin_private.syms | 0
src/{ => admin}/libvirt_admin_public.syms | 0
10 files changed, 95 insertions(+), 84 deletions(-)
rename src/{ => admin}/libvirt-admin.c (100%)
rename src/{ => admin}/libvirt-admin.conf (100%)
rename src/{ => admin}/libvirt_admin_private.syms (100%)
rename src/{ => admin}/libvirt_admin_public.syms (100%)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 10476902a9..5b2896bbe5 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -315,7 +315,7 @@ $(APIBUILD_STAMP): $(srcdir)/apibuild.py \
$(top_srcdir)/src/libvirt-stream.c \
$(top_srcdir)/src/libvirt-lxc.c \
$(top_srcdir)/src/libvirt-qemu.c \
- $(top_srcdir)/src/libvirt-admin.c \
+ $(top_srcdir)/src/admin/libvirt-admin.c \
$(top_srcdir)/src/util/virerror.c \
$(top_srcdir)/src/util/virevent.c \
$(top_srcdir)/src/util/virtypedparam-public.c
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 4f0d170975..e79ead0b53 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -67,7 +67,7 @@ lxc_included_files = {
admin_included_files = {
"libvirt-admin.h": "header with admin specific API definitions",
- "libvirt-admin.c": "Implementations for the admin specific APIs",
+ "admin/libvirt-admin.c": "Implementations for the admin specific
APIs",
}
ignored_words = {
@@ -2549,6 +2549,7 @@ class app:
if not quiet:
print("Rebuilding API description for %s" % name)
dirs = [srcdir + "/../src",
+ srcdir + "/../src/admin",
srcdir + "/../src/util",
srcdir + "/../include/libvirt"]
if (builddir and
diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4
index 3b2038e6bf..66dd3b7b1c 100644
--- a/m4/virt-win-symbols.m4
+++ b/m4/virt-win-symbols.m4
@@ -19,7 +19,7 @@ dnl
AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [
LIBVIRT_SYMBOL_FILE=libvirt.syms
- LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.syms
+ LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms
LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms'
LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms'
case "$host" in
@@ -28,7 +28,7 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [
# from libvirt.syms and passes libvirt.def instead of libvirt.syms to the
# linker
LIBVIRT_SYMBOL_FILE=libvirt.def
- LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.def
+ LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def
LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def
LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def
;;
diff --git a/po/POTFILES b/po/POTFILES
index 8a6df49eeb..8e863dfbea 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -5,6 +5,7 @@ src/access/viraccessmanager.c
src/admin/admin_server.c
src/admin/admin_server_dispatch.c
src/admin/admin_server_dispatch_stubs.h
+src/admin/libvirt-admin.c
src/bhyve/bhyve_capabilities.c
src/bhyve/bhyve_command.c
src/bhyve/bhyve_device.c
@@ -68,7 +69,6 @@ src/hyperv/hyperv_wmi.c
src/interface/interface_backend_netcf.c
src/interface/interface_backend_udev.c
src/internal.h
-src/libvirt-admin.c
src/libvirt-domain-checkpoint.c
src/libvirt-domain-snapshot.c
src/libvirt-domain.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 937f5216da..56b1ed48cb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -65,6 +65,7 @@ MAINTAINERCLEANFILES =
nodist_conf_DATA =
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
+lib_LTLIBRARIES =
noinst_LTLIBRARIES =
mod_LTLIBRARIES =
INSTALL_DATA_DIRS =
@@ -145,12 +146,12 @@ SECDRIVER_LIBS += $(APPARMOR_LIBS)
endif WITH_SECDRIVER_APPARMOR
-lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
+lib_LTLIBRARIES += libvirt.la libvirt-qemu.la libvirt-lxc.la
moddir = $(libdir)/libvirt/connection-driver
confdir = $(sysconfdir)/libvirt
-conf_DATA += libvirt.conf libvirt-admin.conf
+conf_DATA += libvirt.conf
CLEANFILES += $(nodist_conf_DATA)
BUILT_SOURCES += $(nodist_conf_DATA)
@@ -276,19 +277,12 @@ if WITH_LINUX
check-symfile: libvirt.syms libvirt.la
$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
.libs/libvirt.so
-check-admin-symfile: libvirt_admin.syms libvirt-admin.la
- $(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
- .libs/libvirt-admin.so
else ! WITH_LINUX
check-symfile:
-check-admin-symfile:
endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
$(srcdir) $(SYM_FILES)
-check-admin-symsorting:
- $(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
- $(srcdir) $(ADMIN_SYM_FILES)
EXTRA_DIST += check-symfile.pl check-symsorting.pl
# Keep this list synced with RPC_PROBE_FILES
@@ -339,7 +333,6 @@ check-drivername:
$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
$(srcdir)/driver.h \
$(srcdir)/libvirt_public.syms \
- $(srcdir)/libvirt_admin_public.syms \
$(srcdir)/libvirt_qemu.syms \
$(srcdir)/libvirt_lxc.syms
@@ -366,7 +359,7 @@ EXTRA_DIST += check-driverimpls.pl check-aclrules.pl
check-aclperms.pl
check-local: check-protocol check-symfile check-symsorting \
check-drivername check-driverimpls check-aclrules \
- check-aclperms check-admin-symfile check-admin-symsorting
+ check-aclperms check-admin
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
@@ -393,7 +386,6 @@ SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
- libvirt_admin.syms libvirt_admin.def \
$(NULL)
@@ -480,9 +472,7 @@ EXTRA_DIST += \
libvirt_public.syms \
libvirt_lxc.syms \
libvirt_qemu.syms \
- libvirt_admin_public.syms \
$(SYM_FILES) \
- $(ADMIN_SYM_FILES) \
$(NULL)
BUILT_SOURCES += $(GENERATED_SYM_FILES)
@@ -509,69 +499,6 @@ libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
chmod a-w $@-tmp && \
mv $@-tmp $@
-libvirt_admin.syms: libvirt_admin_public.syms $(ADMIN_SYM_FILES) \
- $(top_builddir)/config.status
- $(AM_V_GEN)rm -f $@-tmp $@ ; \
- printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp
&& \
- cat $(srcdir)/libvirt_admin_public.syms >>$@-tmp && \
- printf '\n\n# Private symbols\n\n' >>$@-tmp && \
- printf 'LIBVIRT_ADMIN_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \
- printf 'global:\n\n' >>$@-tmp && \
- cat $(ADMIN_SYM_FILES) >>$@-tmp && \
- printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
- chmod a-w $@-tmp && \
- mv $@-tmp libvirt_admin.syms
-
-
-lib_LTLIBRARIES += libvirt-admin.la
-libvirt_admin_la_SOURCES = \
- libvirt-admin.c \
- $(ADMIN_PROTOCOL_GENERATED) \
- $(DATATYPES_SOURCES)
-
-libvirt_admin_la_LDFLAGS = \
- $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
- -version-info $(LIBVIRT_VERSION_INFO) \
- $(LIBVIRT_NODELETE) \
- $(AM_LDFLAGS) \
- $(NULL)
-
-libvirt_admin_la_LIBADD = \
- libvirt.la \
- $(CYGWIN_EXTRA_LIBADD)
-
-libvirt_admin_la_CFLAGS = \
- $(AM_CFLAGS) \
- -I$(srcdir)/remote \
- -I$(srcdir)/rpc \
- -I$(srcdir)/admin
-
-libvirt_admin_la_CFLAGS += \
- $(XDR_CFLAGS) \
- $(CAPNG_CFLAGS) \
- $(YAJL_CFLAGS) \
- $(SSH2_CFLAGS) \
- $(SASL_CFLAGS) \
- $(GNUTLS_CFLAGS) \
- $(LIBSSH_CFLAGS)
-
-libvirt_admin_la_LIBADD += \
- $(CAPNG_LIBS) \
- $(YAJL_LIBS) \
- $(DEVMAPPER_LIBS) \
- $(LIBXML_LIBS) \
- $(GLIB_LIBS) \
- $(SSH2_LIBS) \
- $(SASL_LIBS) \
- $(GNUTLS_LIBS) \
- $(LIBSSH_LIBS)
-
-ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms
-
-if WITH_DTRACE_PROBES
-libvirt_admin_la_LIBADD += libvirt_probes.lo
-endif WITH_DTRACE_PROBES
-
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
libvirt_la_LDFLAGS = \
diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am
index 4cc588a47c..4fd7878e5c 100644
--- a/src/admin/Makefile.inc.am
+++ b/src/admin/Makefile.inc.am
@@ -40,10 +40,80 @@ libvirt_driver_admin_la_CFLAGS += \
$(NULL)
endif WITH_SASL
-# admin/admin_remote.c is being included in libvirt-admin.c, so we
+GENERATED_SYM_FILES += admin/libvirt_admin.syms admin/libvirt_admin.def
+
+ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms
+
+# admin/admin_remote.c is being included in admin/libvirt-admin.c, so we
# need to include it in the dist
-EXTRA_DIST += admin/admin_remote.c
+EXTRA_DIST += \
+ admin/admin_remote.c \
+ admin/libvirt_admin_public.syms \
+ $(ADMIN_SYM_FILES) \
+ $(NULL)
+conf_DATA += admin/libvirt-admin.conf
+
+lib_LTLIBRARIES += libvirt-admin.la
+
+libvirt_admin_la_SOURCES = \
+ admin/libvirt-admin.c \
+ $(ADMIN_PROTOCOL_GENERATED) \
+ $(DATATYPES_SOURCES)
+
+libvirt_admin_la_LDFLAGS = \
+ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
+ -version-info $(LIBVIRT_VERSION_INFO) \
+ $(LIBVIRT_NODELETE) \
+ $(AM_LDFLAGS) \
+ $(NULL)
+
+libvirt_admin_la_LIBADD = \
+ libvirt.la \
+ $(CYGWIN_EXTRA_LIBADD) \
+ $(CAPNG_LIBS) \
+ $(YAJL_LIBS) \
+ $(DEVMAPPER_LIBS) \
+ $(LIBXML_LIBS) \
+ $(GLIB_LIBS) \
+ $(SSH2_LIBS) \
+ $(SASL_LIBS) \
+ $(GNUTLS_LIBS) \
+ $(LIBSSH_LIBS)
+
+if WITH_DTRACE_PROBES
+libvirt_admin_la_LIBADD += libvirt_probes.lo
+endif WITH_DTRACE_PROBES
+
+libvirt_admin_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ -I$(srcdir)/remote \
+ -I$(srcdir)/rpc \
+ $(XDR_CFLAGS) \
+ $(CAPNG_CFLAGS) \
+ $(YAJL_CFLAGS) \
+ $(SSH2_CFLAGS) \
+ $(SASL_CFLAGS) \
+ $(GNUTLS_CFLAGS) \
+ $(LIBSSH_CFLAGS)
+
+if WITH_LINUX
+check-admin-symfile: admin/libvirt_admin.syms libvirt-admin.la
+ $(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl admin/libvirt_admin.syms \
+ .libs/libvirt-admin.so
+else ! WITH_LINUX
+check-admin-symfile:
+endif ! WITH_LINUX
+
+check-admin-symsorting:
+ $(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
+ $(srcdir) $(ADMIN_SYM_FILES)
+
+check-admin-drivername:
+ $(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
+ $(srcdir)/admin/libvirt_admin_public.syms
+
+check-admin: check-admin-symfile check-admin-symsorting check-admin-drivername
admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \
$(ADMIN_PROTOCOL) Makefile.am
@@ -56,3 +126,16 @@ admin/admin_server_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
admin ADMIN $(ADMIN_PROTOCOL) \
$(srcdir)/admin/admin_server_dispatch_stubs.h
+
+admin/libvirt_admin.syms: admin/libvirt_admin_public.syms $(ADMIN_SYM_FILES) \
+ $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-tmp $@ ; \
+ printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp
&& \
+ cat $(srcdir)/admin/libvirt_admin_public.syms >>$@-tmp && \
+ printf '\n\n# Private symbols\n\n' >>$@-tmp && \
+ printf 'LIBVIRT_ADMIN_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \
+ printf 'global:\n\n' >>$@-tmp && \
+ cat $(ADMIN_SYM_FILES) >>$@-tmp && \
+ printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
+ chmod a-w $@-tmp && \
+ mv $@-tmp admin/libvirt_admin.syms
diff --git a/src/libvirt-admin.c b/src/admin/libvirt-admin.c
similarity index 100%
rename from src/libvirt-admin.c
rename to src/admin/libvirt-admin.c
diff --git a/src/libvirt-admin.conf b/src/admin/libvirt-admin.conf
similarity index 100%
rename from src/libvirt-admin.conf
rename to src/admin/libvirt-admin.conf
diff --git a/src/libvirt_admin_private.syms b/src/admin/libvirt_admin_private.syms
similarity index 100%
rename from src/libvirt_admin_private.syms
rename to src/admin/libvirt_admin_private.syms
diff --git a/src/libvirt_admin_public.syms b/src/admin/libvirt_admin_public.syms
similarity index 100%
rename from src/libvirt_admin_public.syms
rename to src/admin/libvirt_admin_public.syms
--
2.21.0