virt-install: support --input none

Disables adding any default input devices

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2024-11-14 10:22:42 -05:00 committed by Pavel Hrdina
parent c78ec96933
commit 2835c250c7
4 changed files with 11 additions and 1 deletions

View File

@ -52,7 +52,6 @@
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<input type="tablet" bus="usb"/>
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
<image compression="off"/>
</graphics>

View File

@ -868,6 +868,7 @@ c.add_compare(
--smartcard none
--tpm none
--rng none
--input none
""", "singleton-config-1")

View File

@ -4169,6 +4169,13 @@ class ParserInput(VirtCLIParser):
cli_arg_name = "input"
guest_propname = "devices.input"
remove_first = "type"
stub_none = False
def _parse(self, inst):
if self.optstr == "none":
self.guest.skip_default_input = True
return
return super()._parse(inst)
@classmethod
def _virtcli_class_init(cls):

View File

@ -211,6 +211,7 @@ class Guest(XMLBuilder):
self.skip_default_graphics = False
self.skip_default_rng = False
self.skip_default_tpm = False
self.skip_default_input = False
self.have_default_tpm = False
self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
@ -1064,6 +1065,8 @@ class Guest(XMLBuilder):
return all([c.model == "none" for c in controllers])
def _add_default_input_device(self):
if self.skip_default_input:
return
if self.os.is_container():
return
if self.devices.input: