From 4b53d0d4ac9c9379aaed28507a3ad1865494654f Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Wed, 24 Jun 2015 15:14:41 -0600 Subject: [PATCH] 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 --- src/libxl/libxl_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 6bcd34962f..b1b0e554d2 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -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; }