qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 2/2] ramblock: add new hmp command "info ramb


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH v3 2/2] ramblock: add new hmp command "info ramblock"
Date: Fri, 28 Apr 2017 12:07:41 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

* Peter Xu (address@hidden) wrote:
> On Fri, Apr 28, 2017 at 06:21:30PM +0800, Peter Xu wrote:
> > On Thu, Apr 27, 2017 at 12:23:14PM +0100, Dr. David Alan Gilbert wrote:
> 
> [...]
> 
> > > > +void ram_block_dump(Monitor *mon)
> > > > +{
> > > > +    RAMBlock *block;
> > > > +
> > > > +    rcu_read_lock();
> > > > +    monitor_printf(mon, "%24s %8s  %18s %18s %18s\n",
> > > > +                   "Block Name", "PSize", "Offset", "Used", "Total");
> > > > +    RAMBLOCK_FOREACH(block) {
> > > > +        monitor_printf(mon, "%24s %8s  0x%016" PRIx64 " 0x%016" PRIx64
> > > > +                       " 0x%016" PRIx64 "\n", block->idstr,
> > > > +                       page_size_to_str(block->page_size),
> > > > +                       (uint64_t)block->offset,
> > > > +                       (uint64_t)block->used_length,
> > > > +                       (uint64_t)block->max_length);
> > > > +    }
> > > 
> > > Yes that should work, I remember there's a RAM_ADDR_FMT macro that's
> > > supposed to be usable for ram_addr_t, but that's fine.
> > 
> > That looks better. Will switch to that. Thanks!
> 
> Oh, I found that RAM_ADDR_FMT didn't allow me to do the formatting
> with width ("%016..."). So maybe I'll still use current way for now.

Oh then just stick to the PRIx64 and the case; it's fine.

Dave

> -- 
> Peter Xu
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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