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 _virtinst 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,
76
# "devname" : { "attribute" : [( ["applicable", "hv-type", list"],
77
# "recommended value for hv-types" ),]},
101
(support.SUPPORT_CONN_HV_SOUND_AC97, "ac97"),
114
def sort_helper(tosort):
115
"""Helps properly sorting os dictionary entires"""
120
for key in tosort.keys():
121
if tosort[key].get("skip"):
124
sortby = tosort[key].get("sortby")
127
key_mappings[sortby] = key
132
retlist.append(key_mappings[key])
136
def parse_key_entry(conn, hv_type, key_entry, defaults):
139
if type(key_entry) == list:
141
# List of tuples with (support -> value) mappings
142
for tup in key_entry:
147
# HV_ALL means don't check for support, just return the value
148
if support_key != HV_ALL:
149
support_ret = support.check_conn_hv_support(conn,
153
if support_ret != True:
163
if not found and defaults:
164
ret = parse_key_entry(conn, hv_type, defaults, None)
168
def lookup_osdict_key(conn, hv_type, os_type, var, key):
170
defaults = DEFAULTS[key]
173
if var and OS_TYPES[os_type]["variants"][var].has_key(key):
174
dictval = OS_TYPES[os_type]["variants"][var][key]
175
elif OS_TYPES[os_type].has_key(key):
176
dictval = OS_TYPES[os_type][key]
178
return parse_key_entry(conn, hv_type, dictval, defaults)
181
def lookup_device_param(conn, hv_type, os_type, var, device_key, param):
183
os_devs = lookup_osdict_key(conn, hv_type, os_type, var, "devices")
184
defaults = DEFAULTS["devices"]
186
for devs in [os_devs, defaults]:
187
if not devs.has_key(device_key):
190
return parse_key_entry(conn, hv_type, devs[device_key][param],
193
raise RuntimeError(_("Invalid dictionary entry for device '%s %s'" %
194
(device_key, param)))
197
# NOTE: keep variant keys using only lowercase so we can do case
198
# insensitive checks on user passed input
203
"rhel2.1": { "label": "Red Hat Enterprise Linux 2.1",
205
"rhel3": { "label": "Red Hat Enterprise Linux 3",
207
"rhel4": { "label": "Red Hat Enterprise Linux 4",
209
"rhel5": { "label": "Red Hat Enterprise Linux 5",
211
"rhel5.4": { "label": "Red Hat Enterprise Linux 5.4 or later",
217
"rhel6": { "label": "Red Hat Enterprise Linux 6", "distro": "rhel",
223
"fedora5": { "sortby": "fedora05",
224
"label": "Fedora Core 5", "distro": "fedora" },
225
"fedora6": { "sortby": "fedora06",
226
"label": "Fedora Core 6", "distro": "fedora" },
227
"fedora7": { "sortby": "fedora07",
228
"label": "Fedora 7", "distro": "fedora" },
229
"fedora8": { "sortby": "fedora08",
230
"label": "Fedora 8", "distro": "fedora" },
231
"fedora9": { "sortby": "fedora09",
232
"label": "Fedora 9", "distro": "fedora",
234
# Apparently F9 has selinux errors when installing
236
# https://bugzilla.redhat.com/show_bug.cgi?id=470386
240
"fedora10": { "label": "Fedora 10", "distro": "fedora",
245
"fedora11": { "label": "Fedora 11", "distro": "fedora",
251
"fedora12": { "label": "Fedora 12", "distro": "fedora",
257
"fedora13": { "label": "Fedora 13", "distro": "fedora",
264
"sles10": { "label": "Suse Linux Enterprise Server",
266
"sles11": { "label": "Suse Linux Enterprise Server 11",
274
"mandriva2009": { "label": "Mandriva Linux 2009 and earlier",
275
"distro": "mandriva" },
276
"mandriva2010": { "label": "Mandriva Linux 2010 and later",
277
"distro": "mandriva",
284
"mes5": { "label": "Mandriva Enterprise Server 5.0",
285
"distro": "mandriva" },
286
"mes5.1": { "label": "Mandriva Enterprise Server 5.1 and later",
287
"distro": "mandriva",
293
"debianetch": { "label": "Debian Etch", "distro": "debian" },
294
"debianlenny": { "label": "Debian Lenny", "distro": "debian",
299
"debiansqueeze": { "label": "Debian Squeeze", "distro": "debian",
305
"ubuntuhardy": { "label": "Ubuntu 8.04 LTS (Hardy Heron)",
310
"ubuntuintrepid": { "label": "Ubuntu 8.10 (Intrepid Ibex)",
315
"ubuntujaunty": { "label": "Ubuntu 9.04 (Jaunty Jackalope)",
321
"ubuntukarmic": { "label": "Ubuntu 9.10 (Karmic Koala)",
327
"generic24": { "label": "Generic 2.4.x kernel" },
328
"generic26": { "label": "Generic 2.6.x kernel" },
329
"virtio26": { "sortby": "genericvirtio26",
330
"label": "Generic 2.6.25 or later kernel with virtio",
341
"clock": "localtime",
348
"winxp":{ "label": "Microsoft Windows XP (x86)",
350
(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False),
353
(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False),
356
"winxp64":{ "label": "Microsoft Windows XP (x86_64)" },
357
"win2k": { "label": "Microsoft Windows 2000",
359
(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False),
362
(support.SUPPORT_CONN_HV_SKIP_DEFAULT_ACPI, False),
365
"win2k3": { "label": "Microsoft Windows 2003" },
366
"win2k8": { "label": "Microsoft Windows 2008" },
367
"vista": { "label": "Microsoft Windows Vista" },
368
"win7": { "label": "Microsoft Windows 7" }
374
"clock": "localtime",
375
"pv_cdrom_install": True,
377
"solaris9": { "label": "Sun Solaris 9", },
378
"solaris10": { "label": "Sun Solaris 10",
383
"opensolaris": { "label": "Sun OpenSolaris",
394
"freebsd6": { "label": "Free BSD 6.x" ,
395
# http://www.nabble.com/Re%3A-Qemu%3A-bridging-on-FreeBSD-7.0-STABLE-p15919603.html
397
NET : { "model" : [ (HV_ALL, "ne2k_pci") ] }
399
"freebsd7": { "label": "Free BSD 7.x" ,
401
NET : { "model" : [ (HV_ALL, "ne2k_pci") ] }
403
"openbsd4": { "label": "Open BSD 4.x" ,
404
# http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/OpenbsdOnQemu
405
# https://www.redhat.com/archives/et-mgmt-tools/2008-June/msg00018.html
407
NET : { "model" : [ (HV_ALL, "pcnet") ] }
415
"msdos": { "label": "MS-DOS", "acpi": False, "apic": False },
416
"netware4": { "label": "Novell Netware 4" },
417
"netware5": { "label": "Novell Netware 5" },
418
"netware6": { "label": "Novell Netware 6", "pv_cdrom_install": True, },
419
"generic": { "label": "Generic" },
423
# Back compatibility entries
424
solaris_compat = OS_TYPES["unix"]["variants"]
426
solaris_compat["solaris9"] = OS_TYPES["solaris"]["variants"]["solaris9"].copy()
427
solaris_compat["solaris9"]["skip"] = True
429
solaris_compat["solaris10"] = OS_TYPES["solaris"]["variants"]["solaris10"].copy()
430
solaris_compat["solaris10"]["skip"] = True