Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-10 Thread Jamie Lokier
Anthony Liguori wrote: > Jamie Lokier wrote: > >Adam Litke wrote: > > > >>+s->stats.pswapin = has_feature(dev, > >>VIRTIO_BALLOON_F_RPT_SWAP_OUT) ? > >>+ dev->stats.pswapin : -1; > >> > > > >(etc.) > > > >Why not simply have the guest fill in the

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-09 Thread Anthony Liguori
Jamie Lokier wrote: Adam Litke wrote: +s->stats.pswapin = has_feature(dev, VIRTIO_BALLOON_F_RPT_SWAP_OUT) ? + dev->stats.pswapin : -1; (etc.) Why not simply have the guest fill in the unused fields with -1, and say that's how "no meaningfu

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-09 Thread Adam Litke
On Mon, 2009-11-09 at 19:01 +, Jamie Lokier wrote: > These days, would it make more sense to emit a QJSON object? > > In this case the JSON object is quite human readable too. I'm not very particular on the output format since it's main consumer is likely another program. Is XML output via t

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-09 Thread Adam Litke
On Mon, 2009-11-09 at 19:00 +, Jamie Lokier wrote: > Adam Litke wrote: > > +s->stats.pswapin = has_feature(dev, VIRTIO_BALLOON_F_RPT_SWAP_OUT) > > ? > > + dev->stats.pswapin : -1; > > (etc.) > > Why not simply have the guest fill in the unused fi

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-09 Thread Jamie Lokier
Adam Litke wrote: > +static inline void print_stat(Monitor *mon, uint32_t val, const char *label) > +{ > +if (val != -1) { > +monitor_printf(mon, ",%s=%u", label, val); > +} > +} > + > static void do_info_balloon(Monitor *mon) > { > -ram_addr_t actual; > +QEMUBalloonState

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-09 Thread Jamie Lokier
Adam Litke wrote: > +s->stats.pswapin = has_feature(dev, VIRTIO_BALLOON_F_RPT_SWAP_OUT) ? > + dev->stats.pswapin : -1; (etc.) Why not simply have the guest fill in the unused fields with -1, and say that's how "no meaningful value" is represented in t

[Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning (V2)

2009-11-09 Thread Adam Litke
Changes since V1: - In the monitor, print all stats on one line with less abbreviated names - Coding style changes When using ballooning to manage overcommitted memory on a host, a system for guests to communicate their memory usage to the host can provide information that will minimize the impact

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning

2009-11-09 Thread Anthony Liguori
Avi Kivity wrote: (qemu) info balloon balloon: actual=1024 MB balloon: pswapin=0 pages balloon: pswapout=0 pages balloon: panon=3928 KB balloon: pgmajfault=0 balloon: pgminfault=247914 balloon: memfree=987032 KB ba

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning

2009-11-08 Thread Jamie Lokier
Avi Kivity wrote: > > (qemu) info balloon > > balloon: actual=1024 MB > > balloon: pswapin=0 pages > > balloon: pswapout=0 pages > > balloon: panon=3928 KB > > balloon: pgmajfault=0 > > balloon: pgminfault=247914 >

Re: [Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning

2009-11-08 Thread Avi Kivity
On 11/06/2009 12:50 AM, Adam Litke wrote: [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning When using ballooning to manage overcommitted memory on a host, a system for guests to communicate their memory usage to the host can provide information

[Qemu-devel] [RFC] virtio: Report new guest memory statistics pertinent to memory ballooning

2009-11-05 Thread Adam Litke
[RFC] virtio: Report new guest memory statistics pertinent to memory ballooning When using ballooning to manage overcommitted memory on a host, a system for guests to communicate their memory usage to the host can provide information that will minimize the impact of ballooning