Sys::VirtV2V::Converter::Windows.3pm

Langue: en

Version: 2010-07-01 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

Sys::VirtV2V::Converter::Windows - Pre-convert a Windows guest to run on KVM

SYNOPSIS

  use Sys::VirtV2V::GuestOS;
  use Sys::VirtV2V::Converter;
 
  my $guestos = Sys::VirtV2V::GuestOS->instantiate($g, $os);
  Sys::VirtV2V::Converter->convert($g, $guestos, $desc, $devices, $config);
 
 

DESCRIPTION

Sys::VirtV2V::Converter::Windows does the ``pre-conversion'' steps required to get a Windows guest to boot on KVM. Unlike the associated Sys::VirtV2V::Converter::Linux(3) module, this doesn't do a full conversion of Windows. Instead it just installs the viostor (Windows virtio block) driver, so that the Windows guest will be able to boot on the target. A ``RunOnce'' script is also added to the VM which does all the rest of the conversion the first time the Windows VM is booted on KVM.

Note when reading the code: this module just ``directs'' the conversion. The actual changes are made by the Sys::VirtV2V::GuestOS::Windows(3) module. We've agreed that the separation of GuestOS and Converter is wrong; they should be combined, but we haven't done that yet.

METHODS

Sys::VirtV2V::Converter::Windows->can_handle(desc)
Return 1 if Sys::VirtV2V::Converter::Windows can convert the guest described by desc, 0 otherwise.
Sys::VirtV2V::Converter::Windows->convert($g, $guestos, $desc, $devices, $config)
(Pre-)convert a Windows guest. Assume that can_handle has previously returned 1.
g
A libguestfs handle to the target.
guestos
An initialised Sys::VirtV2V::GuestOS for manipulating the guest OS>.
desc
A description of the guest OS as returned by Sys::Guestfs::Lib.
devices
An arrayref of libvirt storage device names, in the order they will be presented to the guest.
_preconvert
Preconvert a Windows guest so that it can boot on KVM with virtio. We do the minimum changes necessary here: Installing the viostor driver, then installing a service which will complete the conversion when Windows is booted first time on KVM.

To install the viostor driver, we use Sys::Guestfs(3) (libguestfs) and Win::Hivex::Regedit(3) (hivex) to drop the correct files and registry changes in place. We don't have access to the Win32 API, so we cannot do this using the normal methods.

Similarly, we make registry changes to ensure the service runs at next boot.

Copyright (C) 2009-2010 Red Hat Inc.

LICENSE

Please see the file COPYING.LIB for the full license.

SEE ALSO

Sys::VirtV2V::Converter(3pm), Sys::VirtV2V(3pm), virt-v2v(1), <http://libguestfs.org/>.