From patchwork Fri Nov 22 16:48:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 11258189 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F69A6C1 for ; Fri, 22 Nov 2019 17:29:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2014920714 for ; Fri, 22 Nov 2019 17:29:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JW5lpDms" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2014920714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYCk5-0006dZ-U8 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Nov 2019 12:29:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYC6e-0005tG-SS for qemu-devel@nongnu.org; Fri, 22 Nov 2019 11:48:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iYC6d-0004AG-1p for qemu-devel@nongnu.org; Fri, 22 Nov 2019 11:48:28 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32074 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iYC6c-0004A1-UL for qemu-devel@nongnu.org; Fri, 22 Nov 2019 11:48:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574441306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FasfMAH7F5ghUA69MUlj8nAI9oilFzu1uW+XYZwFYoQ=; b=JW5lpDmsh3Wh99HUxDG/KxZb66dblQySQdDtH1V+MDPiLHHA5/qqQUqVX5Zp6A6PhbSyAa 9hYjYMO/tzNbKuAFjrO6FIH38+nCahrroDx4SiKtYuI4CIUooPHLacc+qtXW0WEwIclRon mIiIy7r+EFfAV+6xs0EUkUV9d/rPbPA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-JBcSpZ6gMce-5j1dVPEdUw-1; Fri, 22 Nov 2019 11:48:23 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51F051005502; Fri, 22 Nov 2019 16:48:22 +0000 (UTC) Received: from maximlenovopc.usersys.redhat.com (unknown [10.35.206.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 783327700F; Fri, 22 Nov 2019 16:48:20 +0000 (UTC) From: Maxim Levitsky To: qemu-devel@nongnu.org Subject: [PATCH v2 5/9] monitor/hmp: move hmp_block_job* to block-hmp-cmds.c Date: Fri, 22 Nov 2019 18:48:03 +0200 Message-Id: <20191122164807.27938-6-mlevitsk@redhat.com> In-Reply-To: <20191122164807.27938-1-mlevitsk@redhat.com> References: <20191122164807.27938-1-mlevitsk@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: JBcSpZ6gMce-5j1dVPEdUw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , "Dr. David Alan Gilbert" , Maxim Levitsky , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Maxim Levitsky --- block/monitor/block-hmp-cmds.c | 52 ++++++++++++++++++++++++++++++++++ monitor/hmp-cmds.c | 52 ---------------------------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 5ae899a324..e333de27b1 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block/monitor/block-hmp-cmds.c @@ -238,3 +238,55 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict) hmp_handle_error(mon, &err); } + +void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + int64_t value = qdict_get_int(qdict, "speed"); + + qmp_block_job_set_speed(device, value, &error); + + hmp_handle_error(mon, &error); +} + +void hmp_block_job_cancel(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + bool force = qdict_get_try_bool(qdict, "force", false); + + qmp_block_job_cancel(device, true, force, &error); + + hmp_handle_error(mon, &error); +} + +void hmp_block_job_pause(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + + qmp_block_job_pause(device, &error); + + hmp_handle_error(mon, &error); +} + +void hmp_block_job_resume(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + + qmp_block_job_resume(device, &error); + + hmp_handle_error(mon, &error); +} + +void hmp_block_job_complete(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + + qmp_block_job_complete(device, &error); + + hmp_handle_error(mon, &error); +} diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index aa94a15d74..326276cced 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1976,58 +1976,6 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict) hmp_handle_error(mon, &error); } -void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict) -{ - Error *error = NULL; - const char *device = qdict_get_str(qdict, "device"); - int64_t value = qdict_get_int(qdict, "speed"); - - qmp_block_job_set_speed(device, value, &error); - - hmp_handle_error(mon, &error); -} - -void hmp_block_job_cancel(Monitor *mon, const QDict *qdict) -{ - Error *error = NULL; - const char *device = qdict_get_str(qdict, "device"); - bool force = qdict_get_try_bool(qdict, "force", false); - - qmp_block_job_cancel(device, true, force, &error); - - hmp_handle_error(mon, &error); -} - -void hmp_block_job_pause(Monitor *mon, const QDict *qdict) -{ - Error *error = NULL; - const char *device = qdict_get_str(qdict, "device"); - - qmp_block_job_pause(device, &error); - - hmp_handle_error(mon, &error); -} - -void hmp_block_job_resume(Monitor *mon, const QDict *qdict) -{ - Error *error = NULL; - const char *device = qdict_get_str(qdict, "device"); - - qmp_block_job_resume(device, &error); - - hmp_handle_error(mon, &error); -} - -void hmp_block_job_complete(Monitor *mon, const QDict *qdict) -{ - Error *error = NULL; - const char *device = qdict_get_str(qdict, "device"); - - qmp_block_job_complete(device, &error); - - hmp_handle_error(mon, &error); -} - typedef struct HMPMigrationStatus { QEMUTimer *timer;