mirror of https://gitee.com/openkylin/libvirt.git
libxl: register for domain events immediately after creation
A small fix for the possiblitiy of jumping to an error path before registering for domain events, preventing receiving important ones like shutdown and death.
This commit is contained in:
parent
e20bf46741
commit
3d8a3d6e5b
|
@ -690,6 +690,9 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
|
|||
}
|
||||
|
||||
vm->def->id = domid;
|
||||
if (libxlDomEventsRegister(vm) < 0)
|
||||
goto error;
|
||||
|
||||
if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
|
||||
goto error;
|
||||
|
||||
|
@ -700,9 +703,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (libxlDomEventsRegister(vm) < 0)
|
||||
goto error;
|
||||
|
||||
if (libxlDomainSetVcpuAffinities(driver, vm) < 0)
|
||||
goto error;
|
||||
|
||||
|
|
Loading…
Reference in New Issue