All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL v2] pci, pc, virtio fixes and cleanups
Date: Tue, 3 Mar 2015 17:40:31 +0100	[thread overview]
Message-ID: <20150303164031.GC17209@redhat.com> (raw)
In-Reply-To: <54F5C8CD.5010707@redhat.com>

On Tue, Mar 03, 2015 at 03:44:29PM +0100, Paolo Bonzini wrote:
> 
> 
> On 03/03/2015 15:37, Peter Maydell wrote:
> > Doesn't build with our minimum glib requirement, I'm afraid:
> > 
> > /home/petmay01/linaro/qemu-for-merges/hw/acpi/aml-build.c:313:
> > undefined reference to `g_ptr_array_new_with_free_func'
> > 
> > (that function only appeared in glib 2.22.)
> 
> >From a few weeks ago:
> 
> > Moving beyond 2.22 would be awkward for me in that my OSX
> > box only has 2.22 because fink doesn't have anything newer.
> > I could probably deal with that somehow (switching to some
> > other package system, probably).
> > 
> > Debian stable is "2.33.12+really2.32.4-5" and oldstable
> > is "2.24.2-1" (and if my googling is right is an LTS release).
> > 
> > Ubuntu Lucid (LTS release) is 2.24; Precise (also LTS)
> > is 2.32.
> > 
> > Daniel says RHEL6 has 2.28.
> > 
> > That suggests to me that we could reasonably advance to
> > 2.22 or 2.24 if it seemed beneficial, but not beyond that.
> > Is there anything particularly worthwhile that would get us?
> 
> Maybe we have a candidate now.  That function doesn't seem easy to
> replace, and it is pretty useful.
> 
> Paolo


It's my mistake.
It does seem trivial to replace:

-->

aml-build: fix build for glib < 2.22

g_ptr_array_new_with_free_func is there since glib 2.22,
use the older g_ptr_array_foreach instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

---

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 3e5949b..f46c96c 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -299,7 +299,7 @@ static Aml *aml_bundle(uint8_t op, AmlBlockFlags flags)
     return var;
 }
 
-static void aml_free(gpointer data)
+static void aml_free(gpointer data, gpointer user_data)
 {
     Aml *var = data;
     build_free_array(var->buf);
@@ -310,13 +310,14 @@ Aml *init_aml_allocator(void)
     Aml *var;
 
     assert(!alloc_list);
-    alloc_list = g_ptr_array_new_with_free_func(aml_free);
+    alloc_list = g_ptr_array_new();
     var = aml_alloc();
     return var;
 }
 
 void free_aml_allocator(void)
 {
+    g_ptr_array_foreach(alloc_list, aml_free, NULL)
     g_ptr_array_free(alloc_list, true);
     alloc_list = 0;
 }

  parent reply	other threads:[~2015-03-03 17:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 16:59 [Qemu-devel] [PULL v2] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-03-03 14:37 ` Peter Maydell
2015-03-03 14:44   ` Paolo Bonzini
2015-03-03 15:03     ` Igor Mammedov
2015-03-03 15:05       ` Paolo Bonzini
2015-03-03 15:11         ` Peter Maydell
2015-03-03 15:29           ` Paolo Bonzini
2015-03-03 15:31           ` Igor Mammedov
2015-03-03 15:55           ` Alex Bennée
2015-03-03 15:57             ` Paolo Bonzini
2015-03-03 16:40     ` Michael S. Tsirkin [this message]
2015-03-03 17:37   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150303164031.GC17209@redhat.com \
    --to=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.