Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB+PCI Passthrough combined fails to call usb_reset.py #4491

Closed
jeremfg opened this issue Aug 6, 2021 · 1 comment
Closed

USB+PCI Passthrough combined fails to call usb_reset.py #4491

jeremfg opened this issue Aug 6, 2021 · 1 comment

Comments

@jeremfg
Copy link
Contributor

jeremfg commented Aug 6, 2021

This was originally reported here, and thus observed on XCP-ng.


Environment:
Hardware platform: SuperMicro X10SDV-TLN4F
XCP-ng version: 8.2

I am trying to pass a USB device AND a PCI peripheral to the same VM. Once assignations are properly made and I try to start the VM, the boot fails and XCP-ng Center shows the following error:

"Failed","Starting VM 'Cosmos'
Internal error: xenopsd internal error: Call to usb reset failed: Forkhelpers.Spawn_internal_error("usage: usb_reset.py attach [-h] -d DOMID -p PID [-r RESET_ONLY] device\nusb_reset.py attach: error: argument -r: expected one argument\n", "", _)
Time: 00:00:03","sol","Aug 1, 2021 9:30 PM"

It doesn't seem to matter which USB peripheral(s) I try to pass, but as long as there is one while my GPU is also attached, it fails.
If I remove the GPU and only pass USB devices, the VM boots successfully and the guest is able to use the USB peripheral.

Passthrough for PCI works, Passthrough for USB works. But doing both at the same time fails, preventing the VM from booting.

Based on the error message, it appears that an argument is missing when calling usb_reset.py under the specific condition that a PCI device is also attached. But I have no idea where this gets called.

P.S. The issue is also mentioned here, albeit for XCP-ng 8.1 in that case.

@edwintorok
Copy link
Contributor

Take a look at this commit: xapi-project/xenopsd@4fb4f3b
It will call usb_reset.py with -r (when other PCI devices are passed-through), but usb_reset.py expects an integer argument for -r so that won't work.
This can be fixed either by changing xenopsd to submit an integer along with -r, or changing usb_reset.py to accept -r as a flag and not require an integer, I'd prefer the latter.

See the documentation for argparse: https://docs.python.org/2.7/library/argparse.html, and modify usb_reset.py on your system to accept a flag instead of integer, I think a store_true action instead of type=int should work.

If that works then can you submit a pull request to fix scripts/usb_reset.py in this repo?

jeremfg pushed a commit to jeremfg/xen-api that referenced this issue Aug 6, 2021
…h PCI device attached) is not working due to bad argument '-r'
jeremfg pushed a commit to jeremfg/xen-api that referenced this issue Aug 6, 2021
…h PCI device attached) is not working due to bad argument '-r'

Signed-off-by: Jérémie Faucher-Goulet <JFaucherGoulet@orthogone.com>
jeremfg added a commit to jeremfg/xen-api that referenced this issue Aug 6, 2021
…h PCI device attached) is not working due to bad argument '-r'

Signed-off-by: Jérémie Faucher-Goulet <jeremiefauchergoulet@hotmail.com>
psafont added a commit that referenced this issue Aug 9, 2021
Fix issue #4491: USB device reset for Privileged VMs
@psafont psafont closed this as completed Aug 9, 2021
robhoes pushed a commit to robhoes/xen-api that referenced this issue Jan 28, 2022
…h PCI device attached) is not working due to bad argument '-r'

Signed-off-by: Jérémie Faucher-Goulet <jeremiefauchergoulet@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants