From nobody Fri May 3 23:14:20 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 ARC-Seal: i=1; a=rsa-sha256; t=1563545137; cv=none; d=zoho.com; s=zohoarc; b=UKtWbXxTCsdJaQMIFHQ15D9ZyHdWr8SJVAEJ0wQTWbjjFC5i0xq8xTSWplhYP0xQtrpHziVYEzo8y6gq2R4eMSDkmemqeco5KaUCPWPdDKwTZ6aiK3/6yCufWeg0tlcXh3zZwfI7x3rNrPVZJtS9ld2UwBrD1E/g26y4D1pRcRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563545137; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=yGahQa3rVngvNfRM5zJxIJ+A9cXTvEbT/NmbOgDGLPI=; b=UNIBK1/szfxSDfVi/5igkAShxulJuCk/fyNUdCGnqY09gTpvytSnNACUxl3Pfw7B78A+eeGwccqCqYEIdKsip4likkps9vez4p/XaW2plyN3m/vcTbPdfeverdD1qcr4b+vHbWxPd12avc7spYL3tEuDUGFz27Z4MB4T4wG8kO4= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563545137251469.53990705487286; Fri, 19 Jul 2019 07:05:37 -0700 (PDT) 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 D232C81DF6; Fri, 19 Jul 2019 14:05: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 E84EE665F1; Fri, 19 Jul 2019 14:05: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 96D1D4EA2F; Fri, 19 Jul 2019 14:05:31 +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 x6JE5U89008231 for ; Fri, 19 Jul 2019 10:05:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8BE285D970; Fri, 19 Jul 2019 14:05:30 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 620E45D995 for ; Fri, 19 Jul 2019 14:05:27 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5A1D5100225; Fri, 19 Jul 2019 16:05:26 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 19 Jul 2019 16:05:21 +0200 Message-Id: <46a22f8d4bafa5dd713fb7f526de3e16acdecb73.1563545121.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virsh migrate: Properly check for --parallel-connections 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: , 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]); Fri, 19 Jul 2019 14:05:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Ever since --parallel-connections option for virsh migrate was introduced we did not properly check the return value of vshCommandOptInt. We would set VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS parameter even if vshCommandOptInt returned 0 (which means --parallel-connections was not specified) when another int option which was checked earlier was specified with a nonzero value. Specifically, running virsh migrate with either --auto-converge-increment, --auto-converge-initial, --comp-mt-dthreads, --comp-mt-threads, or --comp-mt-level would set VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS parameter and if --parallel option was not used, libvirt would complain error: invalid argument: Turn parallel migration on to tune it even though --parallel-connections option was not used at all. https://bugzilla.redhat.com/show_bug.cgi?id=3D1726643 Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- tools/virsh-domain.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 828ae30789..2ad73959ec 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10785,13 +10785,14 @@ doMigrate(void *opaque) goto save_error; } =20 - if (vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt) < 0) + if ((rv =3D vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt= )) < 0) { goto out; - if (intOpt && - virTypedParamsAddInt(¶ms, &nparams, &maxparams, - VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, - intOpt) < 0) - goto save_error; + } else if (rv > 0) { + if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, + intOpt) < 0) + goto save_error; + } =20 if (vshCommandOptBool(cmd, "live")) flags |=3D VIR_MIGRATE_LIVE; --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list