Message ID | 1345056344-31849-1-git-send-email-mdroth@linux.vnet.ibm.com |
---|---|
State | New |
Headers | show |
On 08/15/2012 12:45 PM, Michael Roth wrote: > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> > --- > qlist.c | 13 +++++++++++++ > qlist.h | 1 + > 2 files changed, 14 insertions(+) No cover-letter? Reviewed-by: Eric Blake <eblake@redhat.com>
On Wed, Aug 15, 2012 at 01:52:33PM -0600, Eric Blake wrote: > On 08/15/2012 12:45 PM, Michael Roth wrote: > > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> > > --- > > qlist.c | 13 +++++++++++++ > > qlist.h | 1 + > > 2 files changed, 14 insertions(+) > > No cover-letter? Started off as 1 patch with the explanation in the commit > > Reviewed-by: Eric Blake <eblake@redhat.com> > > -- > Eric Blake eblake@redhat.com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >
On Wed, 15 Aug 2012 13:45:42 -0500 Michael Roth <mdroth@linux.vnet.ibm.com> wrote: > > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> 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. > --- > 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)
On Thu, Aug 16, 2012 at 10:40:05AM -0300, Luiz Capitulino wrote: > On Wed, 15 Aug 2012 13:45:42 -0500 > Michael Roth <mdroth@linux.vnet.ibm.com> wrote: > > > > > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> > > 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) >
On Thu, 16 Aug 2012 14:23:40 -0500 Michael Roth <mdroth@linux.vnet.ibm.com> wrote: > On Thu, Aug 16, 2012 at 10:40:05AM -0300, Luiz Capitulino wrote: > > On Wed, 15 Aug 2012 13:45:42 -0500 > > Michael Roth <mdroth@linux.vnet.ibm.com> wrote: > > > > > > > > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> > > > > 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. I've already tested it, and worked fine here. Let it go through Anthony's work flow then, saves me a pull request :)
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)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> --- qlist.c | 13 +++++++++++++ qlist.h | 1 + 2 files changed, 14 insertions(+)