From nobody Thu Apr 25 01:00:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152096216139388.42442701671212; Tue, 13 Mar 2018 10:29:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 22FB428203; Tue, 13 Mar 2018 17:29:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E800D2AE48; Tue, 13 Mar 2018 17:29:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A1BA3181BA1A; Tue, 13 Mar 2018 17:29:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DHR9tk005529 for ; Tue, 13 Mar 2018 13:27:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 73C1E18E3F; Tue, 13 Mar 2018 17:27:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64E1B5DD6E; Tue, 13 Mar 2018 17:27:05 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4FE5CC057FA3; Tue, 13 Mar 2018 17:27:04 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Tue, 13 Mar 2018 11:27:03 -0600 From: Jim Fehlig To: libvir-list@redhat.com Date: Tue, 13 Mar 2018 11:26:31 -0600 Message-Id: <20180313172634.27237-2-jfehlig@suse.com> In-Reply-To: <20180313172634.27237-1-jfehlig@suse.com> References: <20180313172634.27237-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 13 Mar 2018 17:27:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 13 Mar 2018 17:27:04 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] libxl: MigrateBegin: Dont call EndAPI in helper function X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Mar 2018 17:29:20 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: John Ferlan --- src/libxl/libxl_driver.c | 24 +++++++++++++----------- src/libxl/libxl_migration.c | 1 - 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index c3616a86d..eff13e5aa 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -5876,6 +5876,7 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain, { const char *xmlin =3D NULL; virDomainObjPtr vm =3D NULL; + char *xmlout =3D NULL; =20 #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME virReportUnsupportedError(); @@ -5895,25 +5896,26 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain, return NULL; =20 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; } =20 - if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0) { - virObjectUnlock(vm); - return NULL; - } + if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0) + goto cleanup; =20 if (!virDomainObjIsActive(vm)) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("domain is not running")); - virObjectUnlock(vm); - return NULL; + goto cleanup; } =20 - return libxlDomainMigrationBegin(domain->conn, vm, xmlin, - cookieout, cookieoutlen); + xmlout =3D libxlDomainMigrationBegin(domain->conn, vm, xmlin, + cookieout, cookieoutlen); + + cleanup: + virDomainObjEndAPI(&vm); + return xmlout; } =20 static int diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index ccf2daed1..4b848c920 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -443,7 +443,6 @@ libxlDomainMigrationBegin(virConnectPtr conn, =20 cleanup: libxlMigrationCookieFree(mig); - virDomainObjEndAPI(&vm); virDomainDefFree(tmpdef); virObjectUnref(cfg); return xml; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 01:00:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520962036246948.8347561439515; Tue, 13 Mar 2018 10:27:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 126FD800; Tue, 13 Mar 2018 17:27:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C44DF60471; Tue, 13 Mar 2018 17:27:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 877091806103; Tue, 13 Mar 2018 17:27:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DHR902005540 for ; Tue, 13 Mar 2018 13:27:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED02D1820E; Tue, 13 Mar 2018 17:27:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FF8E5E1CB; Tue, 13 Mar 2018 17:27:07 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30CB213D19; Tue, 13 Mar 2018 17:27:05 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Tue, 13 Mar 2018 11:27:03 -0600 From: Jim Fehlig To: libvir-list@redhat.com Date: Tue, 13 Mar 2018 11:26:32 -0600 Message-Id: <20180313172634.27237-3-jfehlig@suse.com> In-Reply-To: <20180313172634.27237-1-jfehlig@suse.com> References: <20180313172634.27237-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Mar 2018 17:27:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Mar 2018 17:27:05 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] libxl: MigrateConfirm: Dont unlock virDomainObj in helper function X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 13 Mar 2018 17:27:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The libxlDomainMigrateConfirm3Params API locks and ref counts the associated virDomainObj but relies on the helper function libxlDomainMigrationConfirm to unlock the object. Unref'ing the object is not done in either function. libxlDomainMigrationConfirm 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. Remove the unlock from libxlDomainMigrationConfirm and adjust libxlDomainMigrateConfirm3Params to properly unref/unlock the virDomainObj on success and error paths. Signed-off-by: Jim Fehlig Reviewed-by: John Ferlan --- src/libxl/libxl_driver.c | 13 ++++++++----- src/libxl/libxl_migration.c | 2 -- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index eff13e5aa..67a638da0 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -6161,6 +6161,7 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain, { libxlDriverPrivatePtr driver =3D domain->conn->privateData; virDomainObjPtr vm =3D NULL; + int ret =3D -1; =20 #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME virReportUnsupportedError(); @@ -6174,12 +6175,14 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domai= n, if (!(vm =3D libxlDomObjFromDomain(domain))) return -1; =20 - if (virDomainMigrateConfirm3ParamsEnsureACL(domain->conn, vm->def) < 0= ) { - virObjectUnlock(vm); - return -1; - } + if (virDomainMigrateConfirm3ParamsEnsureACL(domain->conn, vm->def) < 0) + goto cleanup; =20 - return libxlDomainMigrationConfirm(driver, vm, flags, cancelled); + ret =3D libxlDomainMigrationConfirm(driver, vm, flags, cancelled); + + cleanup: + virDomainObjEndAPI(&vm); + return ret; } =20 static int libxlNodeGetSecurityModel(virConnectPtr conn, diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index 4b848c920..fef1c998b 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -1400,8 +1400,6 @@ libxlDomainMigrationConfirm(libxlDriverPrivatePtr dri= ver, cleanup: if (event) libxlDomainEventQueue(driver, event); - if (vm) - virObjectUnlock(vm); virObjectUnref(cfg); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 01:00:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520962048513266.33348199030854; Tue, 13 Mar 2018 10:27:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 080E183F43; Tue, 13 Mar 2018 17:27:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFAB09C4E7; Tue, 13 Mar 2018 17:27:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9A626181BA03; Tue, 13 Mar 2018 17:27:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DHRBmt005546 for ; Tue, 13 Mar 2018 13:27:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01A8D17C21; Tue, 13 Mar 2018 17:27:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88A265D6A6; Tue, 13 Mar 2018 17:27:07 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 294A237EE7; Tue, 13 Mar 2018 17:27:06 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Tue, 13 Mar 2018 11:27:04 -0600 From: Jim Fehlig To: libvir-list@redhat.com Date: Tue, 13 Mar 2018 11:26:33 -0600 Message-Id: <20180313172634.27237-4-jfehlig@suse.com> In-Reply-To: <20180313172634.27237-1-jfehlig@suse.com> References: <20180313172634.27237-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 13 Mar 2018 17:27:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 13 Mar 2018 17:27:06 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] libxl: MigratePrepare: properly cleanup after virDomainObjListAdd X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 13 Mar 2018 17:27:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" libxlDomainMigrationPrepare adds the incoming domain def to the list of domains via virDomainObjListAdd, which returns a locked and ref counted virDomainObj. On exit the object is unlocked but not unref'ed. The same is true for libxlDomainMigrationPrepareTunnel3. Convert both to use the virDomainObjEndAPI function for cleanup. Signed-off-by: Jim Fehlig --- src/libxl/libxl_migration.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index fef1c998b..6b53f9587 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -639,9 +639,7 @@ libxlDomainMigrationPrepareTunnel3(virConnectPtr dconn, } =20 done: - if (vm) - virObjectUnlock(vm); - + virDomainObjEndAPI(&vm); return ret; } =20 @@ -820,8 +818,7 @@ libxlDomainMigrationPrepare(virConnectPtr dconn, VIR_FREE(hostname); else virURIFree(uri); - if (vm) - virObjectUnlock(vm); + virDomainObjEndAPI(&vm); virObjectUnref(cfg); return ret; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 01:00:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520962049326605.8241376448935; Tue, 13 Mar 2018 10:27:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D90167FEA1; Tue, 13 Mar 2018 17:27:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7EEB5DD6E; Tue, 13 Mar 2018 17:27:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 74E004CA9A; Tue, 13 Mar 2018 17:27:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DHRCAv005562 for ; Tue, 13 Mar 2018 13:27:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 269569C4EC; Tue, 13 Mar 2018 17:27:12 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1AF760BE7; Tue, 13 Mar 2018 17:27:07 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DA7F80C22; Tue, 13 Mar 2018 17:27:06 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Tue, 13 Mar 2018 11:27:04 -0600 From: Jim Fehlig To: libvir-list@redhat.com Date: Tue, 13 Mar 2018 11:26:34 -0600 Message-Id: <20180313172634.27237-5-jfehlig@suse.com> In-Reply-To: <20180313172634.27237-1-jfehlig@suse.com> References: <20180313172634.27237-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 13 Mar 2018 17:27:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 13 Mar 2018 17:27:06 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] libxl: MigratePerform: properly cleanup after libxlDomObjFromDomain X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 13 Mar 2018 17:27:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ibxlDomObjFromDomain to returns locked and ref counted virDomainObj but libxlDomainMigratePerform3Params only unlocks the object on exit. Convert it to use the virDomainObjEndAPI function for cleanup. Signed-off-by: Jim Fehlig Reviewed-by: John Ferlan --- src/libxl/libxl_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 67a638da0..6f1c69b1d 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -6086,8 +6086,7 @@ libxlDomainMigratePerform3Params(virDomainPtr dom, ret =3D 0; =20 cleanup: - if (vm) - virObjectUnlock(vm); + virDomainObjEndAPI(&vm); return ret; } =20 --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list