From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNXbU-0007Xn-Qq for qemu-devel@nongnu.org; Mon, 16 Feb 2015 21:09:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNXbN-0005lJ-Rn for qemu-devel@nongnu.org; Mon, 16 Feb 2015 21:09:36 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:50990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNXbN-0005lF-Nw for qemu-devel@nongnu.org; Mon, 16 Feb 2015 21:09:29 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Feb 2015 21:09:29 -0500 Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id DC8506E803F for ; Mon, 16 Feb 2015 21:01:18 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1H29ROb28180632 for ; Tue, 17 Feb 2015 02:09:27 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1H29QGi004654 for ; Mon, 16 Feb 2015 21:09:26 -0500 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1421894406-12180-1-git-send-email-zhang.zhanghailiang@huawei.com> References: <1421894406-12180-1-git-send-email-zhang.zhanghailiang@huawei.com> Message-ID: <20150217020503.13315.72635@loki> Date: Mon, 16 Feb 2015 20:05:03 -0600 Subject: Re: [Qemu-devel] [PATCH v2 0/5] qga: add three logical memory hotplug related commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , qemu-devel@nongnu.org Cc: hangaohuai@huawei.com, lersek@redhat.com, peter.huangpeng@huawei.com, lcapitulino@redhat.com Quoting zhanghailiang (2015-01-21 20:40:01) > This patch series add three guest commands about memory block: > guest-get-memory-blocks, guest-set-memory-blocks, guest-get-memory-block-= size. > = > With these three commands, we can get information about guest's memory bl= ock > online/offline status and memory block size (unit of memory online/offlin= e = > operation ). Also, we can change guest's memory block status (Logical mem= ory > hotplug/unplug) from host. Thanks, applied to QGA tree: https://github.com/mdroth/qemu/commits/qga with a small change to patch 2 that replaces an assertion that the block list isn't NULL with a reported error instead. This is more of an assertion about the guest OS than the code itself, so it's best to avoid tying the life-cycle of the agent to it. Otherwise looks good. > = > Example of usage: > = > {"execute":"guest-get-memory-blocks"} > {"return":[{"online":true,"can-offline":false,"phys-index":0},{"online":t= rue,"can-offline":true,"phys-index":1},{"online":true,"can-offline":false,"= phys-index":2},{"online":true,"can-offline":false,"phys-index":3}]} > = > {"execute":"guest-set-memory-blocks","arguments":{"mem-blks":[{"phys-inde= x":0,"online":false},{"phys-index":1,"online":false},{"phys-index":3,"onlin= e":false}]}} > {"return":[{"response":"operation-failed","error-code":22,"phys-index":0}= ,{"response":"success","phys-index":1},{"response":"operation-failed","erro= r-code":16,"phys-index":3}]} > = > {"execute":"guest-get-memory-block-size"} > {"return":134217728} > = > v2: > - Change return value of 'guest-set-memory-blocks' command from 'int' to= a list > of 'GuestMemoryBlockResponse', which contains more info about the oper= ation = > results. It is suggested by Michael Roth. It is more useful for caller= s to = > know the exact operation result for each memory block, and also they c= an help > callers to decide what to do next according to different error-code. > = > zhanghailiang (5): > qga: introduce three guest memory block commmands with stubs > qga: implement qmp_guest_get_memory_blocks() for Linux with sysfs > qga: implement qmp_guest_set_memory_blocks() for Linux with sysfs > qga: implement qmp_guest_get_memory_block_size() for Linux with sysfs > qga: add memory block command that unsupported to blacklist > = > qga/commands-posix.c | 324 +++++++++++++++++++++++++++++++++++++++++++++= +++++- > qga/commands-win32.c | 21 ++++ > qga/qapi-schema.json | 114 ++++++++++++++++++ > 3 files changed, 458 insertions(+), 1 deletion(-) > = > -- = > 1.7.12.4