[libvirt] [PATCH perl] Remove use of Data::Dumper from example programs
Daniel P. Berrangé
berrange at redhat.com
Tue Feb 6 18:10:57 UTC 2018
On Tue, Feb 06, 2018 at 01:01:42PM -0500, Laine Stump wrote:
> On 02/06/2018 11:36 AM, Daniel P. Berrangé wrote:
> > Using Data::Dumper in examples does not help devs understand the data
> > structures that the Perl APIs are returning. Change to explicit field
> > accesses to illustrate it better
> >
> > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
>
> Reviewed-By: Laine Stump <laine at laine.org>
>
> But are you sure you really want to go to all this trouble just for
> perl-deficients like me? :-)
>
> > ---
> > Virt.xs | 1 -
> > examples/dhcp-leases.pl | 2 --
> > examples/dom-fsinfo.pl | 8 +++-----
> > examples/dom-ifinfo.pl | 14 +++++++++-----
> > examples/dom-stats.pl | 9 +++------
> > examples/node-info.pl | 26 +++++++++++++++++++-------
> > 6 files changed, 34 insertions(+), 26 deletions(-)
> >
> > diff --git a/Virt.xs b/Virt.xs
> > index 7d2f1a7..1254df2 100644
> > --- a/Virt.xs
> > +++ b/Virt.xs
> > @@ -3358,7 +3358,6 @@ void get_all_domain_stats(con, stats, doms_sv=&PL_sv_undef, flags=0)
> > if (SvOK(doms_sv)) {
> > doms_av = (AV*)SvRV(doms_sv);
> > ndoms = av_len(doms_av) + 1;
> > - fprintf(stderr, "Len %d\n", ndoms);
>
> Did you mean to include this change? It's obviously something that
> accidentally snuck in during debugging, but it's not related to
> Data::Dumper(). (If you're okay with combining it into this patch, so am
> I, I just wanted to check).
Yeah, I'll merge it separately since it is unrelated.
>
> > } else {
> > ndoms = 0;
> > }
> > diff --git a/examples/dhcp-leases.pl b/examples/dhcp-leases.pl
> > index af9bd41..a2202d9 100644
> > --- a/examples/dhcp-leases.pl
> > +++ b/examples/dhcp-leases.pl
> > @@ -1,8 +1,6 @@
> > #!/usr/bin/perl
> >
> > -use Acme::ChuckNorris;
>
> I'm disappointed that this module was being referenced but not actually
> used :-)
Patch rebase/squash snafu. v2 coming up
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list