int deletedEvents;
} lifecycleEventCounter;
-static void
-lifecycleEventCounter_reset(lifecycleEventCounter *counter)
-{
- counter->startEvents = 0;
- counter->stopEvents = 0;
- counter->defineEvents = 0;
- counter->undefineEvents = 0;
- counter->unexpectedEvents = 0;
- counter->createdEvents = 0;
- counter->deletedEvents = 0;
-}
typedef struct {
virConnectPtr conn;
testDomainCreateXMLOld(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virDomainPtr dom = NULL;
int ret = -1;
bool registered = false;
- lifecycleEventCounter_reset(&counter);
-
if (virConnectDomainEventRegister(test->conn,
domainLifecycleCb,
&counter, NULL) != 0)
testDomainCreateXMLNew(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int eventId = VIR_DOMAIN_EVENT_ID_LIFECYCLE;
virDomainPtr dom = NULL;
int id;
int ret = -1;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectDomainEventRegisterAny(test->conn, NULL, eventId,
VIR_DOMAIN_EVENT_CALLBACK(&domainLifecycleCb),
&counter, NULL);
testDomainCreateXMLMixed(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virDomainPtr dom;
int ret = -1;
int id1 = -1;
int id2 = -1;
bool registered = false;
- lifecycleEventCounter_reset(&counter);
-
/* Fun with mixing old and new API, also with global and
* per-domain. Handler should be fired three times, once for each
* registration. */
testDomainDefine(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int eventId = VIR_DOMAIN_EVENT_ID_LIFECYCLE;
virDomainPtr dom = NULL;
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectDomainEventRegisterAny(test->conn, NULL, eventId,
VIR_DOMAIN_EVENT_CALLBACK(&domainLifecycleCb),
&counter, NULL);
testDomainStartStopEvent(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int eventId = VIR_DOMAIN_EVENT_ID_LIFECYCLE;
int id;
int ret = -1;
virConnectPtr conn2 = NULL;
virDomainPtr dom2 = NULL;
- lifecycleEventCounter_reset(&counter);
-
dom = virDomainLookupByName(test->conn, "test");
if (dom == NULL)
return -1;
testNetworkCreateXML(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virNetworkPtr net;
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectNetworkEventRegisterAny(test->conn, NULL,
VIR_NETWORK_EVENT_ID_LIFECYCLE,
VIR_NETWORK_EVENT_CALLBACK(&networkLifecycleCb),
testNetworkDefine(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virNetworkPtr net;
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectNetworkEventRegisterAny(test->conn, NULL,
VIR_NETWORK_EVENT_ID_LIFECYCLE,
VIR_NETWORK_EVENT_CALLBACK(&networkLifecycleCb),
testNetworkStartStopEvent(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int id;
int ret = 0;
if (!test->net)
return -1;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectNetworkEventRegisterAny(test->conn, test->net,
VIR_NETWORK_EVENT_ID_LIFECYCLE,
VIR_NETWORK_EVENT_CALLBACK(&networkLifecycleCb),
testStoragePoolCreateXML(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virStoragePoolPtr pool;
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectStoragePoolEventRegisterAny(test->conn, NULL,
VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE,
VIR_STORAGE_POOL_EVENT_CALLBACK(&storagePoolLifecycleCb),
testStoragePoolDefine(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virStoragePoolPtr pool;
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectStoragePoolEventRegisterAny(test->conn, NULL,
VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE,
VIR_STORAGE_POOL_EVENT_CALLBACK(&storagePoolLifecycleCb),
testStoragePoolStartStopEvent(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int refreshCounter;
int id1, id2;
int ret = 0;
if (!test->pool)
return -1;
- lifecycleEventCounter_reset(&counter);
refreshCounter = 0;
id1 = virConnectStoragePoolEventRegisterAny(test->conn, test->pool,
testStoragePoolBuild(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectStoragePoolEventRegisterAny(test->conn, NULL,
VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE,
VIR_STORAGE_POOL_EVENT_CALLBACK(&storagePoolLifecycleCb),
testStoragePoolDelete(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectStoragePoolEventRegisterAny(test->conn, NULL,
VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE,
VIR_STORAGE_POOL_EVENT_CALLBACK(&storagePoolLifecycleCb),
testNodeDeviceCreateXML(const void *data)
{
const objecteventTest *test = data;
- lifecycleEventCounter counter;
+ lifecycleEventCounter counter = { 0 };
virNodeDevicePtr dev;
int id;
int ret = 0;
- lifecycleEventCounter_reset(&counter);
-
id = virConnectNodeDeviceEventRegisterAny(test->conn, NULL,
VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE,
VIR_NODE_DEVICE_EVENT_CALLBACK(&nodeDeviceLifecycleCb),