[sandbox v2 06/11] Remove init-common dependency on libvirt-sandbox.so

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

 



Removing this dependency avoids getting all libvirt.so dependencies
loaded in our container.
---
 libvirt-sandbox/Makefile.am                        | 34 ++++++++----
 libvirt-sandbox/libvirt-sandbox-config-all.h       | 62 ++++++++++++++++++++++
 libvirt-sandbox/libvirt-sandbox-config-disk.c      |  2 +-
 libvirt-sandbox/libvirt-sandbox-config-initrd.c    |  2 +-
 .../libvirt-sandbox-config-interactive.c           |  2 +-
 .../libvirt-sandbox-config-mount-file.c            |  2 +-
 .../libvirt-sandbox-config-mount-guest-bind.c      |  2 +-
 .../libvirt-sandbox-config-mount-host-bind.c       |  2 +-
 .../libvirt-sandbox-config-mount-host-image.c      |  2 +-
 libvirt-sandbox/libvirt-sandbox-config-mount-ram.c |  2 +-
 libvirt-sandbox/libvirt-sandbox-config-mount.c     |  2 +-
 .../libvirt-sandbox-config-network-address.c       |  2 +-
 ...rt-sandbox-config-network-filterref-parameter.c |  2 +-
 .../libvirt-sandbox-config-network-filterref.c     |  2 +-
 .../libvirt-sandbox-config-network-route.c         |  2 +-
 libvirt-sandbox/libvirt-sandbox-config-network.c   |  2 +-
 .../libvirt-sandbox-config-service-generic.c       |  2 +-
 .../libvirt-sandbox-config-service-systemd.c       |  2 +-
 libvirt-sandbox/libvirt-sandbox-config-service.c   |  2 +-
 libvirt-sandbox/libvirt-sandbox-config.c           |  2 +-
 libvirt-sandbox/libvirt-sandbox-init-common.c      |  5 +-
 libvirt-sandbox/libvirt-sandbox-util.c             |  2 +-
 22 files changed, 105 insertions(+), 34 deletions(-)
 create mode 100644 libvirt-sandbox/libvirt-sandbox-config-all.h

diff --git a/libvirt-sandbox/Makefile.am b/libvirt-sandbox/Makefile.am
index 1cd6ea3..7b3ea27 100644
--- a/libvirt-sandbox/Makefile.am
+++ b/libvirt-sandbox/Makefile.am
@@ -50,10 +50,7 @@ SANDBOX_RPC_FILES = \
 			libvirt-sandbox-rpcpacket.h \
 			$(NULL)
 
-SANDBOX_HEADER_FILES = \
-			libvirt-sandbox.h \
-			libvirt-sandbox-main.h \
-			libvirt-sandbox-util.h \
+SANDBOX_CONFIG_HEADER_FILES = \
 			libvirt-sandbox-config.h \
 			libvirt-sandbox-config-disk.h \
 			libvirt-sandbox-config-network.h \
@@ -72,6 +69,12 @@ SANDBOX_HEADER_FILES = \
 			libvirt-sandbox-config-service.h \
 			libvirt-sandbox-config-service-systemd.h \
 			libvirt-sandbox-config-service-generic.h \
+			$(NULL)
+
+SANDBOX_HEADER_FILES = \
+			libvirt-sandbox.h \
+			libvirt-sandbox-main.h \
+			libvirt-sandbox-util.h \
 			libvirt-sandbox-builder.h \
 			libvirt-sandbox-builder-initrd.h \
 			libvirt-sandbox-builder-machine.h \
@@ -82,9 +85,10 @@ SANDBOX_HEADER_FILES = \
 			libvirt-sandbox-context.h \
 			libvirt-sandbox-context-interactive.h \
 			libvirt-sandbox-context-service.h \
+			$(SANDBOX_CONFIG_HEADER_FILES) \
 			$(NULL)
-SANDBOX_SOURCE_FILES = \
-			libvirt-sandbox-main.c \
+
+SANDBOX_CONFIG_SOURCE_FILES = \
 			libvirt-sandbox-util.c \
 			libvirt-sandbox-config.c \
 			libvirt-sandbox-config-disk.c \
@@ -104,6 +108,10 @@ SANDBOX_SOURCE_FILES = \
 			libvirt-sandbox-config-service.c \
 			libvirt-sandbox-config-service-systemd.c \
 			libvirt-sandbox-config-service-generic.c \
+			$(NULL)
+
+SANDBOX_SOURCE_FILES = \
+			libvirt-sandbox-main.c \
 			libvirt-sandbox-builder.c \
 			libvirt-sandbox-builder-initrd.c \
 			libvirt-sandbox-builder-machine.c \
@@ -115,6 +123,8 @@ SANDBOX_SOURCE_FILES = \
 			libvirt-sandbox-context.c \
 			libvirt-sandbox-context-interactive.c \
 			libvirt-sandbox-context-service.c \
+			libvirt-sandbox-config-all.h \
+			$(SANDBOX_CONFIG_SOURCE_FILES) \
 			$(NULL)
 
 libvirt_sandbox_1_0_ladir = $(includedir)/libvirt-sandbox-1.0/libvirt-sandbox
