]> xenbits.xensource.com Git - libvirt.git/commitdiff
don't disable state driver when libvirtd is not built
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 19 Jan 2015 16:56:04 +0000 (16:56 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 27 Jan 2015 12:02:04 +0000 (12:02 +0000)
A bunch of code is wrapped in #if WITH_LIBVIRTD in order to
enable the virStateDriver to be disabled when libvirtd is not
built. Disabling this code doesn't have any real functional
benefit beyond removing 1 pointer from the virConnectPtr struct,
while having a cost of many more conditionals.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/Makefile.am
src/driver.h
src/libvirt.c
src/libvirt_daemon.syms [deleted file]
src/libvirt_internal.h
src/libvirt_private.syms
src/remote/remote_driver.c

index 4bba5367c7ddc1702439f0006c8ffc812edecb59..1e2127919c68f154005f2d746c5cbdd305a9bf58 100644 (file)
@@ -1949,12 +1949,6 @@ else ! WITH_ESX
 SYM_FILES += $(srcdir)/libvirt_esx.syms
 endif ! WITH_ESX
 
-if WITH_LIBVIRTD
-USED_SYM_FILES += $(srcdir)/libvirt_daemon.syms
-else ! WITH_LIBVIRTD
-SYM_FILES += $(srcdir)/libvirt_daemon.syms
-endif ! WITH_LIBVIRTD
-
 if WITH_REMOTE
 USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
 else ! WITH_REMOTE
index f7e10a1cb8642a2e028f9dbc9f95c2fb39d48069..5b7862bd9e79d53238de1fb338224ceb109376f1 100644 (file)
@@ -91,9 +91,7 @@ typedef enum {
 # include "driver-nodedev.h"
 # include "driver-nwfilter.h"
 # include "driver-secret.h"
-# ifdef WITH_LIBVIRTD
-#  include "driver-state.h"
-# endif
+# include "driver-state.h"
 # include "driver-stream.h"
 # include "driver-storage.h"
 
@@ -106,9 +104,7 @@ int virRegisterNetworkDriver(virNetworkDriverPtr) ATTRIBUTE_RETURN_CHECK;
 int virRegisterNodeDeviceDriver(virNodeDeviceDriverPtr) ATTRIBUTE_RETURN_CHECK;
 int virRegisterNWFilterDriver(virNWFilterDriverPtr) ATTRIBUTE_RETURN_CHECK;
 int virRegisterSecretDriver(virSecretDriverPtr) ATTRIBUTE_RETURN_CHECK;
-# ifdef WITH_LIBVIRTD
 int virRegisterStateDriver(virStateDriverPtr) ATTRIBUTE_RETURN_CHECK;
-# endif
 int virRegisterStorageDriver(virStorageDriverPtr) ATTRIBUTE_RETURN_CHECK;
 
 void *virDriverLoadModule(const char *name);
index d51c01497f447d508320531f37dea5f5c61a230d..43eb95ca37879584a86570e16ae80b9baefd77f9 100644 (file)
@@ -135,10 +135,8 @@ static virSecretDriverPtr virSecretDriverTab[MAX_DRIVERS];
 static int virSecretDriverTabCount;
 static virNWFilterDriverPtr virNWFilterDriverTab[MAX_DRIVERS];
 static int virNWFilterDriverTabCount;
-#ifdef WITH_LIBVIRTD
 static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
 static int virStateDriverTabCount;
-#endif
 
 
 #if defined(POLKIT_AUTH)
@@ -691,7 +689,6 @@ virRegisterHypervisorDriver(virHypervisorDriverPtr driver)
 }
 
 
-#ifdef WITH_LIBVIRTD
 /**
  * virRegisterStateDriver:
  * @driver: pointer to a driver block
@@ -826,7 +823,6 @@ virStateStop(void)
     }
     return ret;
 }
-#endif /* WITH_LIBVIRTD */
 
 
 /**
diff --git a/src/libvirt_daemon.syms b/src/libvirt_daemon.syms
deleted file mode 100644 (file)
index 2855f00..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# These symbols are dependent upon --with-libvirtd via WITH_LIBVIRTD.
-#
-
-# libvirt_internal.h
-virRegisterStateDriver;
-virStateCleanup;
-virStateInitialize;
-virStateReload;
-virStateStop;
-
-# Let emacs know we want case-insensitive sorting
-# Local Variables:
-# sort-fold-case: t
-# End:
index 304d90fef0ea35e6f89f0cd5bf14045e82fb6582..1313b58753089a5be00912fd60b5637b8dfcabba 100644 (file)
 typedef void (*virStateInhibitCallback)(bool inhibit,
                                         void *opaque);
 
-# ifdef WITH_LIBVIRTD
 int virStateInitialize(bool privileged,
                        virStateInhibitCallback inhibit,
                        void *opaque);
 int virStateCleanup(void);
 int virStateReload(void);
 int virStateStop(void);
-# endif
 
 /* Feature detection.  This is a libvirt-private interface for determining
  * what features are supported by the driver.
index a8cd87f7ff76f12a88a676464715a5168acfec70..1b720557487d1df30fda7baebef7e7ff59edfdb6 100644 (file)
@@ -889,7 +889,12 @@ virRegisterNetworkDriver;
 virRegisterNodeDeviceDriver;
 virRegisterNWFilterDriver;
 virRegisterSecretDriver;
+virRegisterStateDriver;
 virRegisterStorageDriver;
+virStateCleanup;
+virStateInitialize;
+virStateReload;
+virStateStop;
 
 
 # locking/domain_lock.h
index 3cc603f973dac7c809faff4321534ccd4e7c28db..0ad05313fdb5c5c6aa5e14576cacb477d8f26bf4 100644 (file)
@@ -164,7 +164,6 @@ static void make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapsho
 /* Helper functions for remoteOpen. */
 static char *get_transport_from_scheme(char *scheme);
 
-#ifdef WITH_LIBVIRTD
 static int
 remoteStateInitialize(bool privileged ATTRIBUTE_UNUSED,
                       virStateInhibitCallback callback ATTRIBUTE_UNUSED,
@@ -176,7 +175,6 @@ remoteStateInitialize(bool privileged ATTRIBUTE_UNUSED,
     inside_daemon = true;
     return 0;
 }
-#endif
 
 
 static void
@@ -8433,12 +8431,10 @@ static virNWFilterDriver nwfilter_driver = {
 };
 
 
-#ifdef WITH_LIBVIRTD
 static virStateDriver state_driver = {
     .name = "Remote",
     .stateInitialize = remoteStateInitialize,
 };
-#endif
 
 
 /** remoteRegister:
@@ -8464,10 +8460,8 @@ remoteRegister(void)
         return -1;
     if (virRegisterNWFilterDriver(&nwfilter_driver) < 0)
         return -1;
-#ifdef WITH_LIBVIRTD
     if (virRegisterStateDriver(&state_driver) < 0)
         return -1;
-#endif
 
     return 0;
 }