guest: Don't add default ps2 or xen mouse
libvirt drivers have added these by default for a long time, so its redudnant here
This commit is contained in:
parent
f2de47cee2
commit
2cabc2e386
|
@ -53,7 +53,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
<controller type="usb" index="0" model="ich9-uhci3">
|
||||
<master startport="4"/>
|
||||
</controller>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
@ -104,7 +103,6 @@
|
|||
<controller type="usb" index="0" model="ich9-uhci3">
|
||||
<master startport="4"/>
|
||||
</controller>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
@ -122,7 +121,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="xen"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<console type="pty"/>
|
||||
</devices>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<console type="pty"/>
|
||||
</devices>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="xen"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<console type="pty"/>
|
||||
</devices>
|
||||
|
@ -43,7 +42,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="xen"/>
|
||||
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||
<console type="pty"/>
|
||||
</devices>
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<input type="mouse" bus="ps2"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -28,7 +28,7 @@ from tests import utils
|
|||
_default_conn = utils.open_testdriver()
|
||||
|
||||
|
||||
def _make_guest(installer=None, conn=None):
|
||||
def _make_guest(installer=None, conn=None, os_variant=None):
|
||||
if conn is None:
|
||||
conn = _default_conn
|
||||
|
||||
|
@ -52,6 +52,8 @@ def _make_guest(installer=None, conn=None):
|
|||
g.os.arch = "i686"
|
||||
g.os.os_type = "hvm"
|
||||
|
||||
if os_variant:
|
||||
g.os_variant = os_variant
|
||||
g.add_default_input_device()
|
||||
g.add_default_console_device()
|
||||
g.add_device(virtinst.VirtualAudio(g.conn))
|
||||
|
@ -263,9 +265,7 @@ class TestXMLMisc(unittest.TestCase):
|
|||
def testAC97(self):
|
||||
# Test setting ac97 version given various version combos
|
||||
def has_ac97(conn):
|
||||
g = _make_guest(conn=conn)
|
||||
|
||||
g.os_variant = "fedora11"
|
||||
g = _make_guest(conn=conn, os_variant="fedora11")
|
||||
|
||||
# pylint: disable=unpacking-non-sequence
|
||||
xml, ignore = g.start_install(return_xml=True, dry=True)
|
||||
|
@ -283,15 +283,13 @@ class TestXMLMisc(unittest.TestCase):
|
|||
# Use connver=12005 so that non-rhel displays ac97
|
||||
conn = utils.open_kvm_rhel(connver=12005)
|
||||
|
||||
g = _make_guest(conn=conn)
|
||||
g.os_variant = "fedora11"
|
||||
g = _make_guest(conn=conn, os_variant="fedora11")
|
||||
self._compare(g, "install-f11-norheldefaults", False)
|
||||
|
||||
try:
|
||||
CLIConfig.stable_defaults = True
|
||||
|
||||
g = _make_guest(conn=conn)
|
||||
g.os_variant = "fedora11"
|
||||
g = _make_guest(conn=conn, os_variant="fedora11")
|
||||
origemu = g.emulator
|
||||
g.emulator = "/usr/libexec/qemu-kvm"
|
||||
self.assertTrue(g.conn.stable_defaults())
|
||||
|
@ -306,8 +304,7 @@ class TestXMLMisc(unittest.TestCase):
|
|||
def test_hyperv_clock(self):
|
||||
def _make(connver):
|
||||
conn = utils.open_kvm(libver=1002002, connver=connver)
|
||||
g = _make_guest(conn=conn)
|
||||
g.os_variant = "win7"
|
||||
g = _make_guest(conn=conn, os_variant="win7")
|
||||
g.emulator = "/usr/libexec/qemu-kvm"
|
||||
return g
|
||||
|
||||
|
|
|
@ -611,6 +611,13 @@ class Guest(XMLBuilder):
|
|||
def stable_defaults(self, *args, **kwargs):
|
||||
return self.conn.stable_defaults(self.emulator, *args, **kwargs)
|
||||
|
||||
def _usb_disabled(self):
|
||||
controllers = [c for c in self.get_devices("controller") if
|
||||
c.type == "usb"]
|
||||
if not controllers:
|
||||
return False
|
||||
return all([c.model == "none" for c in controllers])
|
||||
|
||||
def add_default_input_device(self):
|
||||
if self.os.is_container():
|
||||
return
|
||||
|
@ -620,7 +627,12 @@ class Guest(XMLBuilder):
|
|||
return
|
||||
if not self.get_devices("graphics"):
|
||||
return
|
||||
self.add_device(VirtualInputDevice(self.conn))
|
||||
|
||||
if self._os_object.supports_usbtablet() and not self._usb_disabled():
|
||||
dev = VirtualInputDevice(self.conn)
|
||||
dev.type = "tablet"
|
||||
dev.bus = "usb"
|
||||
self.add_device(dev)
|
||||
|
||||
def add_default_sound_device(self):
|
||||
if not self.os.is_hvm():
|
||||
|
@ -775,7 +787,6 @@ class Guest(XMLBuilder):
|
|||
self._set_disk_defaults()
|
||||
self._add_implied_controllers()
|
||||
self._set_net_defaults()
|
||||
self._set_input_defaults()
|
||||
self._set_video_defaults()
|
||||
self._set_sound_defaults()
|
||||
|
||||
|
@ -1116,29 +1127,6 @@ class Guest(XMLBuilder):
|
|||
if not net.model:
|
||||
net.model = net_model
|
||||
|
||||
def _set_input_defaults(self):
|
||||
def _usb_disabled():
|
||||
controllers = [c for c in self.get_devices("controller") if
|
||||
c.type == "usb"]
|
||||
if not controllers:
|
||||
return False
|
||||
return all([c.model == "none" for c in controllers])
|
||||
|
||||
input_type = "mouse"
|
||||
input_bus = "ps2"
|
||||
if self.os.is_xenpv():
|
||||
input_type = VirtualInputDevice.TYPE_MOUSE
|
||||
input_bus = VirtualInputDevice.BUS_XEN
|
||||
elif self._os_object.supports_usbtablet() and not _usb_disabled():
|
||||
input_type = "tablet"
|
||||
input_bus = "usb"
|
||||
|
||||
for inp in self.get_devices("input"):
|
||||
if (inp.type == inp.TYPE_DEFAULT and
|
||||
inp.bus == inp.BUS_DEFAULT):
|
||||
inp.type = input_type
|
||||
inp.bus = input_bus
|
||||
|
||||
def _set_sound_defaults(self):
|
||||
if self.conn.check_support(
|
||||
support.SUPPORT_CONN_SOUND_ICH6):
|
||||
|
|
Loading…
Reference in New Issue