@@ -169,31 +179,33 @@ libvirt_sandbox_1_0_la_LDFLAGS = \
 libvirt_sandbox_init_common_SOURCES = libvirt-sandbox-init-common.c \
 			$(SANDBOX_GENERATED_RPC_FILES) \
 			$(SANDBOX_RPC_FILES) \
+			$(SANDBOX_CONFIG_HEADER_FILES) \
+			$(SANDBOX_CONFIG_SOURCE_FILES) \
 			$(NULL)
 libvirt_sandbox_init_common_CFLAGS = \
 			-DLIBEXECDIR="\"$(libexecdir)\"" \
 			-DSANDBOXCONFIGDIR="\"$(sandboxconfigdir)\"" \
 			-DLOCALEDIR="\"$(datadir)/locale"\" \
+			-DLIBVIRT_SANDBOX_BUILD \
 			$(COVERAGE_CFLAGS) \
 			-I$(top_srcdir) \
 			-I$(top_builddir) \
+			$(LIBVIRT_GCONFIG_CFLAGS) \
 			$(GIO_UNIX_CFLAGS) \
-			$(LIBVIRT_GLIB_CFLAGS) \
-			$(LIBVIRT_GOBJECT_CFLAGS) \
 			$(CAPNG_CFLAGS) \
+			$(SELINUX_CFLAGS) \
 			$(WARN_CFLAGS) \
 			$(NULL)
 libvirt_sandbox_init_common_LDFLAGS = \
 			-lutil \
 			$(COVERAGE_CFLAGS:-f%=-Wc,f%) \
 			$(GIO_UNIX_LIBS) \
-			$(LIBVIRT_GLIB_LIBS) \
-			$(LIBVIRT_GOBJECT_LIBS) \
+			$(LIBVIRT_GCONFIG_LIBS) \
 			$(CAPNG_LIBS) \
+			$(SELINUX_LIBS) \
 			$(WARN_CFLAGS) \
 			$(NULL)
 libvirt_sandbox_init_common_LDADD = \
-			libvirt-sandbox-1.0.la \
 			$(NULL)
 
 libvirt_sandbox_init_lxc_SOURCES = libvirt-sandbox-init-lxc.c
