[libvirt] [PATCH 2/3] Add Processor Information to virSysinfoRead() from dmidecode type 4
Minoru Usui
usui at mxm.nes.nec.co.jp
Mon Jun 27 02:28:40 UTC 2011
Hi,
On Fri, 24 Jun 2011 15:24:00 +0100
"Daniel P. Berrange" <berrange at redhat.com> wrote:
> On Tue, Jun 21, 2011 at 01:20:30PM +0900, Minoru Usui wrote:
> > Add Processor Information to virSysinfoRead() from dmidecode type 4
> >
> > Signed-off-by: Minoru Usui <usui at mxm.nes.nec.co.jp>
> > ---
> > src/util/sysinfo.c | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> > src/util/sysinfo.h | 19 +++++
> > 2 files changed, 225 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
> > index 53122f7..a1eb92b 100644
> > --- a/src/util/sysinfo.c
> > +++ b/src/util/sysinfo.c
> > @@ -72,6 +72,9 @@ void virSysinfoDefFree(virSysinfoDefPtr def)
> > VIR_FREE(def->system_uuid);
> > VIR_FREE(def->system_sku);
> > VIR_FREE(def->system_family);
> > +
> > + VIR_FREE(def->processor);
>
> This frees the 'virProcessinfoDef' instance, but what
> about all the allocated strings inside it ?
I'm sorry. It's my fault.
But Mr. Veillard fixed these memory leaks. Thank a lot.
> > +
> > VIR_FREE(def);
> > }
> >
> > @@ -190,6 +193,107 @@ no_memory:
> > return NULL;
> > }
> >
> > +static char *
> > +parseProcessorInfo(char *base, virSysinfoDefPtr ret)
>
> As with previous patch, please add 'virSysinfo' prefix on all
> method names
OK.
I'll add prefix.
>
> > +static void
> > +ProcessorInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
>
> > diff --git a/src/util/sysinfo.h b/src/util/sysinfo.h
> > index f69b76c..f098e9d 100644
> > --- a/src/util/sysinfo.h
> > +++ b/src/util/sysinfo.h
> > @@ -33,6 +33,22 @@ enum virSysinfoType {
> > VIR_SYSINFO_LAST
> > };
> >
> > +typedef struct _virProcessorinfoDef virProcessorinfoDef;
> > +typedef virProcessorinfoDef *virProcessorinfoDefPtr;
> > +struct _virProcessorinfoDef {
> > + char *processor_socket_destination;
> > + char *processor_type;
> > + char *processor_family;
> > + char *processor_manufacturer;
> > + char *processor_signature;
> > + char *processor_version;
> > + char *processor_external_clock;
> > + char *processor_max_speed;
> > + char *processor_status;
> > + char *processor_serial_number;
> > + char *processor_part_number;
> > +};
>
> All these strings are leaked AFAICT
>
> Also can we name this struct
>
> virSysinfoProcessorDef
OK.
I'll change it.
>
> Regards,
> Daniel
> --
> |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org -o- http://virt-manager.org :|
> |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
--
Minoru Usui <usui at mxm.nes.nec.co.jp>
More information about the libvir-list
mailing list