mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
maint: avoid static zero init in helpers
C guarantees that static variables are zero-initialized. Some older compilers (and also gcc -fno-zero-initialized-in-bss) create larger binaries if you explicitly zero-initialize a static variable. * src/conf/nwfilter_conf.c: Fix initialization. * src/cpu/cpu_x86.c: Likewise. * src/interface/interface_backend_netcf.c: Likewise. * src/locking/lock_daemon.c: Likewise. * src/locking/lock_driver_lockd.c: Likewise. * src/locking/lock_driver_sanlock.c: Likewise. * src/network/bridge_driver.c: Likewise. * src/node_device/node_device_udev.c: Likewise. * src/nwfilter/nwfilter_learnipaddr.c: Likewise. * src/rpc/virnetserver.c: Likewise. * src/security/security_selinux.c (virSecuritySELinuxGenSecurityLabel): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
a396c11e92
commit
ff99c79195
@ -144,7 +144,7 @@ static const struct int_map chain_priorities[] = {
|
||||
* only one filter update allowed
|
||||
*/
|
||||
static virRWLock updateLock;
|
||||
static bool initialized = false;
|
||||
static bool initialized;
|
||||
|
||||
void
|
||||
virNWFilterReadLockFilterUpdates(void)
|
||||
|
@ -92,7 +92,7 @@ struct x86_map {
|
||||
struct x86_feature *migrate_blockers;
|
||||
};
|
||||
|
||||
static struct x86_map* virCPUx86Map = NULL;
|
||||
static struct x86_map* virCPUx86Map;
|
||||
int virCPUx86MapOnceInit(void);
|
||||
VIR_ONCE_GLOBAL_INIT(virCPUx86Map);
|
||||
|
||||
|
@ -63,7 +63,7 @@ virNetcfDriverStateOnceInit(void)
|
||||
|
||||
VIR_ONCE_GLOBAL_INIT(virNetcfDriverState)
|
||||
|
||||
static virNetcfDriverStatePtr driverState = NULL;
|
||||
static virNetcfDriverStatePtr driverState;
|
||||
|
||||
|
||||
static void
|
||||
|
@ -67,7 +67,7 @@ struct _virLockDaemon {
|
||||
|
||||
virLockDaemonPtr lockDaemon = NULL;
|
||||
|
||||
static bool execRestart = false;
|
||||
static bool execRestart;
|
||||
|
||||
enum {
|
||||
VIR_LOCK_DAEMON_ERR_NONE = 0,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* lock_driver_lockd.c: A lock driver which locks nothing
|
||||
*
|
||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
||||
* Copyright (C) 2010-2011, 2014 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
|
||||
@ -79,7 +79,7 @@ struct _virLockManagerLockDaemonDriver {
|
||||
char *scsiLockSpaceDir;
|
||||
};
|
||||
|
||||
static virLockManagerLockDaemonDriverPtr driver = NULL;
|
||||
static virLockManagerLockDaemonDriverPtr driver;
|
||||
|
||||
static int virLockManagerLockDaemonLoadConfig(const char *configFile)
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ struct _virLockManagerSanlockDriver {
|
||||
gid_t group;
|
||||
};
|
||||
|
||||
static virLockManagerSanlockDriver *driver = NULL;
|
||||
static virLockManagerSanlockDriver *driver;
|
||||
|
||||
struct _virLockManagerSanlockPrivate {
|
||||
const char *vm_uri;
|
||||
|
@ -126,7 +126,7 @@ static int networkUnplugBandwidth(virNetworkObjPtr net,
|
||||
static void networkNetworkObjTaint(virNetworkObjPtr net,
|
||||
virNetworkTaintFlags taint);
|
||||
|
||||
static virNetworkDriverStatePtr driverState = NULL;
|
||||
static virNetworkDriverStatePtr driverState;
|
||||
|
||||
static virNetworkObjPtr
|
||||
networkObjFromNetwork(virNetworkPtr net)
|
||||
|
@ -56,7 +56,7 @@ struct _udevPrivate {
|
||||
bool privileged;
|
||||
};
|
||||
|
||||
static virNodeDeviceDriverStatePtr driverState = NULL;
|
||||
static virNodeDeviceDriverStatePtr driverState;
|
||||
|
||||
static int udevStrToLong_ull(char const *s,
|
||||
char **end_ptr,
|
||||
|
@ -134,7 +134,7 @@ struct _virNWFilterIfaceLock {
|
||||
};
|
||||
|
||||
|
||||
static bool threadsTerminate = false;
|
||||
static bool threadsTerminate;
|
||||
|
||||
|
||||
int
|
||||
|
@ -817,8 +817,8 @@ void virNetServerRemoveShutdownInhibition(virNetServerPtr srv)
|
||||
|
||||
|
||||
|
||||
static sig_atomic_t sigErrors = 0;
|
||||
static int sigLastErrno = 0;
|
||||
static sig_atomic_t sigErrors;
|
||||
static int sigLastErrno;
|
||||
static int sigWrite = -1;
|
||||
|
||||
static void
|
||||
|
@ -641,7 +641,7 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr,
|
||||
if (!baselabel) {
|
||||
if (def->virtType == VIR_DOMAIN_VIRT_QEMU) {
|
||||
if (data->alt_domain_context == NULL) {
|
||||
static bool warned = false;
|
||||
static bool warned;
|
||||
if (!warned) {
|
||||
VIR_WARN("SELinux policy does not define a domain type for QEMU TCG. "
|
||||
"Guest startup may be denied due to missing 'execmem' privilege "
|
||||
|
Loading…
Reference in New Issue
Block a user