From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh9MB-0001bW-76 for qemu-devel@nongnu.org; Mon, 27 May 2013 22:09:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uh9M9-0006V0-6r for qemu-devel@nongnu.org; Mon, 27 May 2013 22:09:47 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:38779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh9M8-0006UL-IZ for qemu-devel@nongnu.org; Mon, 27 May 2013 22:09:45 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 May 2013 07:34:14 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 237D3125804F for ; Tue, 28 May 2013 07:41:38 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4S29Usd63635552 for ; Tue, 28 May 2013 07:39:30 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4S29YZK011894 for ; Tue, 28 May 2013 12:09:35 +1000 Message-ID: <51A411D6.7010505@linux.vnet.ibm.com> Date: Tue, 28 May 2013 10:09:26 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1369451385-23452-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1369451385-23452-5-git-send-email-xiawenc@linux.vnet.ibm.com> <20130527110238.289c9dc7@redhat.com> <20130527154059.GG2373@dhcp-200-207.str.redhat.com> In-Reply-To: <20130527154059.GG2373@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: phrdina@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com, Luiz Capitulino 于 2013-5-27 23:40, Kevin Wolf 写道: > Am 27.05.2013 um 17:02 hat Luiz Capitulino geschrieben: >> On Sat, 25 May 2013 11:09:45 +0800 >> Wenchao Xia wrote: >> >>> bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer now, >>> some internal buffers are still used for format control, which have no >>> chance to be truncated. As a result, these two functions have no more issue >>> of truncation, and they can be used by both qemu and qemu-img with correct >>> parameter specified. >>> >>> Signed-off-by: Wenchao Xia >> >> I don't like the casting and the void pointers very much, but I can't >> suggest anything better: > > Maybe introduce and use a different function pointer type that > explicitly takes void* instead of FILE*. You'd still have to cast the > function pointers (and now actually in all instances), but then at least > nobody can accidentally misinterpret a Monitor* as FILE*. > > Kevin > You mean change typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) GCC_FMT_ATTR(2, 3); to typedef int (*fprintf_function)(void *out, const char *fmt, ...) GCC_FMT_ATTR(2, 3); ? -- Best Regards Wenchao Xia