From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3L3P-0000RL-0x for qemu-devel@nongnu.org; Mon, 30 Nov 2015 04:47:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3L3K-0005ri-57 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 04:47:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3L3J-0005ra-WF for qemu-devel@nongnu.org; Mon, 30 Nov 2015 04:47:22 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 83276935F4 for ; Mon, 30 Nov 2015 09:47:21 +0000 (UTC) Date: Mon, 30 Nov 2015 17:47:10 +0800 From: Peter Xu Message-ID: <20151130094708.GA8728@pxdev.xzpeter.org> References: <20151130034732.GA12255@pxdev.xzpeter.org> <565C12EA.5090801@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <565C12EA.5090801@redhat.com> Subject: Re: [Qemu-devel] question: about exec/poison.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Mon, Nov 30, 2015 at 10:12:10AM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 04:47, Peter Xu wrote: > > > > I met one problem when trying to add a new public function in dump.h > > named "dump_state_get_global" and using it in hmp.c. > > Don't do that. :) > > hmp.c functions should in general use the QMP commands as the base. In > your case, hmp_info_dump should call qmp_query_dump. Hi, Paolo, That becomes a problem only if I do not have "percentage" (or written/total) in QMP queries, which is suggested in the previous review message: https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg06088.html """ The percentage is not necessary as part of the QMP return value. You can compute it in hmp_info_dump however and print it to HMP only. """ So from what I understand from your reply, I could include the percentage value into "query-dump", right? :) Actually, I think it would be cooler if we could have them in both QMP/HMP messages (maybe I would better prefer percentage comparing to written/total bytes, since it is more directly human readable). Thanks! Peter > > Paolo