[virt-tools-list] [PATCH 3/3] details: Add auto USB redirection support in console viewer

Guan Nan Ren gren at redhat.com
Fri Jun 28 22:51:50 UTC 2013



----- Original Message -----
From: "Leonardo Augusto Guimarães Garcia" <lagarcia at linux.vnet.ibm.com>
To: "Guannan Ren" <gren at redhat.com>
Cc: virt-tools-list at redhat.com
Sent: Friday, June 28, 2013 5:32:20 PM
Subject: Re: [virt-tools-list] [PATCH 3/3] details: Add auto USB redirection support in console viewer

Patch looks good. USB redirection worked for me (almost) as expected 
when using latest spice-gtk from git.

What I mean by almost is that when I plugged my USB storage device into 
the USB Port, I got an error dialog saying:

Could not open usb device: Access denied (insufficient permissions) [-3]

And if I expand the details on the dialog, I have:

USB redirection error

None

However, the USB storage device was correctly auto-connected to the guest!

Not sure if this error message is due to my test environment (I might 
have forgotten to properly install/configure something as I have never 
built spice-gtk before). IOW, overall the patch looks good for me. One 
minor nit below.

Leonardo

I ran into this permission issue before. Hans gave the answer.
the polkit-devel package is needed for compiling a helper program.
spice-client-glib-usb-acl-helper which can fix my issue.

https://www.redhat.com/archives/virt-tools-list/2013-June/msg00127.html

The error dialog is expected in this case, but the auto-connected is not quite right.
I often open virt-manager debug, you can try it, see if anything is userful.
"python virt-manager --debug"

My local testing is the error dialog popup and block the auto-connection.


On 06/29/2013 02:08 AM, Guannan Ren wrote:
> Add "Redirect USB device" option in console viewer. Initialize and
> embed UsbDeviceWidget object from SpiceClientGtk into a dialog to
> let user choose available USB devices for redirection.
> Throw an error message if USB connection failed.
> Auto-redirection is enable by default.
>
> There is race between creating usbredir channel and calling
> has_usb_redirection() when initializing spice session like
> happening on virt-viwer. So adding a new signal handler
> on_details_menu_virtual_manager_activate() to recheck the
> status of usbredir channel, set "Redirect USB device" option
> sensitive if it is availiable.

<snip>

>       def init_menus(self):
> -        # Shutdown button menu
> +        # Virtual Machine menu
> +        self.widget("details-menu-usb-redirection").set_tooltip_text(
> +            _("Redirect USB device attached on host to virtual machine with SPICE graphics. USB Redirection device is required for Virtual Machine to support this functionality. Auto-redirection is enabled by default"))
Can't we set the tooltip in the UI XML file and avoid this extremely 
long line in the code? I think it should be easy to do that with glade.

Yeah, when I try to add it into ui/vmm-details.ui, I found, there is no one <tooltip_text> which is so long like this.
In details.py there are some of them with same length such as "Security info tooltips". So I just keep it in there.
We need Cole's advise here.

Guannan




More information about the virt-tools-list mailing list