mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
guest: If graphics enabled, add usb tablet/keyboard for machvirt
This commit is contained in:
parent
2cabc2e386
commit
a07a874497
@ -14,6 +14,8 @@
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<input type="tablet" bus="usb"/>
|
||||
<input type="keyboard" bus="usb"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
@ -621,18 +621,31 @@ class Guest(XMLBuilder):
|
||||
def add_default_input_device(self):
|
||||
if self.os.is_container():
|
||||
return
|
||||
if not self.os.is_x86():
|
||||
return
|
||||
if self.get_devices("input"):
|
||||
return
|
||||
if not self.get_devices("graphics"):
|
||||
return
|
||||
if self._usb_disabled():
|
||||
return
|
||||
|
||||
if self._os_object.supports_usbtablet() and not self._usb_disabled():
|
||||
usb_tablet = False
|
||||
usb_keyboard = False
|
||||
if self.os.is_x86():
|
||||
usb_tablet = self._os_object.supports_usbtablet()
|
||||
if self.os.is_arm_machvirt():
|
||||
usb_tablet = True
|
||||
usb_keyboard = True
|
||||
|
||||
if usb_tablet:
|
||||
dev = VirtualInputDevice(self.conn)
|
||||
dev.type = "tablet"
|
||||
dev.bus = "usb"
|
||||
self.add_device(dev)
|
||||
if usb_keyboard:
|
||||
dev = VirtualInputDevice(self.conn)
|
||||
dev.type = "keyboard"
|
||||
dev.bus = "usb"
|
||||
self.add_device(dev)
|
||||
|
||||
def add_default_sound_device(self):
|
||||
if not self.os.is_hvm():
|
||||
|
Loading…
Reference in New Issue
Block a user