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

Re: [Libguestfs] [PATCH 5/8] Converter: Remove VMware tools if it is installed



On Thu, Feb 04, 2010 at 10:14:38AM +0000, Matthew Booth wrote:
> On 04/02/10 09:51, Richard W.M. Jones wrote:
> > On Mon, Feb 01, 2010 at 05:23:33PM +0000, Matthew Booth wrote:
> >> @@ -393,11 +394,6 @@ sub _unconfigure_xen
> >>  {
> >>      my ($guestos, $desc) = @_;
> >>  
> >> -    carp("unconfigure called without guestos argument")
> >> -        unless defined($guestos);
> >> -    carp("unconfigure called without desc argument")
> >> -        unless defined($desc);
> >> -
> >>      my $found_kmod = 0;
> > 
> > What was the point of removing these checks?
> 
> They were used inconsistently. I originally put them in when the
> 'external' interface was larger, and I only put them on the external
> interface. I've been removing them for internal calls.
> 
> These checks are really just a way to get round perl's inability to
> check functions calls at 'compile' time. In practice, though, the lack
> of type information makes them of limited use. For example, if I changed
> the second argument to be a Sys::Virt handle, it wouldn't notice. In
> practise, they haven't been catching the errors I've actually been
> making. In short, I've gone off these checks.

ACK.

You can also use Perl prototypes (not that they'll catch type
errors, but hey it's a dynamically typed language ...)

sub _unconfigure_xen ($$)
{
  ...
}

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw


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