]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ch_driver: End job properly on failed chDomainCreateXML()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Feb 2022 14:58:12 +0000 (15:58 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 11 Feb 2022 09:48:32 +0000 (10:48 +0100)
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@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/ch/ch_driver.c

index b023f7e3d377e480808d4da86b2b7295a911ad35..cd156a222bf1526ad3c4dc883c8321c51d2708f7 100644 (file)
@@ -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: