Re: [PATCH] libvirt-tck: prefer kvm if multiple domain types exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, March 07, 2014 05:55:34 PM Osier Yang wrote:
> > -	    return ($domains[0],
> > +        # Prefer kvm if multiple domain types are returned
> > +        my $domain;
> > +        if (int(@domains) gt 1) {
> > +            for (my $j = 0 ; $j < int(@domains) ; $j++) {
> 
> I would use "grep" instead of iterating over all the elements:
> 
> $domain = "kvm" if (grep /^kvm$/, @domains);

Good point. I'll fix the code.

> > +                $domain = "kvm" if ($domains[$j] eq "kvm");
> > +            }
> > +        }
> > +        # If kvm was not found, default to the first one
> > +        $domain = $domains[0] if (!defined($domain));
> > +
> > +        return ($domain,
> > 
> >   		    $caps->guest_domain_emulator($i, $domains[0]),
> 
> Indention problem.

This was due to a tab -vs- space issue. I'll match the existing syntax as well 
in the patch I'll resubmit.

-Mike

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]