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
83 lines
3.0 KiB
Diff
83 lines
3.0 KiB
Diff
commit 64370c4b81f04ca73c195854966c6740e01483f2
|
|
Author: Jim Fehlig <jfehlig@suse.com>
|
|
Date: Mon Mar 12 11:51:43 2018 -0600
|
|
|
|
libxl: MigrateBegin: Dont call EndAPI in helper function
|
|
|
|
The libxlDomainMigrateBegin3Params API locks and ref counts the associated
|
|
virDomainObj but relies on the helper function libxlDomainMigrationBegin
|
|
to unref/unlock the object. libxlDomainMigrationBegin is also used by
|
|
libxlDomainMigratePerform3Params for p2p migration, but in that case the
|
|
lock/ref and unref/unlock are properly handled in the API entry point. So
|
|
p2p migrations suffer a double unref/unlock in the Perform API.
|
|
|
|
Remove the unref/unlock (virDomainObjEndAPI) from libxlDomainMigrationBegin
|
|
and adjust libxlDomainMigrateBegin3Params to properly unref/unlock
|
|
the virDomainObj on success and error paths.
|
|
|
|
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
|
|
@@ -5876,6 +5876,7 @@ libxlDomainMigrateBegin3Params(virDomain
|
|
{
|
|
const char *xmlin = NULL;
|
|
virDomainObjPtr vm = NULL;
|
|
+ char *xmlout = NULL;
|
|
|
|
#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
|
|
virReportUnsupportedError();
|
|
@@ -5895,25 +5896,26 @@ libxlDomainMigrateBegin3Params(virDomain
|
|
return NULL;
|
|
|
|
if (STREQ_NULLABLE(vm->def->name, "Domain-0")) {
|
|
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
- _("Domain-0 cannot be migrated"));
|
|
- return NULL;
|
|
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
+ _("Domain-0 cannot be migrated"));
|
|
+ goto cleanup;
|
|
}
|
|
|
|
- if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0) {
|
|
- virObjectUnlock(vm);
|
|
- return NULL;
|
|
- }
|
|
+ if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0)
|
|
+ goto cleanup;
|
|
|
|
if (!virDomainObjIsActive(vm)) {
|
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
|
"%s", _("domain is not running"));
|
|
- virObjectUnlock(vm);
|
|
- return NULL;
|
|
+ goto cleanup;
|
|
}
|
|
|
|
- return libxlDomainMigrationBegin(domain->conn, vm, xmlin,
|
|
- cookieout, cookieoutlen);
|
|
+ xmlout = libxlDomainMigrationBegin(domain->conn, vm, xmlin,
|
|
+ cookieout, cookieoutlen);
|
|
+
|
|
+ cleanup:
|
|
+ virDomainObjEndAPI(&vm);
|
|
+ return xmlout;
|
|
}
|
|
|
|
static int
|
|
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
|
|
===================================================================
|
|
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
|
|
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
|
|
@@ -443,7 +443,6 @@ libxlDomainMigrationBegin(virConnectPtr
|
|
|
|
cleanup:
|
|
libxlMigrationCookieFree(mig);
|
|
- virDomainObjEndAPI(&vm);
|
|
virDomainDefFree(tmpdef);
|
|
virObjectUnref(cfg);
|
|
return xml;
|