[PATCH 4/6] ch_driver: End job properly on failed chDomainCreateXML()

Michal Privoznik mprivozn at redhat.com
Thu Feb 10 15:51:32 UTC 2022


When creating a domain failed, then the virCHDomainObjEndJob()
would be jumped over. Fix this by creating enjob label and fixing
one goto.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/ch/ch_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
index b023f7e3d3..cd156a222b 100644
--- a/src/ch/ch_driver.c
+++ b/src/ch/ch_driver.c
@@ -228,10 +228,11 @@ chDomainCreateXML(virConnectPtr conn,
         goto cleanup;
 
     if (virCHProcessStart(driver, vm, VIR_DOMAIN_RUNNING_BOOTED) < 0)
-        goto cleanup;
+        goto endjob;
 
     dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
 
+ endjob:
     virCHDomainObjEndJob(vm);
 
  cleanup:
-- 
2.34.1




More information about the libvir-list mailing list