From nobody Thu May 2 15:11:10 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 1519029691165634.1554605432052; Mon, 19 Feb 2018 00:41:31 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2737E42C; Mon, 19 Feb 2018 08:41:29 +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 0BC7560C82; Mon, 19 Feb 2018 08:41:29 +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 9A4C018033EA; Mon, 19 Feb 2018 08:41:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1J8fO9l020631 for ; Mon, 19 Feb 2018 03:41:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 324A810FFE73; Mon, 19 Feb 2018 08:41:24 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B22531006EA3; Mon, 19 Feb 2018 08:41:23 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 19 Feb 2018 09:40:40 +0100 Message-Id: <3a5ee135b8a460027e6441b58e8aa1fafffba171.1519029569.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 1/2] virsh: Fix internal naming of some blockjob commands 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 19 Feb 2018 08:41:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The variable names for the options and information about a command should have an underscore in places where the virsh command has a hyphen. The function callback name should capitalize the letter after the hyphen. This was not used in 'blockcommit', 'blockcopy', 'blockjob', 'blockpull', and 'blockresize' commands. Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 60 ++++++++++++++++++++++++++----------------------= ---- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d158327bd7..29bc8e6db1 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1874,7 +1874,7 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) /* * "blockcommit" command */ -static const vshCmdInfo info_block_commit[] =3D { +static const vshCmdInfo info_blockcommit[] =3D { {.name =3D "help", .data =3D N_("Start a block commit operation.") }, @@ -1884,7 +1884,7 @@ static const vshCmdInfo info_block_commit[] =3D { {.name =3D NULL} }; -static const vshCmdOptDef opts_block_commit[] =3D { +static const vshCmdOptDef opts_blockcommit[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "path", .type =3D VSH_OT_DATA, @@ -1952,7 +1952,7 @@ static const vshCmdOptDef opts_block_commit[] =3D { }; static bool -cmdBlockCommit(vshControl *ctl, const vshCmd *cmd) +cmdBlockcommit(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom =3D NULL; bool ret =3D false; @@ -2099,7 +2099,7 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd) /* * "blockcopy" command */ -static const vshCmdInfo info_block_copy[] =3D { +static const vshCmdInfo info_blockcopy[] =3D { {.name =3D "help", .data =3D N_("Start a block copy operation.") }, @@ -2109,7 +2109,7 @@ static const vshCmdInfo info_block_copy[] =3D { {.name =3D NULL} }; -static const vshCmdOptDef opts_block_copy[] =3D { +static const vshCmdOptDef opts_blockcopy[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "path", .type =3D VSH_OT_DATA, @@ -2192,7 +2192,7 @@ static const vshCmdOptDef opts_block_copy[] =3D { }; static bool -cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) +cmdBlockcopy(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom =3D NULL; const char *dest =3D NULL; @@ -2415,7 +2415,7 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) /* * "blockjob" command */ -static const vshCmdInfo info_block_job[] =3D { +static const vshCmdInfo info_blockjob[] =3D { {.name =3D "help", .data =3D N_("Manage active block operations") }, @@ -2425,7 +2425,7 @@ static const vshCmdInfo info_block_job[] =3D { {.name =3D NULL} }; -static const vshCmdOptDef opts_block_job[] =3D { +static const vshCmdOptDef opts_blockjob[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "path", .type =3D VSH_OT_DATA, @@ -2609,7 +2609,7 @@ virshBlockJobAbort(virDomainPtr dom, static bool -cmdBlockJob(vshControl *ctl, const vshCmd *cmd) +cmdBlockjob(vshControl *ctl, const vshCmd *cmd) { bool ret =3D false; bool raw =3D vshCommandOptBool(cmd, "raw"); @@ -2658,7 +2658,7 @@ cmdBlockJob(vshControl *ctl, const vshCmd *cmd) /* * "blockpull" command */ -static const vshCmdInfo info_block_pull[] =3D { +static const vshCmdInfo info_blockpull[] =3D { {.name =3D "help", .data =3D N_("Populate a disk from its backing image.") }, @@ -2668,7 +2668,7 @@ static const vshCmdInfo info_block_pull[] =3D { {.name =3D NULL} }; -static const vshCmdOptDef opts_block_pull[] =3D { +static const vshCmdOptDef opts_blockpull[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "path", .type =3D VSH_OT_DATA, @@ -2711,7 +2711,7 @@ static const vshCmdOptDef opts_block_pull[] =3D { }; static bool -cmdBlockPull(vshControl *ctl, const vshCmd *cmd) +cmdBlockpull(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom =3D NULL; bool ret =3D false; @@ -2804,7 +2804,7 @@ cmdBlockPull(vshControl *ctl, const vshCmd *cmd) /* * "blockresize" command */ -static const vshCmdInfo info_block_resize[] =3D { +static const vshCmdInfo info_blockresize[] =3D { {.name =3D "help", .data =3D N_("Resize block device of domain.") }, @@ -2814,7 +2814,7 @@ static const vshCmdInfo info_block_resize[] =3D { {.name =3D NULL} }; -static const vshCmdOptDef opts_block_resize[] =3D { +static const vshCmdOptDef opts_blockresize[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "path", .type =3D VSH_OT_DATA, @@ -2830,7 +2830,7 @@ static const vshCmdOptDef opts_block_resize[] =3D { }; static bool -cmdBlockResize(vshControl *ctl, const vshCmd *cmd) +cmdBlockresize(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom; const char *path =3D NULL; @@ -13910,33 +13910,33 @@ const vshCmdDef domManagementCmds[] =3D { .flags =3D 0 }, {.name =3D "blockcommit", - .handler =3D cmdBlockCommit, - .opts =3D opts_block_commit, - .info =3D info_block_commit, + .handler =3D cmdBlockcommit, + .opts =3D opts_blockcommit, + .info =3D info_blockcommit, .flags =3D 0 }, {.name =3D "blockcopy", - .handler =3D cmdBlockCopy, - .opts =3D opts_block_copy, - .info =3D info_block_copy, + .handler =3D cmdBlockcopy, + .opts =3D opts_blockcopy, + .info =3D info_blockcopy, .flags =3D 0 }, {.name =3D "blockjob", - .handler =3D cmdBlockJob, - .opts =3D opts_block_job, - .info =3D info_block_job, + .handler =3D cmdBlockjob, + .opts =3D opts_blockjob, + .info =3D info_blockjob, .flags =3D 0 }, {.name =3D "blockpull", - .handler =3D cmdBlockPull, - .opts =3D opts_block_pull, - .info =3D info_block_pull, + .handler =3D cmdBlockpull, + .opts =3D opts_blockpull, + .info =3D info_blockpull, .flags =3D 0 }, {.name =3D "blockresize", - .handler =3D cmdBlockResize, - .opts =3D opts_block_resize, - .info =3D info_block_resize, + .handler =3D cmdBlockresize, + .opts =3D opts_blockresize, + .info =3D info_blockresize, .flags =3D 0 }, {.name =3D "change-media", --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 15:11:10 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 1519029710523370.61601367017806; Mon, 19 Feb 2018 00:41:50 -0800 (PST) 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 2CD6A85546; Mon, 19 Feb 2018 08:41:49 +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 E9B845457C; Mon, 19 Feb 2018 08:41:48 +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 B40E84A46C; Mon, 19 Feb 2018 08:41:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1J8fOqq020639 for ; Mon, 19 Feb 2018 03:41:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id DDA1C10AF9F7; Mon, 19 Feb 2018 08:41:24 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A2EF10AF9EE; Mon, 19 Feb 2018 08:41:24 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 19 Feb 2018 09:40:41 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/2] qemu: blockcopy: Add check for bandwidth 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.28]); Mon, 19 Feb 2018 08:41:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QEMU code does not work well with too big numbers on the JSON monitor so our monitor code supports sending only numbers up to LLONG_MAX. Avoid a weird error message by limiting the size of the 'bandwidth' parameter for block copy. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1532542 Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bbce5bd81b..9e7ac1cfa0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17218,6 +17218,14 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, goto cleanup; } + if (bandwidth > LLONG_MAX) { + virReportError(VIR_ERR_INVALID_ARG, + _("bandwidth must be less than " + "'%llu' bytes/s (%llu MiB/s)"), + LLONG_MAX, LLONG_MAX >> 20); + goto cleanup; + } + if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) goto cleanup; --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list