Re: virt-clone bug

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

 



On Fri, Nov 23, 2007 at 02:36:03PM +0000, Richard W.M. Jones wrote:
> Richard W.M. Jones wrote:
> >The Debian maintainer of virt-install found this problem which seems to 
> >be a bug in virt-clone:
> >
> ># virt-clone -o demo -n demo2 --connect=qemu:///session -f bla2.img
> >libvir: QEMU error :
> >libvir: QEMU error :
> >Cloning from /home/foo/kvm/test/bla.img to bla2.img
> >ERROR:  local variable 'b' referenced before assignment
> 
> Judging from the error message, I'm guessing that it happens at the line 
> I've marked below (in virtinst/CloneManager.py):
> 
> while 1:
>      l = os.read(src_fd, design.clone_bs)
>      s = len(l)
>      if s == 0:
>           meter.end(size)
>           break
>      # check sequence of zeros
>      if sparse_copy_mode == True and zeros == l:
>           os.lseek(dst_fd, s, 1)
>      else:
>           b = os.write(dst_fd, l)
>      if s != b:			<--------
>           meter.end(i)
>           break
>      i += s
>      if i < size:
>           meter.update(i)
> 
> It's a very strange piece of code.  AIUI it seems to be saying that if 
> we get a short write, then we should just end the copy without any sort 
> of error indication, which can't be the right thing to do.

Yeah, that looks bogus. Guess that 'if s != b' got mis-indented. It
definitely needs to raise an error condition of some sort too.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux