From nobody Thu Apr 18 01:01:07 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542892594657429.65360718443696; Thu, 22 Nov 2018 05:16:34 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1709F3084033; Thu, 22 Nov 2018 13:16:33 +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 D1EF45D76C; Thu, 22 Nov 2018 13:16:32 +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 7D12E4EA3D; Thu, 22 Nov 2018 13:16:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAMDGLOn027998 for ; Thu, 22 Nov 2018 08:16:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 36ED56012B; Thu, 22 Nov 2018 13:16:21 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF093604CD for ; Thu, 22 Nov 2018 13:16:20 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 22 Nov 2018 14:16:15 +0100 Message-Id: <58026cad5123a85ed852f8c32c14c9278b9fb700.1542892462.git.mprivozn@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] qemuMigrationDstPrepareAny: Don't overwrite error in cleanup path 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 22 Nov 2018 13:16:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There are several functions called in the cleanup path. Some of them do report error (e.g. qemuDomainRemoveInactiveJob()) which may result in overwriting an error reported earlier with some less useful message. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 67940330aa..317df4bed5 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2282,6 +2282,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, { virDomainObjPtr vm =3D NULL; virObjectEventPtr event =3D NULL; + virErrorPtr origErr; int ret =3D -1; int dataFD[2] =3D { -1, -1 }; qemuDomainObjPrivatePtr priv =3D NULL; @@ -2595,6 +2596,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, ret =3D 0; =20 cleanup: + virErrorPreserveLast(&origErr); VIR_FREE(tlsAlias); qemuProcessIncomingDefFree(incoming); VIR_FREE(xmlout); @@ -2618,6 +2620,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, qemuMigrationCookieFree(mig); virObjectUnref(caps); virNWFilterUnlockFilterUpdates(); + virErrorRestore(&origErr); return ret; =20 stopjob: --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 01:01:07 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542892586153157.23571103156223; Thu, 22 Nov 2018 05:16:26 -0800 (PST) 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 08A6080F82; Thu, 22 Nov 2018 13:16:24 +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 B8B1C60478; Thu, 22 Nov 2018 13:16:23 +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 E2880181B9E4; Thu, 22 Nov 2018 13:16:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAMDGMdn028106 for ; Thu, 22 Nov 2018 08:16:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1225F83EAC; Thu, 22 Nov 2018 13:16:22 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 861166012B for ; Thu, 22 Nov 2018 13:16:21 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 22 Nov 2018 14:16:16 +0100 Message-Id: <749b2e90192d4673ea4a9bb854bc5b46a38e7d57.1542892462.git.mprivozn@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] qemuMigrationEatCookie: Pass virDomainDef instead of virDomainObj 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.27]); Thu, 22 Nov 2018 13:16:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The function currently takes virDomainObjPtr because it's using both: the domain definition and domain private data. Unfortunately, this means that in prepare phase we can't parse migration cookie before putting incoming domain def onto domain objects list (addressed in the very next commit). Change the arguments so that virDomainDef and private data are passed instead of virDomainObjPtr. Signed-off-by: Michal Privoznik --- src/qemu/qemu_migration.c | 16 ++++++++++------ src/qemu/qemu_migration_cookie.c | 23 ++++++++++++----------- src/qemu/qemu_migration_cookie.h | 4 +++- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 317df4bed5..28d3a72e32 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2041,7 +2041,8 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, if (!(flags & VIR_MIGRATE_OFFLINE)) cookieFlags |=3D QEMU_MIGRATION_COOKIE_CAPS; =20 - if (!(mig =3D qemuMigrationEatCookie(driver, vm, NULL, 0, 0))) + if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, + priv->origname, NULL, NULL, 0, 0))) goto cleanup; =20 if (qemuMigrationBakeCookie(mig, driver, vm, @@ -2411,7 +2412,8 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, priv->hookRun =3D true; } =20 - if (!(mig =3D qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, + if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, origname, NULL, + cookiein, cookieinlen, QEMU_MIGRATION_COOKIE_LOCKSTATE | QEMU_MIGRATION_COOKIE_NBD | QEMU_MIGRATION_COOKIE_MEMORY_HOTPLU= G | @@ -2922,7 +2924,8 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, ? QEMU_MIGRATION_PHASE_CONFIRM3 : QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED); =20 - if (!(mig =3D qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, + if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, = priv, + cookiein, cookieinlen, QEMU_MIGRATION_COOKIE_STATS))) goto cleanup; =20 @@ -3427,7 +3430,8 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, } } =20 - mig =3D qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, + mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, NULL, + cookiein, cookieinlen, cookieFlags | QEMU_MIGRATION_COOKIE_GRAPHICS | QEMU_MIGRATION_COOKIE_CAPS); @@ -4948,8 +4952,8 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, * even though VIR_MIGRATE_PERSIST_DEST was not used. */ cookie_flags |=3D QEMU_MIGRATION_COOKIE_PERSISTENT; =20 - if (!(mig =3D qemuMigrationEatCookie(driver, vm, cookiein, - cookieinlen, cookie_flags))) + if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, = NULL, + cookiein, cookieinlen, cookie_flags= ))) goto endjob; =20 if (flags & VIR_MIGRATE_OFFLINE) { diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 60df449d53..295e28ae30 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -279,22 +279,22 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driv= er ATTRIBUTE_UNUSED, =20 =20 static qemuMigrationCookiePtr -qemuMigrationCookieNew(virDomainObjPtr dom) +qemuMigrationCookieNew(const virDomainDef *def, + const char *origname) { - qemuDomainObjPrivatePtr priv =3D dom->privateData; qemuMigrationCookiePtr mig =3D NULL; const char *name; =20 if (VIR_ALLOC(mig) < 0) goto error; =20 - if (priv->origname) - name =3D priv->origname; + if (origname) + name =3D origname; else - name =3D dom->def->name; + name =3D def->name; if (VIR_STRDUP(mig->name, name) < 0) goto error; - memcpy(mig->uuid, dom->def->uuid, VIR_UUID_BUFLEN); + memcpy(mig->uuid, def->uuid, VIR_UUID_BUFLEN); =20 if (!(mig->localHostname =3D virGetHostname())) goto error; @@ -1472,12 +1472,13 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig, =20 qemuMigrationCookiePtr qemuMigrationEatCookie(virQEMUDriverPtr driver, - virDomainObjPtr dom, + const virDomainDef *def, + const char *origname, + qemuDomainObjPrivatePtr priv, const char *cookiein, int cookieinlen, unsigned int flags) { - qemuDomainObjPrivatePtr priv =3D dom->privateData; qemuMigrationCookiePtr mig =3D NULL; =20 /* Parse & validate incoming cookie (if any) */ @@ -1490,7 +1491,7 @@ qemuMigrationEatCookie(virQEMUDriverPtr driver, =20 VIR_DEBUG("cookielen=3D%d cookie=3D'%s'", cookieinlen, NULLSTR(cookiei= n)); =20 - if (!(mig =3D qemuMigrationCookieNew(dom))) + if (!(mig =3D qemuMigrationCookieNew(def, origname))) return NULL; =20 if (cookiein && cookieinlen && @@ -1502,9 +1503,9 @@ qemuMigrationEatCookie(virQEMUDriverPtr driver, =20 if (flags & QEMU_MIGRATION_COOKIE_PERSISTENT && mig->persistent && - STRNEQ(dom->def->name, mig->persistent->name)) { + STRNEQ(def->name, mig->persistent->name)) { VIR_FREE(mig->persistent->name); - if (VIR_STRDUP(mig->persistent->name, dom->def->name) < 0) + if (VIR_STRDUP(mig->persistent->name, def->name) < 0) goto error; } =20 diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_coo= kie.h index 08c5de8f06..b399787074 100644 --- a/src/qemu/qemu_migration_cookie.h +++ b/src/qemu/qemu_migration_cookie.h @@ -160,7 +160,9 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig, =20 qemuMigrationCookiePtr qemuMigrationEatCookie(virQEMUDriverPtr driver, - virDomainObjPtr dom, + const virDomainDef *def, + const char *origname, + qemuDomainObjPrivatePtr priv, const char *cookiein, int cookieinlen, unsigned int flags); --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 01:01:07 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542892599816511.02159875010284; Thu, 22 Nov 2018 05:16:39 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11C5188E51; Thu, 22 Nov 2018 13:16:38 +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 D3A695C543; Thu, 22 Nov 2018 13:16:37 +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 8ABC84EA3D; Thu, 22 Nov 2018 13:16:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAMDGMv9028175 for ; Thu, 22 Nov 2018 08:16:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id DA1A56012B; Thu, 22 Nov 2018 13:16:22 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DC8C83E8C for ; Thu, 22 Nov 2018 13:16:22 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 22 Nov 2018 14:16:17 +0100 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] qemuMigrationDstPrepareAny: Parse cookie before adding domain onto list 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 22 Nov 2018 13:16:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There are some checks done when parsing a migration cookie. For instance, one of the checks ensures that the domain is not being migrated onto the same host. If that is the case, then we are in big trouble because the @vm is the same domain object used by source and it has some jobs sets and everything so recovering from failed cookie parsing would be needlessly hard. Signed-off-by: Michal Privoznik --- src/qemu/qemu_migration.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 28d3a72e32..3875ea828f 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2395,6 +2395,20 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, } } =20 + /* Parse cookie earlier than adding the domain onto the + * domain list. Parsing/validation may fail and there's no + * point in having the domain in the list at that point. */ + if (!(mig =3D qemuMigrationEatCookie(driver, *def, origname, NULL, + cookiein, cookieinlen, + QEMU_MIGRATION_COOKIE_LOCKSTATE | + QEMU_MIGRATION_COOKIE_NBD | + QEMU_MIGRATION_COOKIE_MEMORY_HOTPLU= G | + QEMU_MIGRATION_COOKIE_CPU_HOTPLUG | + QEMU_MIGRATION_COOKIE_CPU | + QEMU_MIGRATION_COOKIE_ALLOW_REBOOT | + QEMU_MIGRATION_COOKIE_CAPS))) + goto cleanup; + if (!(vm =3D virDomainObjListAdd(driver->domains, *def, driver->xmlopt, VIR_DOMAIN_OBJ_LIST_ADD_LIVE | @@ -2412,17 +2426,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, priv->hookRun =3D true; } =20 - if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, origname, NULL, - cookiein, cookieinlen, - QEMU_MIGRATION_COOKIE_LOCKSTATE | - QEMU_MIGRATION_COOKIE_NBD | - QEMU_MIGRATION_COOKIE_MEMORY_HOTPLU= G | - QEMU_MIGRATION_COOKIE_CPU_HOTPLUG | - QEMU_MIGRATION_COOKIE_CPU | - QEMU_MIGRATION_COOKIE_ALLOW_REBOOT | - QEMU_MIGRATION_COOKIE_CAPS))) - goto cleanup; - if (STREQ_NULLABLE(protocol, "rdma") && !virMemoryLimitIsSet(vm->def->mem.hard_limit)) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 18 01:01:07 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542892587462444.09035141478; Thu, 22 Nov 2018 05:16:27 -0800 (PST) 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 72B2A307D874; Thu, 22 Nov 2018 13:16:25 +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 DDBF083883; Thu, 22 Nov 2018 13:16:24 +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 80A404EA3A; Thu, 22 Nov 2018 13:16:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAMDGN2f028278 for ; Thu, 22 Nov 2018 08:16:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id B01956012B; Thu, 22 Nov 2018 13:16:23 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34369604CD for ; Thu, 22 Nov 2018 13:16:23 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 22 Nov 2018 14:16:18 +0100 Message-Id: <055269dd3431a786456724f485e589e4a56661b4.1542892462.git.mprivozn@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] qemuMigrationSrcConfirm: Don't remove domain config if confirm phase fails 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.48]); Thu, 22 Nov 2018 13:16:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" If migration is cancelled or confirm phase fails the domain should be kept on the source even if VIR_MIGRATE_UNDEFINE_SOURCE was requested. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 3875ea828f..04bc55944f 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3044,7 +3044,7 @@ qemuMigrationSrcConfirm(virQEMUDriverPtr driver, =20 qemuMigrationJobFinish(driver, vm); if (!virDomainObjIsActive(vm)) { - if (flags & VIR_MIGRATE_UNDEFINE_SOURCE) { + if (!cancelled && ret >=3D 0 && flags & VIR_MIGRATE_UNDEFINE_SOURC= E) { virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm); vm->persistent =3D 0; } --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list