28
28
ImportInstaller sets the Guest's boot device to that of the first disk
29
attached to the Guest (so, one of 'hd', 'cdrom', or 'floppy'). All the
29
attached to the Guest (so, one of 'hd', 'cdrom', or 'fd'). All the
30
30
user has to do is fill in the Guest object with the desired parameters.
33
33
# General Installer methods
35
def prepare(self, guest, meter, distro = None):
36
if len(guest.disks) == 0:
37
raise ValueError(_("A disk device must be specified."))
39
def get_install_xml(self, guest, isinstall):
41
# Signifies to the 'Guest' that there is no 'install' phase
44
bootdev = self._disk_to_bootdev(guest.disks[0])
46
return self._get_osblob_helper(isinstall=isinstall, guest=guest,
47
kernel=None, bootdev=bootdev)
34
def prepare(self, guest, meter):
49
37
def post_install_check(self, guest):
40
def has_install_phase(self):
44
def _get_bootdev(self, isinstall, guest):
46
return self.bootconfig.BOOT_DEVICE_HARDDISK
47
return self._disk_to_bootdev(guest.disks[0])
55
49
def _disk_to_bootdev(self, disk):
56
50
if disk.device == VirtualDisk.DEVICE_DISK:
51
return self.bootconfig.BOOT_DEVICE_HARDDISK
58
52
elif disk.device == VirtualDisk.DEVICE_CDROM:
53
return self.bootconfig.BOOT_DEVICE_CDROM
60
54
elif disk.device == VirtualDisk.DEVICE_FLOPPY:
55
return self.bootconfig.BOOT_DEVICE_FLOPPY
57
return self.bootconfig.BOOT_DEVICE_HARDDISK