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:
Guannan Ren 2013-07-01 14:32:21 -04:00 committed by Cole Robinson
parent b6fa7d16e5
commit dbdf6c0f43
3 changed files with 16 additions and 0 deletions

View File

@ -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"

View File

@ -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)

View File

@ -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")