From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ug4tp-0008MO-3W for qemu-devel@nongnu.org; Fri, 24 May 2013 23:12:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ug4tk-0004eT-Az for qemu-devel@nongnu.org; Fri, 24 May 2013 23:12:05 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:51904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ug4tj-0004eF-N8 for qemu-devel@nongnu.org; Fri, 24 May 2013 23:12:00 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 25 May 2013 13:03:12 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 4E6122CE804A for ; Sat, 25 May 2013 13:11:52 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4P3Bibb22282490 for ; Sat, 25 May 2013 13:11:44 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4P3Bpmj010103 for ; Sat, 25 May 2013 13:11:51 +1000 From: Wenchao Xia Date: Sat, 25 May 2013 11:09:41 +0800 Message-Id: <1369451385-23452-1-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, phrdina@redhat.com, stefanha@gmail.com, armbru@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com, Wenchao Xia These patches are the common part of my hmp/qmp block query series and Pavel's qmp snapshot command converion series. It mainly does following things: 1 move snapshot related code to block/snapshot.c, qmp and info dumping code to block/qapi.c. 2 better info dumping function to get rid of buffer, avoid string truncation. v2: Squash code moving patches since they are reviewed in v1. Drop bdrv_snapshot_find() function change patch, since it related to snapshot logic which should be changed together with Pavel's serial. Use a parameter in message_printf() to tell where to print, instead of use global variable "cur_mon" inside. v3: Address Stefan's comments: 2/4: do not move bdrv_is_snapshot(). 4/4: reuse fprintf_function function pointer instead of a new function. Stefan Hajnoczi (1): 1 block: drop bs_snapshots global variable Wenchao Xia (3): 2 block: move snapshot code in block.c to block/snapshot.c 3 block: move qmp and info dump related code to block/qapi.c 4 block: dump snapshot and image info to specified output block.c | 313 -------------------------------------- block/Makefile.objs | 1 + block/qapi.c | 366 +++++++++++++++++++++++++++++++++++++++++++++ block/snapshot.c | 157 +++++++++++++++++++ include/block/block.h | 28 +---- include/block/block_int.h | 1 + include/block/qapi.h | 43 ++++++ include/block/snapshot.h | 53 +++++++ qemu-img.c | 163 +------------------- savevm.c | 40 ++--- 10 files changed, 646 insertions(+), 519 deletions(-) create mode 100644 block/qapi.c create mode 100644 block/snapshot.c create mode 100644 include/block/qapi.h create mode 100644 include/block/snapshot.h