diff --git a/libvirt-sandbox/libvirt-sandbox-config-all.h b/libvirt-sandbox/libvirt-sandbox-config-all.h
new file mode 100644
index 0000000..8cb25c4
--- /dev/null
+++ b/libvirt-sandbox/libvirt-sandbox-config-all.h
@@ -0,0 +1,62 @@
+/*
+ * libvirt-sandbox.h: libvirt sandbox integration
+[ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Author: Daniel P. Berrange <berrange@xxxxxxxxxx>
+ */
+
+#ifndef __LIBVIRT_SANDBOX_CONFIG_ALL_H__
+#define __LIBVIRT_SANDBOX_CONFIG_ALL_H__
+
+/* External include */
+#include <libvirt-gconfig/libvirt-gconfig.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+/* Local includes */
+#include <libvirt-sandbox/libvirt-sandbox-util.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-disk.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-mount.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-mount-file.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-mount-host-bind.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-mount-host-image.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-mount-guest-bind.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-mount-ram.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-network-address.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-network-filterref-parameter.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-network-filterref.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-network-route.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-network.h>
+#include <libvirt-sandbox/libvirt-sandbox-config.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-initrd.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-interactive.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-service.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-service-systemd.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-service-generic.h>
+
+#endif /* __LIBVIRT_SANDBOX_CONFIG_ALL_H__ */
+
+/*
+ * Local variables:
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ *  indent-tabs-mode: nil
+ *  tab-width: 8
+ * End:
+ */
diff --git a/libvirt-sandbox/libvirt-sandbox-config-disk.c b/libvirt-sandbox/libvirt-sandbox-config-disk.c
index 0781714..9837735 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-disk.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-disk.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-disk
diff --git a/libvirt-sandbox/libvirt-sandbox-config-initrd.c b/libvirt-sandbox/libvirt-sandbox-config-initrd.c
index f272053..ed35c36 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-initrd.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-initrd.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-initrd
diff --git a/libvirt-sandbox/libvirt-sandbox-config-interactive.c b/libvirt-sandbox/libvirt-sandbox-config-interactive.c
index 82d9431..27b4c16 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-interactive.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-interactive.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-interactive
diff --git a/libvirt-sandbox/libvirt-sandbox-config-mount-file.c b/libvirt-sandbox/libvirt-sandbox-config-mount-file.c
index d6a3122..e53929f 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-mount-file.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-mount-file.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-mount-file
diff --git a/libvirt-sandbox/libvirt-sandbox-config-mount-guest-bind.c b/libvirt-sandbox/libvirt-sandbox-config-mount-guest-bind.c
index 5b3b87f..061f625 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-mount-guest-bind.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-mount-guest-bind.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-mount-guest-bind
diff --git a/libvirt-sandbox/libvirt-sandbox-config-mount-host-bind.c b/libvirt-sandbox/libvirt-sandbox-config-mount-host-bind.c
index d65f51f..c0c911b 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-mount-host-bind.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-mount-host-bind.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-mount-host-bind
diff --git a/libvirt-sandbox/libvirt-sandbox-config-mount-host-image.c b/libvirt-sandbox/libvirt-sandbox-config-mount-host-image.c
index 37573ef..cf7ce49 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-mount-host-image.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-mount-host-image.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-mount-image
diff --git a/libvirt-sandbox/libvirt-sandbox-config-mount-ram.c b/libvirt-sandbox/libvirt-sandbox-config-mount-ram.c
index f4ad6e2..1e0c352 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-mount-ram.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-mount-ram.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-mount-ram
diff --git a/libvirt-sandbox/libvirt-sandbox-config-mount.c b/libvirt-sandbox/libvirt-sandbox-config-mount.c
index b84199e..21a8684 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-mount.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-mount.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-mount
diff --git a/libvirt-sandbox/libvirt-sandbox-config-network-address.c b/libvirt-sandbox/libvirt-sandbox-config-network-address.c
index b2e58dc..68b0268 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network-address.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network-address.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-network_address
diff --git a/libvirt-sandbox/libvirt-sandbox-config-network-filterref-parameter.c b/libvirt-sandbox/libvirt-sandbox-config-network-filterref-parameter.c
index 5086ac6..2807b4f 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network-filterref-parameter.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network-filterref-parameter.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-network-filterref-parameter
diff --git a/libvirt-sandbox/libvirt-sandbox-config-network-filterref.c b/libvirt-sandbox/libvirt-sandbox-config-network-filterref.c
index c0c8e01..1770c0b 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network-filterref.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network-filterref.c
@@ -24,7 +24,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-network-filterref
diff --git a/libvirt-sandbox/libvirt-sandbox-config-network-route.c b/libvirt-sandbox/libvirt-sandbox-config-network-route.c
index 311b2e7..1664d18 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network-route.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network-route.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-network_route
diff --git a/libvirt-sandbox/libvirt-sandbox-config-network.c b/libvirt-sandbox/libvirt-sandbox-config-network.c
index 2bb55bf..df21700 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-network
diff --git a/libvirt-sandbox/libvirt-sandbox-config-service-generic.c b/libvirt-sandbox/libvirt-sandbox-config-service-generic.c
index a9e8858..d1118c2 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-service-generic.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-service-generic.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-service-generic
diff --git a/libvirt-sandbox/libvirt-sandbox-config-service-systemd.c b/libvirt-sandbox/libvirt-sandbox-config-service-systemd.c
index 8436a25..dc2e4a5 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-service-systemd.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-service-systemd.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-service-systemd
diff --git a/libvirt-sandbox/libvirt-sandbox-config-service.c b/libvirt-sandbox/libvirt-sandbox-config-service.c
index a99f42a..388ec63 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-service.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-service.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #include <string.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 /**
  * SECTION: libvirt-sandbox-config-service
diff --git a/libvirt-sandbox/libvirt-sandbox-config.c b/libvirt-sandbox/libvirt-sandbox-config.c
index 6057213..b9c13a7 100644
--- a/libvirt-sandbox/libvirt-sandbox-config.c
+++ b/libvirt-sandbox/libvirt-sandbox-config.c
@@ -26,7 +26,7 @@
 
 #include <glib/gi18n.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 #include "libvirt-sandbox/libvirt-sandbox-util.h"
 #include <errno.h>
 #include <selinux/selinux.h>
diff --git a/libvirt-sandbox/libvirt-sandbox-init-common.c b/libvirt-sandbox/libvirt-sandbox-init-common.c
index 27c2924..1652ff2 100644
--- a/libvirt-sandbox/libvirt-sandbox-init-common.c
+++ b/libvirt-sandbox/libvirt-sandbox-init-common.c
@@ -22,7 +22,7 @@
 
 #include <config.h>
 
-#include <libvirt-sandbox/libvirt-sandbox.h>
+#include <libvirt-sandbox/libvirt-sandbox-config-all.h>
 #include <glib/gi18n.h>
 
 #include <stdio.h>
@@ -1225,9 +1225,6 @@ int main(int argc, char **argv) {
         exit(EXIT_FAILURE);
     }
 
-    if (!gvir_sandbox_init_check(&argc, &argv, &error))
-        exit(EXIT_FAILURE);
-
     g_set_application_name(_("Libvirt Sandbox Init Common"));
 
     context = g_option_context_new (_("- Libvirt Sandbox"));
diff --git a/libvirt-sandbox/libvirt-sandbox-util.c b/libvirt-sandbox/libvirt-sandbox-util.c
index 07a2287..6385291 100644
--- a/libvirt-sandbox/libvirt-sandbox-util.c
+++ b/libvirt-sandbox/libvirt-sandbox-util.c
@@ -25,7 +25,7 @@
 #include <errno.h>
 #include <glib/gi18n.h>
 
-#include "libvirt-sandbox/libvirt-sandbox.h"
+#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
 
 #define GVIR_SANDBOX_UTIL_ERROR gvir_sandbox_util_error_quark()
 
-- 
2.1.4

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