提交 8bf61249 编写于 作者: A Anya Harter 提交者: Ján Tomko

events: remove umlDomainEventQueue wrapper func

And replace all calls with virObjectEventStateQueue such that:

    umlDomainEventQueue(driver, event);

becomes:

    virObjectEventStateQueue(driver->domainEventState, event);

And remove NULL checking from all callers.
Signed-off-by: NAnya Harter <aharter@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 b8504924
......@@ -125,8 +125,6 @@ static int umlOpenMonitor(struct uml_driver *driver,
virDomainObjPtr vm);
static int umlReadPidFile(struct uml_driver *driver,
virDomainObjPtr vm);
static void umlDomainEventQueue(struct uml_driver *driver,
virObjectEventPtr event);
static int umlStartVMDaemon(virConnectPtr conn,
struct uml_driver *driver,
......@@ -228,8 +226,7 @@ umlAutostartDomain(virDomainObjPtr vm,
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_BOOTED);
if (event)
umlDomainEventQueue(data->driver, event);
virObjectEventStateQueue(data->driver->domainEventState, event);
}
}
virObjectUnlock(vm);
......@@ -425,10 +422,8 @@ umlInotifyEvent(int watch,
}
}
virDomainObjEndAPI(&dom);
if (event) {
umlDomainEventQueue(driver, event);
event = NULL;
}
virObjectEventStateQueue(driver->domainEventState, event);
event = NULL;
}
cleanup:
......@@ -646,8 +641,7 @@ static void umlNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED);
if (event)
umlDomainEventQueue(driver, event);
virObjectEventStateQueue(driver->domainEventState, event);
}
}
......@@ -783,8 +777,7 @@ static int umlProcessAutoDestroyDom(void *payload,
virDomainObjListRemove(data->driver->domains, dom);
virDomainObjEndAPI(&dom);
if (event)
umlDomainEventQueue(data->driver, event);
virObjectEventStateQueue(data->driver->domainEventState, event);
virHashRemoveEntry(data->driver->autodestroy, uuidstr);
return 0;
}
......@@ -1615,8 +1608,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml,
cleanup:
virDomainDefFree(def);
virDomainObjEndAPI(&vm);
if (event)
umlDomainEventQueue(driver, event);
virObjectEventStateQueue(driver->domainEventState, event);
umlDriverUnlock(driver);
virNWFilterUnlockFilterUpdates();
return dom;
......@@ -1689,8 +1681,7 @@ umlDomainDestroyFlags(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
if (event)
umlDomainEventQueue(driver, event);
virObjectEventStateQueue(driver->domainEventState, event);
umlDriverUnlock(driver);
return ret;
}
......@@ -1949,8 +1940,7 @@ static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
cleanup:
virDomainObjEndAPI(&vm);
if (event)
umlDomainEventQueue(driver, event);
virObjectEventStateQueue(driver->domainEventState, event);
umlDriverUnlock(driver);
virNWFilterUnlockFilterUpdates();
return ret;
......@@ -2587,13 +2577,6 @@ umlConnectDomainEventDeregisterAny(virConnectPtr conn,
}
/* driver must be locked before calling */
static void umlDomainEventQueue(struct uml_driver *driver,
virObjectEventPtr event)
{
virObjectEventStateQueue(driver->domainEventState, event);
}
static int umlConnectListAllDomains(virConnectPtr conn,
virDomainPtr **domains,
unsigned int flags)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册