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: Peter Xu
Subject: Re: [Qemu-devel] [PATCH v3 2/2] ramblock: add new hmp command "info ramblock"
Date: Fri, 28 Apr 2017 18:39:50 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

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.

-- 
Peter Xu



reply via email to

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