From patchwork Thu Nov 15 08:54:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xiezhide X-Patchwork-Id: 10683929 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 05E3314D6 for ; Thu, 15 Nov 2018 09:02:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E68B32C4DD for ; Thu, 15 Nov 2018 09:02:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB20B2C504; Thu, 15 Nov 2018 09:02:02 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 6AD412C503 for ; Thu, 15 Nov 2018 09:02:02 +0000 (UTC) Received: from localhost ([::1]:37516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNDXC-00039H-MC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Nov 2018 04:01:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNDW5-0002WL-Nf for qemu-devel@nongnu.org; Thu, 15 Nov 2018 04:00:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNDVp-00056J-M3 for qemu-devel@nongnu.org; Thu, 15 Nov 2018 04:00:42 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:54969 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNDVm-0004vl-M3 for qemu-devel@nongnu.org; Thu, 15 Nov 2018 04:00:31 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6293896A1E6E9; Thu, 15 Nov 2018 17:00:20 +0800 (CST) Received: from huawei.com (10.143.28.95) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Thu, 15 Nov 2018 17:00:12 +0800 From: xiezhide To: Date: Thu, 15 Nov 2018 16:54:36 +0800 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.143.28.95] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 45.249.212.35 Subject: [Qemu-devel] [PATCH v4 0/4] fsdev-throttle-qmp: qmp interface for fsdev io throttling 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: berto@igalia.com, armbru@redhat.com, zengcanfu@huawei.com, groug@kaod.org, aneesh.kumar@linux.vnet.ibm.com, jinxuefeng@huawei.com, chenhui.rtos@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patches provide qmp interface to query/set io throttle parameters of a fsdev. Some of patches also refactor the code and structure that was present in block and fsdev files. xiezhide (4): fsdev-throttle-qmp: factor out throttle code to reuse code fsdev-throttle-qmp: move struct ThrottleLimits to new file fsdev-throttle-qmp: qmp interface for fsdev io throttling fsdev-throttle-qmp: hmp interface for fsdev io throttling Makefile | 18 ++++ Makefile.objs | 8 ++ block/throttle.c | 6 +- blockdev.c | 94 +--------------- fsdev/qemu-fsdev-dummy.c | 11 ++ fsdev/qemu-fsdev-throttle.c | 142 +++++++++++++++--------- fsdev/qemu-fsdev-throttle.h | 6 +- fsdev/qemu-fsdev.c | 29 +++++ hmp-commands-info.hx | 15 +++ hmp-commands.hx | 15 +++ hmp.c | 83 +++++++++++++-- hmp.h | 4 + include/qemu/throttle-options.h | 2 + include/qemu/throttle.h | 4 +- include/qemu/typedefs.h | 1 + qapi/block-core.json | 122 +-------------------- qapi/fsdev.json | 96 +++++++++++++++++ qapi/qapi-schema.json | 2 + qapi/tlimits.json | 89 ++++++++++++++++ qmp.c | 13 +++ util/throttle.c | 231 ++++++++++++++++++++++++++-------------- 21 files changed, 635 insertions(+), 356 deletions(-) create mode 100644 qapi/fsdev.json create mode 100644 qapi/tlimits.json v0 -> v1: Addressed comments from Eric Blake and Greg Kurz. Fix patch corrupt issue due to email client change the patch format with copy-to-paster Break patch to patches v1 -> v2: Addressed comments from Greg Kurz. send patch with outlook,patch corrupted, resend with git send-email v2 -> v3: Addressed comments from Eric Blake. split patch1 into two patches v3 -> v4: Fix issue cause test failed on centos and fedora