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, vm boot fails #511

Closed
jeremfg opened this issue Aug 2, 2021 · 5 comments
Closed

USB+PCI Passthrough combined, vm boot fails #511

jeremfg opened this issue Aug 2, 2021 · 5 comments

Comments

@jeremfg
Copy link

jeremfg commented Aug 2, 2021

Following up on #108 and here

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.

My use case? Trying to setup a HTPC virtual machine, passing through a physical GPU connected to a nearby TV, and a USB IR receiver for the TV remote.

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

@stormi
Copy link
Member

stormi commented Aug 2, 2021

Thanks for this report. To me, this looks like an issue in XAPI when it computes the arguments to pass to the usb_reset.py tool.

Could you report your issue upstream, to the XAPI project?

Here's the link: https://github.com/xapi-project/xen-api/issues

@stormi
Copy link
Member

stormi commented Aug 9, 2021

Fix contributed upstream by @jeremfg: xapi-project/xen-api#4492

Well done!

@stormi
Copy link
Member

stormi commented Aug 9, 2021

I looked at the fix and it does not look like it could bring more issues than it fixes, so I'm considering backporting it to the next XAPI bugfix update in XCP-ng 8.2.

stormi added a commit to xcp-ng-rpms/xapi that referenced this issue Aug 9, 2021
- Add xapi-1.249.9-fix-usb-device-reset.backport.patch
- Related to xcp-ng/xcp#511
@stormi
Copy link
Member

stormi commented Aug 9, 2021

Updated packages addressing this issue are available for testing on XCP-ng 8.2: https://xcp-ng.org/forum/post/41480

@stormi
Copy link
Member

stormi commented Dec 8, 2021

The update with the fix is now released to every XCP-ng 8.2 user: https://xcp-ng.org/blog/2021/12/08/december-2021-xcp-ng-updates/

Thanks @jeremfg for your contribution!

@stormi stormi closed this as completed Dec 8, 2021
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

2 participants