[libvirt] [PATCH 10/10] qemu: monitor: Return struct from qemuMonitor(Text|Json)QueryCPUs

Peter Krempa pkrempa at redhat.com
Wed Aug 3 17:00:06 UTC 2016


On Wed, Aug 03, 2016 at 12:04:02 -0400, John Ferlan wrote:
> 
> 
> On 08/03/2016 04:11 AM, Peter Krempa wrote:
> > Prepare to extract more data by returning a array of structs rather than
> > just an array of thread ids. Additionally report fatal errors separately
> > from qemu not being able to produce data.
> > ---
> >  src/qemu/qemu_monitor.c      | 31 ++++++++++++-------
> >  src/qemu/qemu_monitor.h      |  6 ++++
> >  src/qemu/qemu_monitor_json.c | 71 ++++++++++++++++++++++----------------------
> >  src/qemu/qemu_monitor_json.h |  2 +-
> >  src/qemu/qemu_monitor_text.c | 37 +++++++++++------------
> >  src/qemu/qemu_monitor_text.h |  2 +-
> >  tests/qemumonitorjsontest.c  | 31 ++++++++++++++-----
> >  7 files changed, 104 insertions(+), 76 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> > index 0011ceb..578b078 100644
> > --- a/src/qemu/qemu_monitor.c
> > +++ b/src/qemu/qemu_monitor.c
> > @@ -1666,6 +1666,16 @@ qemuMonitorCPUInfoFree(qemuMonitorCPUInfoPtr cpus,
> >      VIR_FREE(cpus);
> >  }
> > 
> > +void
> > +qemuMonitorQueryCpusFree(struct qemuMonitorQueryCpusEntry *entries,
> > +                         size_t nentries ATTRIBUTE_UNUSED)
> > +{
> > +    if (!entries)
> > +        return;
> 
> [1] Maybe this should be a 'int' parameter and a <= 0 check...

What?! That's a freeing function. That does not make any sense.

> 
> > +
> > +    VIR_FREE(entries);
> > +}
> > +




More information about the libvir-list mailing list