From nobody Wed May 14 13:41:14 2025 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 1522853329042697.9909164228827; Wed, 4 Apr 2018 07:48:49 -0700 (PDT) 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 51D50C0587E3; Wed, 4 Apr 2018 14:48:47 +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 20BA8176A4; Wed, 4 Apr 2018 14:48:47 +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 CDED310481E; Wed, 4 Apr 2018 14:48:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w34Eg74G020313 for ; Wed, 4 Apr 2018 10:42:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CBA72024CA2; Wed, 4 Apr 2018 14:42:07 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4A582024CA4 for ; Wed, 4 Apr 2018 14:42:06 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id DCEE6104517; Wed, 4 Apr 2018 16:42:01 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Apr 2018 16:41:28 +0200 Message-Id: <8b013abb9a7df91c275e168d2734b438b6169203.1522852107.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 39/68] qemu: Call qemuMigrationAnyCompressionParse only from driver 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.32]); Wed, 04 Apr 2018 14:48:48 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Propagate the calls up the stack to the point where qemuMigrationParamsFromFlags is called. The end goal achieved in the following few patches is to merge compression parameters into the general migration parameters code. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 21 ++++++++++++++++++--- src/qemu/qemu_migration.c | 25 +++++++------------------ src/qemu/qemu_migration.h | 1 + 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5271e01d92..85755257aa 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12126,6 +12126,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn, virQEMUDriverPtr driver =3D dconn->privateData; virDomainDefPtr def =3D NULL; char *origname =3D NULL; + qemuMigrationCompressionPtr compression =3D NULL; qemuMigrationParamsPtr migParams =3D NULL; int ret =3D -1; =20 @@ -12137,6 +12138,9 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn, goto cleanup; } =20 + if (!(compression =3D qemuMigrationAnyCompressionParse(NULL, 0, flags)= )) + goto cleanup; + if (!(migParams =3D qemuMigrationParamsFromFlags(NULL, 0, flags, QEMU_MIGRATION_DESTINAT= ION))) goto cleanup; @@ -12156,9 +12160,10 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn, =20 ret =3D qemuMigrationDstPrepareTunnel(driver, dconn, NULL, 0, NULL, NULL, /* No cookies= in v2 */ - st, &def, origname, migParams, fla= gs); + st, &def, origname, compression, m= igParams, flags); =20 cleanup: + VIR_FREE(compression); qemuMigrationParamsFree(migParams); VIR_FREE(origname); virDomainDefFree(def); @@ -12597,6 +12602,7 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn, virQEMUDriverPtr driver =3D dconn->privateData; virDomainDefPtr def =3D NULL; char *origname =3D NULL; + qemuMigrationCompressionPtr compression =3D NULL; qemuMigrationParamsPtr migParams =3D NULL; int ret =3D -1; =20 @@ -12608,6 +12614,9 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn, goto cleanup; } =20 + if (!(compression =3D qemuMigrationAnyCompressionParse(NULL, 0, flags)= )) + goto cleanup; + if (!(migParams =3D qemuMigrationParamsFromFlags(NULL, 0, flags, QEMU_MIGRATION_DESTINAT= ION))) goto cleanup; @@ -12621,9 +12630,10 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dcon= n, ret =3D qemuMigrationDstPrepareTunnel(driver, dconn, cookiein, cookieinlen, cookieout, cookieoutlen, - st, &def, origname, migParams, fla= gs); + st, &def, origname, compression, m= igParams, flags); =20 cleanup: + VIR_FREE(compression); qemuMigrationParamsFree(migParams); VIR_FREE(origname); virDomainDefFree(def); @@ -12646,6 +12656,7 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPtr= dconn, const char *dom_xml =3D NULL; const char *dname =3D NULL; char *origname =3D NULL; + qemuMigrationCompressionPtr compression =3D NULL; qemuMigrationParamsPtr migParams =3D NULL; int ret =3D -1; =20 @@ -12667,6 +12678,9 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPtr= dconn, goto cleanup; } =20 + if (!(compression =3D qemuMigrationAnyCompressionParse(NULL, 0, flags)= )) + goto cleanup; + if (!(migParams =3D qemuMigrationParamsFromFlags(params, nparams, flag= s, QEMU_MIGRATION_DESTINAT= ION))) goto cleanup; @@ -12680,9 +12694,10 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPt= r dconn, ret =3D qemuMigrationDstPrepareTunnel(driver, dconn, cookiein, cookieinlen, cookieout, cookieoutlen, - st, &def, origname, migParams, fla= gs); + st, &def, origname, compression, m= igParams, flags); =20 cleanup: + VIR_FREE(compression); qemuMigrationParamsFree(migParams); VIR_FREE(origname); virDomainDefFree(def); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 1c614f8c0d..fa220d6ce4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2534,12 +2534,10 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driv= er, virStreamPtr st, virDomainDefPtr *def, const char *origname, + qemuMigrationCompressionPtr compression, qemuMigrationParamsPtr migParams, unsigned long flags) { - qemuMigrationCompressionPtr compression =3D NULL; - int ret; - VIR_DEBUG("driver=3D%p, dconn=3D%p, cookiein=3D%s, cookieinlen=3D%d, " "cookieout=3D%p, cookieoutlen=3D%p, st=3D%p, def=3D%p, " "origname=3D%s, flags=3D0x%lx", @@ -2552,15 +2550,10 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driv= er, return -1; } =20 - if (!(compression =3D qemuMigrationAnyCompressionParse(NULL, 0, flags)= )) - return -1; - - ret =3D qemuMigrationDstPrepareAny(driver, dconn, cookiein, cookieinle= n, - cookieout, cookieoutlen, def, orignam= e, - st, NULL, 0, false, NULL, 0, NULL, 0, - compression, migParams, flags); - VIR_FREE(compression); - return ret; + return qemuMigrationDstPrepareAny(driver, dconn, cookiein, cookieinlen, + cookieout, cookieoutlen, def, origna= me, + st, NULL, 0, false, NULL, 0, NULL, 0, + compression, migParams, flags); } =20 =20 @@ -3762,6 +3755,7 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriverPtr dr= iver, unsigned long flags, const char *dname, unsigned long resource, + qemuMigrationCompressionPtr compression, qemuMigrationParamsPtr migParams) { virDomainPtr ddomain =3D NULL; @@ -3773,7 +3767,6 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriverPtr dr= iver, bool cancelled; virStreamPtr st =3D NULL; unsigned long destflags; - qemuMigrationCompressionPtr compression =3D NULL; =20 VIR_DEBUG("driver=3D%p, sconn=3D%p, dconn=3D%p, vm=3D%p, dconnuri=3D%s= , " "flags=3D0x%lx, dname=3D%s, resource=3D%lu", @@ -3795,9 +3788,6 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriverPtr dr= iver, destflags =3D flags & ~(VIR_MIGRATE_ABORT_ON_ERROR | VIR_MIGRATE_AUTO_CONVERGE); =20 - if (!(compression =3D qemuMigrationAnyCompressionParse(NULL, 0, flags)= )) - goto cleanup; - VIR_DEBUG("Prepare2 %p", dconn); if (flags & VIR_MIGRATE_TUNNELLED) { /* @@ -3898,7 +3888,6 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriverPtr dr= iver, } VIR_FREE(uri_out); VIR_FREE(cookie); - VIR_FREE(compression); =20 return ret; } @@ -4412,7 +4401,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr dri= ver, } else { ret =3D qemuMigrationSrcPerformPeer2Peer2(driver, sconn, dconn, vm, dconnuri, flags, dname, re= source, - migParams); + compression, migParams); } =20 cleanup: diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index af8f2cfeb4..2d67da8435 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -149,6 +149,7 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver, virStreamPtr st, virDomainDefPtr *def, const char *origname, + qemuMigrationCompressionPtr compression, qemuMigrationParamsPtr migParams, unsigned long flags); =20 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list