From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAz6q-00088k-9G for qemu-devel@nongnu.org; Mon, 10 Sep 2012 04:12:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAz6j-0003AV-R3 for qemu-devel@nongnu.org; Mon, 10 Sep 2012 04:12:44 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:49928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAz6j-000383-9G for qemu-devel@nongnu.org; Mon, 10 Sep 2012 04:12:37 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Sep 2012 18:11:12 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8A832ZQ23789598 for ; Mon, 10 Sep 2012 18:03:02 +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 q8A8C7it001663 for ; Mon, 10 Sep 2012 18:12:07 +1000 Message-ID: <504DA089.2070005@linux.vnet.ibm.com> Date: Mon, 10 Sep 2012 16:10:49 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1346663926-20188-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1346663926-20188-2-git-send-email-xiawenc@linux.vnet.ibm.com> <5044AE18.5030503@redhat.com> <50457267.2080806@linux.vnet.ibm.com> <5045A499.1030505@redhat.com> In-Reply-To: <5045A499.1030505@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/6] libqblock APIs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Paolo Bonzini > Il 04/09/2012 05:15, Wenchao Xia ha scritto: >>> >>> Can you use GError instead? >>> >> read through the GError doc, GError is defined as following: >> struct GError { >> GQuark domain; >> gint code; >> gchar *message; >> }; >> I am worried about the message member, I guess program would be >> aborted if OOM, which I was tring to avoid, so I used char err_msg[1024] >> in my code, and make things simpler. > > That's true. On the other hand, and IMHO, not aborting in the library > code is a non-goal as long as the rest of the block layer still does. > About the Gerror lib, with a look at its doc, I think it provides similar capabilities with my implement, no key feature provided. Considering the memory issue, I hope to drop Gerror now. >>>> 3 QBlockInfoImageStatic. Now it is not folded with location and >>>> format. >>> >>> What does "Static" mean? >>> >> It is about sorting the information into following kinds: >> 1) static. It is values that defined at creating time/modifying time, >> mostly some settings, and it would not be automatically changed in I/O. >> 2) dynamic. Some information that would changes in I/O and other >> operations, such as allocated_size, snapshots. >> 3) statistics. >> Now only static one is provided, so I added _static suffix. > > Makes sense, thanks for the clarification. Perhaps QBlockStaticInfo is > a shorter and simpler name? > > Paolo > -- Best Regards Wenchao Xia