|
|
6ae9ed |
From b7eb93d486c0c855e6a21c5f67ed658a52a7e8fa Mon Sep 17 00:00:00 2001
|
|
|
6ae9ed |
Message-Id: <b7eb93d486c0c855e6a21c5f67ed658a52a7e8fa@dist-git>
|
|
|
6ae9ed |
From: Martin Kletzander <mkletzan@redhat.com>
|
|
|
6ae9ed |
Date: Sun, 24 Jul 2016 09:43:35 +0200
|
|
|
6ae9ed |
Subject: [PATCH] lxc: Don't crash by forgetting to ref transient domains
|
|
|
6ae9ed |
|
|
|
6ae9ed |
So commit 306b3a8504 tried mimicking behaviour of commit 540c339a25, but
|
|
|
6ae9ed |
added a virObjectRef(vm) only after virDomainObjListAdd() in
|
|
|
6ae9ed |
lxcDomainDefineXMLFlags() and not in lxcDomainCreateXMLWithFiles().
|
|
|
6ae9ed |
That way undefining a domain that was started with different XML than
|
|
|
6ae9ed |
defined will leave the domain object in a state with not enough
|
|
|
6ae9ed |
references to then remove it. Hence any lxcDomainDestroyFlags() called
|
|
|
6ae9ed |
afterwards crashes the daemon.
|
|
|
6ae9ed |
|
|
|
6ae9ed |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1351057
|
|
|
6ae9ed |
|
|
|
6ae9ed |
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
6ae9ed |
(cherry picked from commit e4200bbb9d9bbc58a51ca55c6073146126447afb)
|
|
|
6ae9ed |
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
6ae9ed |
---
|
|
|
6ae9ed |
src/lxc/lxc_driver.c | 1 +
|
|
|
6ae9ed |
1 file changed, 1 insertion(+)
|
|
|
6ae9ed |
|
|
|
6ae9ed |
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
|
|
6ae9ed |
index a3fa770..80b7a5c 100644
|
|
|
6ae9ed |
--- a/src/lxc/lxc_driver.c
|
|
|
6ae9ed |
+++ b/src/lxc/lxc_driver.c
|
|
|
6ae9ed |
@@ -1249,6 +1249,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
|
|
|
6ae9ed |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
|
|
|
6ae9ed |
NULL)))
|
|
|
6ae9ed |
goto cleanup;
|
|
|
6ae9ed |
+ virObjectRef(vm);
|
|
|
6ae9ed |
def = NULL;
|
|
|
6ae9ed |
|
|
|
6ae9ed |
if (virLXCDomainObjBeginJob(driver, vm, LXC_JOB_MODIFY) < 0) {
|
|
|
6ae9ed |
--
|
|
|
6ae9ed |
2.9.2
|
|
|
6ae9ed |
|