2
# List of OS Specific data
4
# Copyright 2006-2008 Red Hat, Inc.
5
# Jeremy Katz <katzj@redhat.com>
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23
from VirtualDevice import VirtualDevice
24
from virtinst import _gettext as _
29
Default values for OS_TYPES keys. Can be overwritten at os_type or
33
NET = VirtualDevice.VIRTUAL_DEV_NET
34
DISK = VirtualDevice.VIRTUAL_DEV_DISK
35
INPUT = VirtualDevice.VIRTUAL_DEV_INPUT
36
SOUND = VirtualDevice.VIRTUAL_DEV_AUDIO
37
VIDEO = VirtualDevice.VIRTUAL_DEV_VIDEO
41
(support.SUPPORT_CONN_HV_VIRTIO, "virtio"),
47
(support.SUPPORT_CONN_HV_VIRTIO, "virtio"),
73
"pv_cdrom_install": False,
77
# "devname" : { "attribute" : [( ["applicable", "hv-type", list"],
78
# "recommended value for hv-types" ),]},
102
(support.SUPPORT_CONN_HV_SOUND_ICH6, "ich6"),
103
(support.SUPPORT_CONN_HV_SOUND_AC97, "ac97"),
116
def sort_helper(tosort, sortpref=None):
118
Helps properly sorting os dictionary entires
123
sortpref = sortpref or []
125
# Make sure we are sorting by 'sortby' if specified, and group distros
126
# by their 'distro' tag first and foremost
127
for key, osinfo in tosort.items():
128
if osinfo.get("skip"):
131
sortby = osinfo.get("sortby")
134
sortby_mappings[sortby] = key
136
distro = osinfo.get("distro") or "zzzzzzz"
137
if distro not in distro_mappings:
138
distro_mappings[distro] = []
139
distro_mappings[distro].append(sortby)
141
# We want returned lists to be sorted descending by 'distro', so we get
142
# debian5, debian4, fedora14, fedora13
144
# debian4, debian5, fedora13, fedora14
145
for distro_list in distro_mappings.values():
147
distro_list.reverse()
149
sorted_distro_list = distro_mappings.keys()
150
sorted_distro_list.sort()
152
for prefer in sortpref:
153
if not prefer in sorted_distro_list:
155
sorted_distro_list.remove(prefer)
156
sorted_distro_list.insert(0, prefer)
158
for distro in sorted_distro_list:
159
distro_list = distro_mappings[distro]
160
for key in distro_list:
161
orig_key = sortby_mappings[key]
162
retlist.append(orig_key)
166
def parse_key_entry(conn, hv_type, key_entry, defaults):
169
if type(key_entry) == list:
171
# List of tuples with (support -> value) mappings
172
for tup in key_entry:
177
# HV_ALL means don't check for support, just return the value
178
if support_key != HV_ALL:
179
support_ret = support.check_conn_hv_support(conn,
183
if support_ret != True:
193
if not found and defaults:
194
ret = parse_key_entry(conn, hv_type, defaults, None)
198
def lookup_osdict_key(conn, hv_type, os_type, var, key):
200
defaults = DEFAULTS[key]
203
if var and key in OS_TYPES[os_type]["variants"][var]:
204
dictval = OS_TYPES[os_type]["variants"][var][key]
205
elif key in OS_TYPES[os_type]:
206
dictval = OS_TYPES[os_type][key]
208
return parse_key_entry(conn, hv_type, dictval, defaults)
211
def lookup_device_param(conn, hv_type, os_type, var, device_key, param):
213
os_devs = lookup_osdict_key(conn, hv_type, os_type, var, "devices")
214
defaults = DEFAULTS["devices"]
216
for devs in [os_devs, defaults]:
217
if device_key not in devs:
220
return parse_key_entry(conn, hv_type, devs[device_key][param],
223
raise RuntimeError(_("Invalid dictionary entry for device '%s %s'" %
224
(device_key, param)))
227
# NOTE: keep variant keys using only lowercase so we can do case
228
# insensitive checks on user passed input
235
"label": "Red Hat Enterprise Linux 2.1",
239
"label": "Red Hat Enterprise Linux 3",
243
"label": "Red Hat Enterprise Linux 4",
248
"label": "Red Hat Enterprise Linux 5",
252
"label": "Red Hat Enterprise Linux 5.4 or later",
261
"label": "Red Hat Enterprise Linux 6",
272
"sortby": "fedora05",
273
"label": "Fedora Core 5",
277
"sortby": "fedora06",
278
"label": "Fedora Core 6",
282
"sortby": "fedora07",
287
"sortby": "fedora08",
292
"sortby": "fedora09",
296
# Apparently F9 has selinux errors when installing with virtio:
297
# https://bugzilla.redhat.com/show_bug.cgi?id=470386
303
"label": "Fedora 10",
311
"label": "Fedora 11",
320
"label": "Fedora 12",
329
"label": "Fedora 13", "distro": "fedora",
337
"label": "Fedora 14",
347
"label": "Fedora 15",
357
"label": "Fedora 16",
368
"label": "Suse Linux Enterprise Server",
373
"label": "Suse Linux Enterprise Server 11",
383
"label": "Mandriva Linux 2009 and earlier",
387
"label": "Mandriva Linux 2010 and later",
388
"distro": "mandriva",
397
"label": "Mandriva Enterprise Server 5.0",
398
"distro": "mandriva",
401
"label": "Mandriva Enterprise Server 5.1 and later",
402
"distro": "mandriva",
411
"label": "Debian Etch",
416
"label": "Debian Lenny",
426
"label": "Debian Squeeze",
438
"label": "Ubuntu 8.04 LTS (Hardy Heron)",
446
"label": "Ubuntu 8.10 (Intrepid Ibex)",
453
"label": "Ubuntu 9.04 (Jaunty Jackalope)",
461
"label": "Ubuntu 9.10 (Karmic Koala)",
469
"label": "Ubuntu 10.04 (Lucid Lynx)",
478
"label": "Ubuntu 10.10 (Maverick Meerkat)",
487
"label": "Ubuntu 11.04 (Natty Narwhal)",
496
"label": "Ubuntu 11.10 (Oneiric Ocelot)",
506
"label": "Generic 2.4.x kernel"
509
"label": "Generic 2.6.x kernel"
512
"sortby": "genericvirtio26",
513
"label": "Generic 2.6.25 or later kernel with virtio",
525
"clock": "localtime",
535
"label": "Microsoft Windows XP",
539
"acpi": [(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False)],
540
"apic": [(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False)],
543
"label": "Microsoft Windows XP (x86_64)",
545
"sortby": "mswin564",
549
"label": "Microsoft Windows 2000",
552
"acpi": [(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False)],
553
"apic": [(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False)],
556
"label": "Microsoft Windows Server 2003",
558
"sortby" : "mswinserv2003",
562
"label": "Microsoft Windows Server 2008",
564
"sortby": "mswinserv2008",
568
"label": "Microsoft Windows Vista",
574
"label": "Microsoft Windows 7",
585
"clock": "localtime",
586
"pv_cdrom_install": True,
590
"label": "Sun Solaris 9",
593
"label": "Sun Solaris 10",
599
"label": "Sun OpenSolaris",
613
"label": "FreeBSD 6.x" ,
614
# http://www.nabble.com/Re%3A-Qemu%3A-bridging-on-FreeBSD-7.0-STABLE-p15919603.html
616
NET : { "model" : [ (HV_ALL, "ne2k_pci") ] }
620
"label": "FreeBSD 7.x" ,
622
NET : { "model" : [ (HV_ALL, "ne2k_pci") ] }
626
"label": "FreeBSD 8.x" ,
629
NET : { "model" : [ (HV_ALL, "e1000") ] }
634
"label": "OpenBSD 4.x" ,
635
# http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/OpenbsdOnQemu
636
# https://www.redhat.com/archives/et-mgmt-tools/2008-June/msg00018.html
638
NET : { "model" : [ (HV_ALL, "pcnet") ] }
656
"label": "Novell Netware 4",
659
"label": "Novell Netware 5",
662
"label": "Novell Netware 6",
663
"pv_cdrom_install": True,
675
# Back compatibility entries
676
solaris_compat = OS_TYPES["unix"]["variants"]
678
solaris_compat["solaris9"] = OS_TYPES["solaris"]["variants"]["solaris9"].copy()
679
solaris_compat["solaris9"]["skip"] = True
681
solaris_compat["solaris10"] = OS_TYPES["solaris"]["variants"]["solaris10"].copy()
682
solaris_compat["solaris10"]["skip"] = True