Bug 844073

Summary: RFE: please add support for qemu -device usb-redir,debug=# option
Product: Red Hat Enterprise Linux 6 Reporter: Hans de Goede <hdegoede>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, berrange, dallan, dyasny, dyuan, juzhang, mzhan, rwu, ydu, zpeng
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-30 18:09:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hans de Goede 2012-07-28 15:39:12 UTC
Please add support for qemu -device usb-redir,debug=# option, usb-redir devices have a debug= option which is quite useful to help debugging problems with usb-redirection, currently users reporting usb redirection problems need to start qemu manually to be able to gather debug logs.

To be clear about what is needed, currently libvirt generates the following qemu cmdline "snippets" for usb-redir devices:

 -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=3

This bug is about changing this to for example:

 -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=3,debug=3

The default value for the debug parameter should be 0.

Comment 1 Daniel Berrangé 2012-07-30 07:52:54 UTC
I'm not convinced this kind of thing should be exposed in the libvirt XML. It should already be possible to toggle this when troubleshooting without having to start QEMU manually, by using the QEMU ARGV passthrough option and the '-set' argument to override the device property

Comment 2 Hans de Goede 2012-07-30 10:10:35 UTC
(In reply to comment #1)
> I'm not convinced this kind of thing should be exposed in the libvirt XML.
> It should already be possible to toggle this when troubleshooting without
> having to start QEMU manually, by using the QEMU ARGV passthrough option and
> the '-set' argument to override the device property

If this is indeed already possible then I agree that adding it to the libvirt XML is not necessarily a good idea,
can you give an example of how the QEMU ARGV passthrough option and the '-set' argument can be used to already do this? And/or provide a pointer to some documentation in this?

Comment 3 Daniel Berrangé 2012-07-30 10:19:44 UTC
If you do 'virsh dumpxml $GUEST', and identify the <alias name=XXX>, associated with the usb-redir device, you can then use that in -set device.XXXX.debug=4. So assuming the id was 'usbredir0' this could be set in libvirt XML thus:

<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  ...
  <devices>
    ...
  </devices>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.usbredir0.debug=4'/>
  </qemu:commandline>
</domain>

Comment 4 Hans de Goede 2012-07-30 10:46:46 UTC
Ok, that works to enable the debugging, note to self the actual device aliases are redir0, redir1, etc.

So with this method of setting the debug parameter being present I'm fine with closing this as notabug.

Comment 5 Dave Allan 2012-07-30 18:09:34 UTC
(In reply to comment #4)
> So with this method of setting the debug parameter being present I'm fine
> with closing this as notabug.

Ok, done.