ch_driver: End job properly on failed chDomainCreateXML()

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>
This commit is contained in:
Michal Privoznik 2022-02-10 15:58:12 +01:00
parent b928e0d80c
commit 3d13f6abcd

View 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: