
On 1/26/19 9:16 AM, John Ferlan wrote:
On 1/21/19 3:57 AM, Nikolay Shirokovskiy wrote:
Device attribute does not have dotted "portAddr" format. Instead it has single number format described but "usbAddr" which corresponds to device parsing code in virDomainHostdevSubsysUSBDefParseXML.
Looks like [1] mistakenly changed device format for hostdev devices. And [2] copy-n-paste this for hostdev network interfaces.
[1] 31710a53 Modify USB port to be defined as a port path [2] 3b1c191f conf: parse/format type='hostdev' network interfaces
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> --- docs/schemas/domaincommon.rng | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
This a really strange/involved one, but seemingly correct. It also seems that an <interface type='hostdev'... <source ... where the source is USB couldn't or doesn't use the startupPolicy that would be present in a normal <hostdev mode='subsystem' type='usb'...>...
The parser and formatter will parse and format an <interface type='hostdev'> where the source device is USB, but that isn't supported by any hypervisor (it would require a standard method of setting the MAC address of the USB netdev before giving it to the guest, and AFAIK that doesn't exist). In the original commit I mention that it's allowed by the parser only for completeness' sake.
Anyway, I'm certainly not the expert there - something Laine would perhaps be better suited for, but certainly missing from the interface RNG, but is processed in virDomainHostdevDefParseXMLSubsys. It also seems to be a hostdevsubsyspci property as well.
What I was looking for was a way for the <interface...> RNG to perhaps make use of the hostdevsubsyspci and hostdevsubsysusb, but some of what goes on in RNG rules is like black magic voodoo ;-)...
In the hypothetical/mythical future where such a thing exists and support is added, the RNG would presumably be changed. For now it doesn't exist, so the RNG is fine as-is.