1ea77165a0
- libxl: don't hardcode scheduler weight 83edaf44-libxl-dont-hardcode-sched-weight.patch bsc#1086377 - libxl: fixes and improvements in migration APIs 64370c4b-libxl-MigrateBegin.patch, 99486799-libxl-MigrateConfirm.patch, f5eacf2a-libxl-MigratePerform.patch, 4e6fcdb6-libxl-libxlDomObjFromDomain-cleanup.patch, fe51dbda-libxl-use-FindByRef.patch, 60b3fcd9-libxl-MigratePrepare.patch, 3c89868c-libxl-lock-after-ListRemove.patch, 13e81fc6-libxl-EndJob-on-error.patch, 594b8b99-libxl-DefineXMLFlags-API-pattern.patch, c66e344e-libxl-dont-deref-NULL.patch bsc#1080957 OBS-URL: https://build.opensuse.org/request/show/589839 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=681
44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
commit 594b8b996c83724d6b1c73641daf277307afe5f7
|
|
Author: Jim Fehlig <jfehlig@suse.com>
|
|
Date: Fri Mar 16 15:29:48 2018 -0600
|
|
|
|
libxl: convert DefineXMLFlags to use begin/end API pattern
|
|
|
|
Similar to other uses of virDomainObjListAdd, on success add a ref to the
|
|
virDomainObj so that virDomainObjEndAPI can be called as usual.
|
|
|
|
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
|
|
Reviewed-by: John Ferlan <jferlan@redhat.com>
|
|
|
|
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
|
|
===================================================================
|
|
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
|
|
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
|
|
@@ -2794,6 +2794,7 @@ libxlDomainDefineXMLFlags(virConnectPtr
|
|
&oldDef)))
|
|
goto cleanup;
|
|
|
|
+ virObjectRef(vm);
|
|
def = NULL;
|
|
vm->persistent = 1;
|
|
|
|
@@ -2801,7 +2802,7 @@ libxlDomainDefineXMLFlags(virConnectPtr
|
|
cfg->caps,
|
|
vm->newDef ? vm->newDef : vm->def) < 0) {
|
|
virDomainObjListRemove(driver->domains, vm);
|
|
- vm = NULL;
|
|
+ virObjectLock(vm);
|
|
goto cleanup;
|
|
}
|
|
|
|
@@ -2815,8 +2816,7 @@ libxlDomainDefineXMLFlags(virConnectPtr
|
|
cleanup:
|
|
virDomainDefFree(def);
|
|
virDomainDefFree(oldDef);
|
|
- if (vm)
|
|
- virObjectUnlock(vm);
|
|
+ virDomainObjEndAPI(&vm);
|
|
if (event)
|
|
libxlDomainEventQueue(driver, event);
|
|
virObjectUnref(cfg);
|