From patchwork Tue Jul 31 08:35:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10550417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3121314E0 for ; Tue, 31 Jul 2018 08:37:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C0FE2A988 for ; Tue, 31 Jul 2018 08:37:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 106FD2A9A0; Tue, 31 Jul 2018 08:37:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AC7CD2A14F for ; Tue, 31 Jul 2018 08:37:08 +0000 (UTC) Received: from localhost ([::1]:57589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkQ9T-00016s-TX for patchwork-qemu-devel@patchwork.kernel.org; Tue, 31 Jul 2018 04:37:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkQ8K-0000FM-HJ for qemu-devel@nongnu.org; Tue, 31 Jul 2018 04:35:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkQ8J-0000Cc-GK for qemu-devel@nongnu.org; Tue, 31 Jul 2018 04:35:56 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:43909) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkQ8J-0000CK-8y for qemu-devel@nongnu.org; Tue, 31 Jul 2018 04:35:55 -0400 Received: by mail-pg1-x542.google.com with SMTP id d17-v6so4284828pgv.10 for ; Tue, 31 Jul 2018 01:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aDRu1zJrITjpUnHg2g7rRuk1Li6C5/J2OBFZ4vbrF0o=; b=MG041iaEiPknMjNAVtJqV9hnDbW87SHK+gDo2lhCvI1QLCd4WlenGmqb+YLOWfI4aE Bp3NciXrvzKrhZZWOl0fLBi0kNNFgi5d8wbq5DTmPYLg/EkQM1Q89zsjEtdlu5o19olx EwoUwtX1Efvd1W0cxIiZ+Vog1Jpx2basmb8sNigctq6socQO7GloMr8HUrJ8FDyNY0qr ubz6QLaoMqyR4euV20ENw8A//iWERBSY2dAeiz1BPErf3k3nHaFrFCPdhJEbzNq3F23y /rmxmiJKA2tyLRuwnJtYLWXvWVSKMoErR4PuptnOBlUUJ4RUf5Io7T2XFayHodW2qrRw mWFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aDRu1zJrITjpUnHg2g7rRuk1Li6C5/J2OBFZ4vbrF0o=; b=rtJ7Bak3p3L7vA+c7uHZ/V/woleRqFj/CWbW7Lq30H1w+2QGQ2nj4i1lmnZncrNFuG x0LA22Yv3lHKhAKlXvwfDlq3Y/01BmA7TRlWHXAWN3ADOmK9n/+DnVMTb8Qdy/gDAMrn CIVL/wEDnNz4j67ePvmnq3ziERVto8EiJT1JDggf8XtA+ir56OLaZhkFTBaKX9ol1npl zROKZ/rrAN36c10b9mDfTOc9nnKXBnkwxAhvdDeJxOhY7fOU39qAtriLO8PaiJvjcDao 49HoPBK3GBLtoM2HkT3F5O5xyCzO53SwqhQfLW4VsMD+ZGMKosDB+L6H6LCOC3SSks9g 6nHw== X-Gm-Message-State: AOUpUlFZtyyPi2nMA6WzF3dMHyiVeSsroOhTXY6wQRxH9XjubUriyhFz HcnT+5qP4YZVKW0B1oxP2kY= X-Google-Smtp-Source: AAOMgpcUu9GqIZeOQRXJUSyJS8B1MGqbfKUVJ4mnJ4FLgIBnB/5a7EXuSZQfL3YUh7DjUJ2XydDQzA== X-Received: by 2002:a63:b504:: with SMTP id y4-v6mr19957475pge.247.1533026154466; Tue, 31 Jul 2018 01:35:54 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.100]) by smtp.gmail.com with ESMTPSA id f19-v6sm23406069pfd.147.2018.07.31.01.35.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jul 2018 01:35:53 -0700 (PDT) From: Li Qiang To: pbonzini@redhat.com, crosthwaite.peter@gmail.com, rth@twiddle.net, quintela@redhat.com, dgilbert@redhat.com, eblake@redhat.com, armbru@redhat.com Date: Tue, 31 Jul 2018 01:35:24 -0700 Message-Id: <1533026124-6740-4-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1533026124-6740-1-git-send-email-liq3ea@gmail.com> References: <1533026124-6740-1-git-send-email-liq3ea@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [PATCH 3/3] hmp: add hmp for migrate_set_max_cpu_throttle X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: liqiang02@corp.netease.com, Li Qiang , hzliuyingdong@corp.netease.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Li Qiang --- hmp-commands.hx | 14 ++++++++++++++ hmp.c | 6 ++++++ hmp.h | 1 + 3 files changed, 21 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 91dfe51c37..9d54ecbe4e 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1042,6 +1042,20 @@ Set maximum speed to @var{value} (in bytes) for migrations. ETEXI { + .name = "migrate_set_max_cpu_throttle", + .args_type = "value:i", + .params = "value", + .help = "set maximum cpu throttle for migrations.", + .cmd = hmp_migrate_set_max_cpu_throttle, + }, + +STEXI +@item hmp_migrate_set_max_cpu_throttle @var{value} +@findex migrate_set_max_cpu_throttle +Set maximum cpu throttle to @var{value} for migrations. +ETEXI + + { .name = "migrate_set_downtime", .args_type = "value:T", .params = "value", diff --git a/hmp.c b/hmp.c index 2aafb50e8e..4ee9af7165 100644 --- a/hmp.c +++ b/hmp.c @@ -1574,6 +1574,12 @@ void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict) qmp_migrate_set_speed(value, NULL); } +void hmp_migrate_set_max_cpu_throttle(Monitor *mon, const QDict *qdict) +{ + int64_t value = qdict_get_int(qdict, "value"); + qmp_migrate_set_max_cpu_throttle(value, NULL); +} + void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict) { const char *cap = qdict_get_str(qdict, "capability"); diff --git a/hmp.h b/hmp.h index 33354f1bdd..e57f7e4005 100644 --- a/hmp.h +++ b/hmp.h @@ -73,6 +73,7 @@ void hmp_migrate_recover(Monitor *mon, const QDict *qdict); void hmp_migrate_pause(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); +void hmp_migrate_set_max_cpu_throttle(Monitor *mon, const QDict *qdict); void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict); void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict); void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict);