提交 e4200bbb 编写于 作者: M Martin Kletzander

lxc: Don't crash by forgetting to ref transient domains

So commit 306b3a85 tried mimicking behaviour of commit 540c339a, but
added a virObjectRef(vm) only after virDomainObjListAdd() in
lxcDomainDefineXMLFlags() and not in lxcDomainCreateXMLWithFiles().
That way undefining a domain that was started with different XML than
defined will leave the domain object in a state with not enough
references to then remove it.  Hence any lxcDomainDestroyFlags() called
afterwards crashes the daemon.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1351057Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 0d55e0b2
......@@ -1247,6 +1247,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
virObjectRef(vm);
def = NULL;
if (virLXCDomainObjBeginJob(driver, vm, LXC_JOB_MODIFY) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册