virtinst: Remove ParaVirt and FullVirtGuest

They were just around for back compat at this point, the tools
have moved on.
This commit is contained in:
Cole Robinson 2013-04-12 08:50:48 -04:00
parent ae471007fc
commit 9359ad2bb6
9 changed files with 19 additions and 102 deletions

View File

@ -223,7 +223,8 @@ urls = {
testconn = libvirt.open("test:///default")
testguest = virtinst.FullVirtGuest(conn=testconn, installer=virtinst.DistroInstaller())
testguest = virtinst.Guest(conn=testconn,
installer=virtinst.DistroInstaller())
class TestURLFetch(unittest.TestCase):

View File

@ -143,7 +143,7 @@ def diff_compare(actual_out, filename=None, expect_out=None):
def get_basic_paravirt_guest(installer=None):
g = virtinst.ParaVirtGuest(conn=_conn, type="xen")
g = virtinst.Guest(conn=_conn, type="xen")
g.name = "TestGuest"
g.memory = int(200)
g.maxmemory = int(400)
@ -159,9 +159,7 @@ def get_basic_paravirt_guest(installer=None):
return g
def get_basic_fullyvirt_guest(typ="xen", installer=None):
g = virtinst.FullVirtGuest(conn=_conn, type=typ,
emulator="/usr/lib/xen/bin/qemu-dm",
arch="i686")
g = virtinst.Guest(conn=_conn, type=typ)
g.name = "TestGuest"
g.memory = int(200)
g.maxmemory = int(400)
@ -172,6 +170,9 @@ def get_basic_fullyvirt_guest(typ="xen", installer=None):
g.vcpus = 5
if installer:
g.installer = installer
g.emulator = "/usr/lib/xen/bin/qemu-dm"
g.installer.arch = "i686"
g.installer.os_type = "hvm"
g.installer._scratchdir = scratch
return g

View File

@ -99,9 +99,6 @@ args = {
'invalid' : [],
'valid' : ["i386", 'i686', 'x86_64'],
},
},
'fvguest' : {
'os_type' : {
'invalid' : ['notpresent', 0, ''],
'valid' : ['other', 'windows', 'unix', 'linux']},
@ -110,6 +107,7 @@ args = {
'valid' : ['rhel5', 'sles10']},
},
'disk' : {
'init_conns' : [ testconn, None ],
'__init__' : {
@ -442,19 +440,13 @@ class TestValidation(unittest.TestCase):
# Actual Tests
def testGuestValidation(self):
PVGuest = virtinst.ParaVirtGuest(conn=testconn,
type="xen")
self._testArgs(PVGuest, virtinst.Guest, 'guest')
g = virtinst.Guest(conn=testconn, type="xen")
self._testArgs(g, virtinst.Guest, 'guest')
def testDiskValidation(self):
disk = VirtualDisk("/dev/loop0")
self._testArgs(disk, VirtualDisk, 'disk')
def testFVGuestValidation(self):
FVGuest = virtinst.FullVirtGuest(conn=testconn,
type="xen")
self._testArgs(FVGuest, virtinst.FullVirtGuest, 'fvguest')
def testNetworkValidation(self):
network = virtinst.VirtualNetworkInterface(conn=testconn)
self._testArgs(network, virtinst.VirtualNetworkInterface, 'network')

View File

@ -760,10 +760,10 @@ class vmmCreate(vmmGObjectUI):
RHEL6_OS_SUPPORT or
None)
types = virtinst.FullVirtGuest.list_os_types()
types = virtinst.Guest.list_os_types()
types.sort()
supportl = virtinst.FullVirtGuest.list_os_types(supported=True,
filtervars=filtervars)
supportl = virtinst.Guest.list_os_types(supported=True,
filtervars=filtervars)
if not filtervars:
# Kind of a hack, just show linux + windows by default since
# that's all 98% of people care about
@ -772,7 +772,7 @@ class vmmCreate(vmmGObjectUI):
self._add_os_row(model, None, _("Generic"), True)
for t in types:
label = virtinst.FullVirtGuest.get_os_type_label(t)
label = virtinst.Guest.get_os_type_label(t)
supported = (t in supportl)
self._add_os_row(model, t, label, supported)
@ -794,13 +794,13 @@ class vmmCreate(vmmGObjectUI):
RHEL6_OS_SUPPORT or
None)
preferred = self.config.preferred_distros
variants = virtinst.FullVirtGuest.list_os_variants(_type, preferred)
supportl = virtinst.FullVirtGuest.list_os_variants(
variants = virtinst.Guest.list_os_variants(_type, preferred)
supportl = virtinst.Guest.list_os_variants(
_type, preferred, supported=True,
filtervars=filtervars)
for v in variants:
label = virtinst.FullVirtGuest.get_os_variant_label(_type, v)
label = virtinst.Guest.get_os_variant_label(_type, v)
supported = v in supportl
self._add_os_row(model, v, label, supported)

View File

@ -23,7 +23,7 @@ import virtconv.formats as formats
import virtconv.vmcfg as vmcfg
import virtconv.diskcfg as diskcfg
import virtconv.netdevcfg as netdevcfg
import virtinst.FullVirtGuest as fv
import virtinst.Guest as Guest
import virtinst.ImageParser as ImageParser
from xml.sax.saxutils import escape
@ -86,7 +86,7 @@ def export_os_params(vm):
# TODO: Shouldn't be directly using _OS_TYPES here. virt-image libs (
# ImageParser?) should handle this info
ostype = fv._OS_TYPES.get(vm.os_type)
ostype = Guest._OS_TYPES.get(vm.os_type)
if ostype:
osvariant = ostype.get('variants').get(vm.os_variant)

View File

@ -1,47 +0,0 @@
#
# Fullly virtualized guest support
#
# Copyright 2006-2007 Red Hat, Inc.
# Jeremy Katz <katzj@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.Guest import Guest
class FullVirtGuest(Guest):
_default_os_type = "hvm"
def __init__(self, type=None, arch=None, connection=None,
hypervisorURI=None, emulator=None, installer=None,
caps=None, conn=None):
Guest.__init__(self, type, connection, hypervisorURI, installer,
caps=caps, conn=conn)
self.emulator = emulator
if arch:
self.arch = arch
# Back compat
def _get_loader(self):
if not self.installer:
return None
return self.installer.loader
def _set_loader(self, val):
if not self.installer:
return
self.installer.loader = val
loader = property(_get_loader, _set_loader)

View File

@ -826,9 +826,6 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
return dev
def _get_default_console_device(self):
"""
Only implemented for FullVirtGuest
"""
dev = VirtualCharDevice.get_dev_instance(self.conn,
VirtualCharDevice.DEV_CONSOLE,
VirtualCharDevice.CHAR_PTY)

View File

@ -1,25 +0,0 @@
#
# Paravirtualized guest support
#
# Copyright 2006-2007 Red Hat, Inc.
# Jeremy Katz <katzj@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
from virtinst.Guest import Guest
class ParaVirtGuest(Guest):
_default_os_type = "xen"

View File

@ -38,8 +38,6 @@ from virtinst.VirtualFilesystem import VirtualFilesystem
from virtinst.VirtualSmartCardDevice import VirtualSmartCardDevice
from virtinst.VirtualRedirDevice import VirtualRedirDevice
from virtinst.VirtualMemballoon import VirtualMemballoon
from virtinst.FullVirtGuest import FullVirtGuest
from virtinst.ParaVirtGuest import ParaVirtGuest
from virtinst.DistroInstaller import DistroInstaller
from virtinst.PXEInstaller import PXEInstaller
from virtinst.LiveCDInstaller import LiveCDInstaller