[libvirt] [PATCH] dosc: schema: fix usb source address device attribute format

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(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index aa50eac..8c8d87e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2765,7 +2765,7 @@ <ref name="usbAddr"/> </attribute> <attribute name="device"> - <ref name="usbPort"/> + <ref name="usbAddr"/> </attribute> </group> </choice> @@ -4709,7 +4709,7 @@ <ref name="usbAddr"/> </attribute> <attribute name="device"> - <ref name="usbPort"/> + <ref name="usbAddr"/> </attribute> </element> </define> -- 1.8.3.1

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'...>... 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 ;-)... Anwyay, long way of saying, Reviewed-by: John Ferlan <jferlan@redhat.com> John

On 26.01.2019 17:16, 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'...>...
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 ;-)...
Anwyay, long way of saying,
Reviewed-by: John Ferlan <jferlan@redhat.com>
Thanx! Pushed. Nikolay

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.
participants (3)
-
John Ferlan
-
Laine Stump
-
Nikolay Shirokovskiy