return 0;
}
-/**
- * networkActive:
- *
- * Checks if the QEmu daemon is active, i.e. has an active domain or
- * an active network
- *
- * Returns 1 if active, 0 otherwise
- */
-static int
-networkActive(void) {
- unsigned int i;
- int active = 0;
-
- if (!driverState)
- return 0;
-
- networkDriverLock(driverState);
- for (i = 0 ; i < driverState->networks.count ; i++) {
- virNetworkObjPtr net = driverState->networks.objs[i];
- virNetworkObjLock(net);
- if (virNetworkObjIsActive(net))
- active = 1;
- virNetworkObjUnlock(net);
- }
- networkDriverUnlock(driverState);
- return active;
-}
/**
* networkShutdown:
.initialize = networkStartup,
.cleanup = networkShutdown,
.reload = networkReload,
- .active = networkActive,
};
int networkRegister(void) {
}
-static int halDeviceMonitorActive(void)
-{
- /* Always ready to deal with a shutdown */
- return 0;
-}
-
-
static virDrvOpenStatus halNodeDrvOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
unsigned int flags)
.initialize = halDeviceMonitorStartup, /* 0.5.0 */
.cleanup = halDeviceMonitorShutdown, /* 0.5.0 */
.reload = halDeviceMonitorReload, /* 0.5.0 */
- .active = halDeviceMonitorActive, /* 0.5.0 */
};
int halNodeRegister(void)
}
-static int udevDeviceMonitorActive(void)
-{
- /* Always ready to deal with a shutdown */
- return 0;
-}
-
-
static virDrvOpenStatus udevNodeDrvOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
unsigned int flags)
.initialize = udevDeviceMonitorStartup, /* 0.7.3 */
.cleanup = udevDeviceMonitorShutdown, /* 0.7.3 */
.reload = udevDeviceMonitorReload, /* 0.7.3 */
- .active = udevDeviceMonitorActive, /* 0.7.3 */
};
int udevNodeRegister(void)
return 0;
}
-/**
- * virNWFilterActive:
- *
- * Checks if the nwfilter driver is active, i.e. has an active nwfilter
- *
- * Returns 1 if active, 0 otherwise
- */
-static int
-nwfilterDriverActive(void) {
- int ret;
-
- if (!driverState)
- return 0;
-
- nwfilterDriverLock(driverState);
- ret = driverState->nwfilters.count ? 1 : 0;
- ret |= driverState->watchingFirewallD;
- nwfilterDriverUnlock(driverState);
-
- return ret;
-}
/**
* virNWFilterIsWatchingFirewallD:
.initialize = nwfilterDriverStartup,
.cleanup = nwfilterDriverShutdown,
.reload = nwfilterDriverReload,
- .active = nwfilterDriverActive,
};
return 0;
}
-/**
- * virStorageActive:
- *
- * Checks if the storage driver is active, i.e. has an active pool
- *
- * Returns 1 if active, 0 otherwise
- */
-static int
-storageDriverActive(void) {
- unsigned int i;
- int active = 0;
-
- if (!driverState)
- return 0;
-
- storageDriverLock(driverState);
-
- for (i = 0 ; i < driverState->pools.count ; i++) {
- virStoragePoolObjLock(driverState->pools.objs[i]);
- if (virStoragePoolObjIsActive(driverState->pools.objs[i]))
- active = 1;
- virStoragePoolObjUnlock(driverState->pools.objs[i]);
- }
-
- storageDriverUnlock(driverState);
- return active;
-}
/**
* virStorageShutdown:
.initialize = storageDriverStartup,
.cleanup = storageDriverShutdown,
.reload = storageDriverReload,
- .active = storageDriverActive,
};
int storageRegister(void) {