From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7CAB-0002Be-Og for qemu-devel@nongnu.org; Fri, 02 Jan 2015 19:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7CA9-0008Us-Gd for qemu-devel@nongnu.org; Fri, 02 Jan 2015 19:01:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7CA9-0008Un-A9 for qemu-devel@nongnu.org; Fri, 02 Jan 2015 19:01:49 -0500 Message-ID: <54A73169.2070901@redhat.com> Date: Fri, 02 Jan 2015 19:01:45 -0500 From: John Snow MIME-Version: 1.0 References: <1419692504-29373-1-git-send-email-peter@lekensteyn.nl> <1419692504-29373-5-git-send-email-peter@lekensteyn.nl> In-Reply-To: <1419692504-29373-5-git-send-email-peter@lekensteyn.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/10] block/dmg: process a buffer instead of reading ints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Wu , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi On 12/27/2014 10:01 AM, Peter Wu wrote: > As the decoded plist XML is not a pointer in the file, > dmg_read_mish_block must be able to process a buffer instead of a file > pointer. Since the full buffer must be processed, let's change the > return value again to just a success flag. > > Signed-off-by: Peter Wu > --- > block/dmg.c | 60 ++++++++++++++++++++++++++++++------------------------------ > 1 file changed, 30 insertions(+), 30 deletions(-) > > diff --git a/block/dmg.c b/block/dmg.c > index 7f49388..75e771a 100644 > --- a/block/dmg.c > +++ b/block/dmg.c [snip] I see; because your plist XML implementation has to decode base64 data, this function needs to be able to operate on a buffer instead of taking an offset into the file, because we may need to do some processing on the mish data first. Reviewed-by: John Snow