libxl: don't remove persistent domain on start failure

libxlDomainCreateXML() would remove a persistent domain if
libxlDomainStart() failed.  Check if domain is persistent
before removing.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2015-06-24 15:14:41 -06:00
parent 29b154e29a
commit 4b53d0d4ac

View File

@ -918,7 +918,10 @@ libxlDomainCreateXML(virConnectPtr conn, const char *xml,
if (libxlDomainStart(driver, vm, (flags & VIR_DOMAIN_START_PAUSED) != 0,
-1) < 0) {
virDomainObjListRemove(driver->domains, vm);
if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
vm = NULL;
}
goto endjob;
}