From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BE442C433EF for ; Sun, 26 Dec 2021 16:02:20 +0000 (UTC) Received: from localhost ([::1]:51398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1VyV-0002yK-Hf for qemu-devel@archiver.kernel.org; Sun, 26 Dec 2021 11:02:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1VxQ-0002CM-Lz for qemu-devel@nongnu.org; Sun, 26 Dec 2021 11:01:14 -0500 Received: from prt-mail.chinatelecom.cn ([42.123.76.223]:57511 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1VxP-0002eR-2s for qemu-devel@nongnu.org; Sun, 26 Dec 2021 11:01:12 -0500 HMM_SOURCE_IP: 172.18.0.218:34892.1413726504 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-125.69.42.210 (unknown [172.18.0.218]) by chinatelecom.cn (HERMES) with SMTP id D57582800A4; Mon, 27 Dec 2021 00:00:56 +0800 (CST) X-189-SAVE-TO-SEND: huangy81@chinatelecom.cn Received: from ([172.18.0.218]) by app0025 with ESMTP id f4a7a0c0bc2e4d4faed141f2477707eb for peterx@redhat.com; Mon, 27 Dec 2021 00:01:06 CST X-Transaction-ID: f4a7a0c0bc2e4d4faed141f2477707eb X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.218 X-MEDUSA-Status: 0 Message-ID: <9b5a69a7-8d79-2608-8dab-e52fa534bff5@chinatelecom.cn> Date: Mon, 27 Dec 2021 00:00:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU To: Peter Xu References: From: Hyman In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=42.123.76.223; envelope-from=huangy81@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.063, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , David Hildenbrand , Juan Quintela , Richard Henderson , qemu-devel , Markus ArmBruster , Paolo Bonzini , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 在 2021/12/24 13:14, Peter Xu 写道: > On Tue, Dec 14, 2021 at 07:07:34PM +0800, huangy81@chinatelecom.cn wrote: >> +void qmp_vcpu_dirty_limit(bool enable, >> + bool has_cpu_index, >> + uint64_t cpu_index, >> + bool has_dirty_rate, >> + uint64_t dirty_rate, >> + Error **errp) >> +{ >> + static bool initialized; > > IMHO this is not needed; if we're with a global state pointer then it's the > same to check against that. Sound good, this make code simpler. > > The rest looks mostly good (besides the last proposal on API design which you > got confirmation from Markus). >