qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3.2 31/31] hmp: add info memdev


From: Hu Tao
Subject: Re: [Qemu-devel] [PATCH v3.2 31/31] hmp: add info memdev
Date: Mon, 9 Jun 2014 10:28:23 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Jun 08, 2014 at 01:10:37PM +0300, Michael S. Tsirkin wrote:
> On Wed, May 14, 2014 at 05:43:35PM +0800, Hu Tao wrote:
> > This is the hmp counterpart of qmp query-memdev.
> > 
> > Signed-off-by: Hu Tao <address@hidden>
> > ---
> >  hmp.c     | 36 ++++++++++++++++++++++++++++++++++++
> >  hmp.h     |  1 +
> >  monitor.c |  7 +++++++
> >  3 files changed, 44 insertions(+)
> > 
> > diff --git a/hmp.c b/hmp.c
> > index 5c4d612..1d5bf2d 100644
> > --- a/hmp.c
> > +++ b/hmp.c
> > @@ -22,6 +22,8 @@
> >  #include "qemu/sockets.h"
> >  #include "monitor/monitor.h"
> >  #include "qapi/opts-visitor.h"
> > +#include "qapi/string-output-visitor.h"
> > +#include "qapi-visit.h"
> >  #include "ui/console.h"
> >  #include "block/qapi.h"
> >  #include "qemu-io.h"
> > @@ -1671,3 +1673,37 @@ void hmp_object_del(Monitor *mon, const QDict *qdict)
> >      qmp_object_del(id, &err);
> >      hmp_handle_error(mon, &err);
> >  }
> > +
> > +void hmp_info_memdev(Monitor *mon, const QDict *qdict)
> > +{
> > +    Error *err = NULL;
> > +    MemdevList *memdev_list = qmp_query_memdev(&err);
> > +    MemdevList *m = memdev_list;
> > +    StringOutputVisitor *ov;
> > +    int i = 0;
> > +
> > +
> > +    while (m) {
> > +        ov = string_output_visitor_new(false);
> > +        visit_type_uint16List(string_output_get_visitor(ov),
> > +                              &m->value->host_nodes, NULL, NULL);
> > +        monitor_printf(mon, "memory device %d\n", i);
> > +        monitor_printf(mon, "  size: %ld\n", m->value->size);
> 
> Fails build on 32 bit:
> 
> hmp.c:1696:9: error: format ‘%ld’ expects argument of type ‘long int’,
> but argument 3 has type ‘uint64_t’ [-Werror=format=]
>          monitor_printf(mon, "  size: %ld\n", m->value->size);
> 
> this must use PRId64.

Thanks.

Hu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]