From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YE7hc-0005sE-Oc for qemu-devel@nongnu.org; Wed, 21 Jan 2015 21:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YE7hW-0004R0-Jp for qemu-devel@nongnu.org; Wed, 21 Jan 2015 21:41:00 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:14359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YE7hV-0004PH-Vj for qemu-devel@nongnu.org; Wed, 21 Jan 2015 21:40:54 -0500 From: zhanghailiang Date: Thu, 22 Jan 2015 10:40:01 +0800 Message-ID: <1421894406-12180-1-git-send-email-zhang.zhanghailiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [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: qemu-devel@nongnu.org Cc: hangaohuai@huawei.com, zhanghailiang , peter.huangpeng@huawei.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, lersek@redhat.com 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 block online/offline status and memory block size (unit of memory online/offline operation ). Also, we can change guest's memory block status (Logical memory hotplug/unplug) from host. Example of usage: {"execute":"guest-get-memory-blocks"} {"return":[{"online":true,"can-offline":false,"phys-index":0},{"online":true,"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-index":0,"online":false},{"phys-index":1,"online":false},{"phys-index":3,"online":false}]}} {"return":[{"response":"operation-failed","error-code":22,"phys-index":0},{"response":"success","phys-index":1},{"response":"operation-failed","error-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 operation results. It is suggested by Michael Roth. It is more useful for callers to know the exact operation result for each memory block, and also they can 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