From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T25fV-0004qf-Ts for qemu-devel@nongnu.org; Thu, 16 Aug 2012 15:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T25fU-0007V3-Vb for qemu-devel@nongnu.org; Thu, 16 Aug 2012 15:23:45 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:41568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T25fU-0007Up-QD for qemu-devel@nongnu.org; Thu, 16 Aug 2012 15:23:44 -0400 Received: by obbta14 with SMTP id ta14so3854752obb.4 for ; Thu, 16 Aug 2012 12:23:44 -0700 (PDT) Sender: fluxion Date: Thu, 16 Aug 2012 14:23:40 -0500 From: Michael Roth Message-ID: <20120816192340.GM16157@illuin> References: <1345056344-31849-1-git-send-email-mdroth@linux.vnet.ibm.com> <20120816104005.67581ecf@doriath.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120816104005.67581ecf@doriath.home> Subject: Re: [Qemu-devel] [PATCH for-1.2 v3 1/3] qlist: add qlist_size() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Thu, Aug 16, 2012 at 10:40:05AM -0300, Luiz Capitulino wrote: > On Wed, 15 Aug 2012 13:45:42 -0500 > Michael Roth wrote: > > > > > Signed-off-by: Michael Roth > > I've applied this series to the qmp branch for 1.2. I'll run some tests and if > all goes alright will send a pull request shortly. > I just noticed via our fancy #qemu github bot that Anthony applied these already, but I asked about and if you want to test/submit through your queue it should all work out. So either way. Thanks! > > --- > > qlist.c | 13 +++++++++++++ > > qlist.h | 1 + > > 2 files changed, 14 insertions(+) > > > > diff --git a/qlist.c b/qlist.c > > index 88498b1..b48ec5b 100644 > > --- a/qlist.c > > +++ b/qlist.c > > @@ -124,6 +124,19 @@ int qlist_empty(const QList *qlist) > > return QTAILQ_EMPTY(&qlist->head); > > } > > > > +static void qlist_size_iter(QObject *obj, void *opaque) > > +{ > > + size_t *count = opaque; > > + (*count)++; > > +} > > + > > +size_t qlist_size(const QList *qlist) > > +{ > > + size_t count = 0; > > + qlist_iter(qlist, qlist_size_iter, &count); > > + return count; > > +} > > + > > /** > > * qobject_to_qlist(): Convert a QObject into a QList > > */ > > diff --git a/qlist.h b/qlist.h > > index d426bd4..ae776f9 100644 > > --- a/qlist.h > > +++ b/qlist.h > > @@ -49,6 +49,7 @@ void qlist_iter(const QList *qlist, > > QObject *qlist_pop(QList *qlist); > > QObject *qlist_peek(QList *qlist); > > int qlist_empty(const QList *qlist); > > +size_t qlist_size(const QList *qlist); > > QList *qobject_to_qlist(const QObject *obj); > > > > static inline const QListEntry *qlist_first(const QList *qlist) >