From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCQpS-00088q-ER for qemu-devel@nongnu.org; Sat, 17 Jan 2015 05:42:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCQpR-0001Jv-Bz for qemu-devel@nongnu.org; Sat, 17 Jan 2015 05:42:06 -0500 Received: from mail.lekensteyn.nl ([2a02:2308::360:1:25]:35900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCQpR-0001JI-24 for qemu-devel@nongnu.org; Sat, 17 Jan 2015 05:42:05 -0500 From: Peter Wu Date: Sat, 17 Jan 2015 11:41:59 +0100 Message-ID: <1497100.KaIgobZClN@al> In-Reply-To: References: <1421422633-25536-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [Qemu-devel] [PULL 00/16] Block patches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Hajnoczi On Friday 16 January 2015 16:46:39 Peter Maydell wrote: > CentOS5: > > ../block/dmg.o: In function `dmg_read_plist_xml': > /home/petmay01/linaro/qemu-for-merges/block/dmg.c:414: undefined > reference to `g_base64_decode_inplace' Should have paid more attention to the API docs. Can you try the following patch? It still passes 4 dmg tests for me (https://lekensteyn.nl/files/dmg-tests/). -- Kind regards, Peter https://lekensteyn.nl -- >>From 462454e820d2fa5f8eefe7b039d6ea32e4a88d41 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 17 Jan 2015 11:34:32 +0100 Subject: [PATCH] block/dmg: fix compatibility with glib 2.12 For compatibility with glib 2.12, use g_base64_decode (which additionally requires an extra buffer allocation) instead of g_base64_decode_inplace (which is only available since glib 2.20). Signed-off-by: Peter Wu --- block/dmg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/dmg.c b/block/dmg.c index 4e24076..0430f55 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -403,6 +403,7 @@ static int dmg_read_plist_xml(BlockDriverState *bs, DmgHeaderState *ds, * and line feeds. */ data_end = (char *)buffer; while ((data_begin = strstr(data_end, "")) != NULL) { + guchar *mish; gsize out_len = 0; data_begin += 6; @@ -413,9 +414,9 @@ static int dmg_read_plist_xml(BlockDriverState *bs, DmgHeaderState *ds, goto fail; } *data_end++ = '\0'; - g_base64_decode_inplace(data_begin, &out_len); - ret = dmg_read_mish_block(s, ds, (uint8_t *)data_begin, - (uint32_t)out_len); + mish = g_base64_decode(data_begin, &out_len); + ret = dmg_read_mish_block(s, ds, mish, (uint32_t)out_len); + g_free(mish); if (ret < 0) { goto fail; } -- 2.2.2