Hi Socratis,
The idea is good, but your suggestion is not much less confusing than
the current state. The problem is that the USB controller type does not
map to USB specification revisions at all.
The USB 1.0 specification defined low-and full-speed devices. USB 1.1
made minor changes which are not relevant to the host controller. USB
2.0 superseded USB 1.x and added high-speed devices. USB 3.0 did not
replace USB 2.0 but rather exists parallel to it, defining SuperSpeed
devices. (The various USB 3.x revisions are not relevant here.)
The actual USB host controller capabilities are:
OHCI - low- and full-speed devices, USB 1.0/1.1/2.0
EHCI - high-speed USB 2.0 devices, though see below
xHCI - all speeds, any USB 1.x/2.0/3.0 device
EHCI can in fact support low- and full-speed devices too, but
VirtualBox does not currently do that and routes those to OHCI. And
VirtualBox includes hacks that can make some high-speed USB 2.0 devices
work with the OHCI emulation when a VM has no EHCI configured.
Is it a big mess? Yes, but that's USB.
For showvminfo, just replacing 'USB' with 'OHCI' is probably the
simplest change that's not misleading and does not need to go into
excessive detail to be accurate.
The reason why it's this way is backwards compatibility, initially
there was just one switch in VirtualBox, USB on/off, and it meant
enabling or disabling the OHCI emulation.
For that reason, changing the machine readable output is a big no-no
and pointless -- it will break existing software that parses the output,
and does not help users who are not expected to look at it. Changing the
human-readable output is OTOH perfectly fine.
I'll also look at changing the modifyvm --usb option, or rather
leaving it in place but hidden and adding modifyvm --ohci.
Regards,
Michal
On 1/5/2018 7:38 PM, Kalogrianitis Socratis wrote:
Just a small patch, which seems to make sense (at least to me). I got the idea from an
understandable misunderstanding:
https://forums.virtualbox.org/viewtopic.php?f=8&t=86126&p=410366#p410367
-------------------------------------
VBoxManage showvminfo "Debian9"
...
USB: disabled
EHCI: disabled
XHCI: enabled
...
User: I don't know why command "VBoxManage showvminfo "Debian9" " showed that
USB is disabled...
-------------------------------------
I can see that having USB labeled as "disabled" could confuse some users. The
patch modifies the output so that it's more in line with the VM settings, i.e. both
numeric USB, and the *HCI ones.
Socratis
Index: src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
===================================================================
--- src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp (revision 70243)
+++ src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp (working copy)
@@ -1988,19 +1988,19 @@
}
if (details == VMINFO_MACHINEREADABLE)
- RTPrintf("usb=\"%s\"\n", fOhciEnabled ? "on" : "off");
+ RTPrintf("ohci=\"%s\"\n", fOhciEnabled ? "on" : "off");
else
- RTPrintf("USB: %s\n", fOhciEnabled ? "enabled" :
"disabled");
+ RTPrintf("USB 1.1 (OHCI): %s\n", fOhciEnabled ? "enabled" :
"disabled");
if (details == VMINFO_MACHINEREADABLE)
RTPrintf("ehci=\"%s\"\n", fEhciEnabled ? "on" : "off");
else
- RTPrintf("EHCI: %s\n", fEhciEnabled ? "enabled" :
"disabled");
+ RTPrintf("USB 2.0 (EHCI): %s\n", fEhciEnabled ? "enabled" :
"disabled");
if (details == VMINFO_MACHINEREADABLE)
RTPrintf("xhci=\"%s\"\n", fXhciEnabled ? "on" : "off");
else
- RTPrintf("XHCI: %s\n", fXhciEnabled ? "enabled" :
"disabled");
+ RTPrintf("USB 3.0 (xHCI): %s\n", fXhciEnabled ? "enabled" :
"disabled");
}
ComPtr<IUSBDeviceFilters> USBFlts;
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev