mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
don't disable state driver when libvirtd is not built
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>
This commit is contained in:
parent
f35fa0fd95
commit
220c01aa0a
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
|
||||
|
||||
/**
|
||||
|
@ -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:
|
@ -30,14 +30,12 @@
|
||||
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.
|
||||
|
@ -889,7 +889,12 @@ virRegisterNetworkDriver;
|
||||
virRegisterNodeDeviceDriver;
|
||||
virRegisterNWFilterDriver;
|
||||
virRegisterSecretDriver;
|
||||
virRegisterStateDriver;
|
||||
virRegisterStorageDriver;
|
||||
virStateCleanup;
|
||||
virStateInitialize;
|
||||
virStateReload;
|
||||
virStateStop;
|
||||
|
||||
|
||||
# locking/domain_lock.h
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user