mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-09 23:15:46 -06:00
add new "spice-disable-usbredir" option to disable autoredir feature
The value is stored in gsettings. By default, we use spice autoredir feature for usb redirection.
This commit is contained in:
parent
b6fa7d16e5
commit
dbdf6c0f43
@ -160,6 +160,12 @@
|
||||
<summary>Grab keyboard sequence for the graphical console</summary>
|
||||
<description>Grab keyboard sequence for the graphical console</description>
|
||||
</key>
|
||||
|
||||
<key name="auto-redirect" type="b">
|
||||
<default>true</default>
|
||||
<summary>Enable SPICE Auto USB redirection in console window</summary>
|
||||
<description>Whether to enable SPICE Auto USB redirection while connected to the guest console.</description>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.virt-manager.virt-manager.details"
|
||||
|
@ -145,6 +145,8 @@ def parse_commandline():
|
||||
help="Show domain graphical console window")
|
||||
optParser.add_option("--show-host-summary", action="callback",
|
||||
callback=opt_show_cb, help="Show connection details window")
|
||||
optParser.add_option("--spice-disable-usbredir", action="store_true",
|
||||
dest="usbredir", help="Disable USB redirection support")
|
||||
|
||||
return optParser.parse_args()
|
||||
|
||||
@ -260,6 +262,9 @@ def main():
|
||||
config.askpass_package = cliconfig.askpass_package
|
||||
config.default_graphics_from_config = cliconfig.default_graphics
|
||||
|
||||
if options.usbredir and config.get_auto_redirection():
|
||||
config.set_auto_redirection(False)
|
||||
|
||||
# Add our icon dir to icon theme
|
||||
icon_theme = Gtk.IconTheme.get_default()
|
||||
icon_theme.prepend_search_path(cliconfig.icon_dir)
|
||||
|
@ -371,6 +371,11 @@ class vmmConfig(object):
|
||||
def set_console_scaling(self, pref):
|
||||
self.conf.set("/console/scaling", pref)
|
||||
|
||||
def get_auto_redirection(self):
|
||||
return self.conf.get("/console/auto-redirect")
|
||||
def set_auto_redirection(self, state):
|
||||
self.conf.set("/console/auto-redirect", state)
|
||||
|
||||
# Show VM details toolbar
|
||||
def get_details_show_toolbar(self):
|
||||
res = self.conf.get("/details/show-toolbar")
|
||||
|
Loading…
Reference in New Issue
Block a user