From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzPj0-0002e0-Mv for qemu-devel@nongnu.org; Thu, 09 Aug 2012 06:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzPiz-00074A-QJ for qemu-devel@nongnu.org; Thu, 09 Aug 2012 06:12:18 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:44831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzPiz-000741-9O for qemu-devel@nongnu.org; Thu, 09 Aug 2012 06:12:17 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Aug 2012 20:11:59 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q79A3XgM26280182 for ; Thu, 9 Aug 2012 20:03:33 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q79AC8Z8025547 for ; Thu, 9 Aug 2012 20:12:08 +1000 From: Wenchao Xia Date: Thu, 9 Aug 2012 18:10:50 +0800 Message-Id: <1344507050-11054-1-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: [Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, aliguori@us.ibm.com, Wenchao Xia , pbonzini@redhat.com This patch intrudce libqblock API, libqblock-test is used as a test case. V2: Using struct_size and [xxx]_new [xxx]_free to keep ABI. Using embbed structure to class format options in image creating. Format specific options were brought to surface. Image format was changed to enum interger instead of string. Some API were renamed. Internel error with errno was saved and with an API caller can get it. ALL flags used were defined in libqblock.h. Something need discuss: Embbed structure or union could make the model more friendly, but that make ABI more difficult, because we need to check every embbed structure's size and guess compiler's memory arrangement. This means #pragma pack(4) or struct_size, offset_next in every structure. Any better way to solve it? or make every structure a plain one? AIO is missing, need a prototype. Wenchao Xia (3): adding libqblock libqblock API libqblock test case Makefile | 3 + block.c | 2 +- block.h | 1 + libqblock-test.c | 197 ++++++++++++++++ libqblock.c | 670 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ libqblock.h | 447 ++++++++++++++++++++++++++++++++++++ 6 files changed, 1319 insertions(+), 1 deletions(-) create mode 100644 libqblock-test.c create mode 100644 libqblock.c create mode 100644 libqblock.h