[libvirt] [PATCH 0/8] Fix some issues with rng grammar for output XML's

The storagevol, capability, and nodedev output grammar files had some issues. Details noted in each patch. John Ferlan (8): schema: Add physical sizing grammer for storagevol grammar schema: Remove xenmigr from host migrate transport capability schema,tests: Use vpxmigr for host migrate transport capability schema: Add rdma for host migrate transport capability schema: Add vzmigr for host migrate transport capability schema: Add microcode to capability grammar schema: Fix capability grammar for pagesElem schema: Add missing block data for nodedev docs/schemas/capability.rng | 42 +++++++++++++++++++++++++++++------------- docs/schemas/nodedev.rng | 13 +++++++++++++ docs/schemas/storagevol.rng | 5 +++++ tests/vmx2xmltest.c | 2 +- 4 files changed, 48 insertions(+), 14 deletions(-) -- 2.14.3

https://bugzilla.redhat.com/show_bug.cgi?id=1572491 Commit id '78661cb' added a physical output, but failed to update the schema resulting in a failure from virt-xml-validate. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/storagevol.rng | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng index 7450547ffa..96d6b3e6d0 100644 --- a/docs/schemas/storagevol.rng +++ b/docs/schemas/storagevol.rng @@ -56,6 +56,11 @@ <ref name='scaledInteger'/> </element> </optional> + <optional> + <element name='physical'> + <ref name='scaledInteger'/> + </element> + </optional> </interleave> </define> -- 2.14.3

Commit id '1dac5fbb' removed xenmigr as a capability option for virCapabilitiesAddHostMigrateTransport but didn't update the schema resulting in possible failure for virt-xml-validate. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/capability.rng | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index e1ab5c2240..e11dd51150 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -162,7 +162,6 @@ <choice> <value>esx</value> <value>tcp</value> - <value>xenmigr</value> </choice> </element> </oneOrMore> -- 2.14.3

Commit id 'e4938ce2f' changed the esx_driver to use 'vpxmigr' instead of esx for virCapabilitiesAddHostMigrateTransport, so update the capabilities to allow virt-xml-validate to pass and update the test to use the newer name. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/capability.rng | 2 +- tests/vmx2xmltest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index e11dd51150..b8e1a0e930 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -160,7 +160,7 @@ <oneOrMore> <element name='uri_transport'> <choice> - <value>esx</value> + <value>vpxmigr</value> <value>tcp</value> </choice> </element> diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index 60913b6b11..7289dc91e3 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -30,7 +30,7 @@ testCapsInit(void) if (caps == NULL) return; - virCapabilitiesAddHostMigrateTransport(caps, "esx"); + virCapabilitiesAddHostMigrateTransport(caps, "vpxmigr"); /* i686 guest */ guest = -- 2.14.3

https://bugzilla.redhat.com/show_bug.cgi?id=1572491 Commit id 'b3fd95e36' added rdma as a valid option for virCapabilitiesAddHostMigrateTransport, but didn't update the capabilities schema resulting in possible virt-xml-validate failure. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/capability.rng | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index b8e1a0e930..aa4823f869 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -162,6 +162,7 @@ <choice> <value>vpxmigr</value> <value>tcp</value> + <value>rdma</value> </choice> </element> </oneOrMore> -- 2.14.3

Commit id '0eced74f3' added vzmigr as a valid option for virCapabilitiesAddHostMigrateTransport, but didn't update the capabilities schema resulting in possible virt-xml-validate failure. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/capability.rng | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index aa4823f869..c532f5dcc7 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -163,6 +163,7 @@ <value>vpxmigr</value> <value>tcp</value> <value>rdma</value> + <value>vzmigr</value> </choice> </element> </oneOrMore> -- 2.14.3

https://bugzilla.redhat.com/show_bug.cgi?id=1572491 Commit id 'd2440f3b5' added printing the <microcode> for the capabilities, but didn't update the capabilities schema. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/capability.rng | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index c532f5dcc7..e1b7858540 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -102,6 +102,13 @@ <text/> </element> </optional> + <optional> + <element name='microcode'> + <attribute name='version'> + <ref name='positiveInteger'/> + </attribute> + </element> + </optional> <element name='topology'> <attribute name='sockets'> <ref name='positiveInteger'/> -- 2.14.3

https://bugzilla.redhat.com/show_bug.cgi?id=1572491 Commit id '02129b7c0' added a single pagesElem for slightly different purposes. One usage was an output for host page size listing and the other for NUMA supported page sizes. For the former, only the pages unit and size are formatted, while for the latter the pages unit, size, and availability data is formatted. The virt-xml-validate would fail because it expected something extra in the host page size output. So split up pagesElem a bit and create pagesHost and pagesNuma for the differences. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/capability.rng | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index e1b7858540..66c5de62e5 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -129,7 +129,7 @@ </element> </zeroOrMore> <zeroOrMore> - <ref name='pagesElem'/> + <ref name='pagesHost'/> </zeroOrMore> </define> @@ -203,7 +203,7 @@ </optional> <zeroOrMore> - <ref name='pagesElem'/> + <ref name='pagesNuma'/> </zeroOrMore> <optional> @@ -484,17 +484,25 @@ </data> </define> - <define name='pagesElem'> + <define name='pagesHost'> <element name='pages'> - <optional> - <attribute name='unit'> - <ref name='unit'/> - </attribute> - </optional> - <attribute name='size'> - <ref name='unsignedInt'/> - </attribute> + <ref name='pagesElem'/> + </element> + </define> + <define name='pagesNuma'> + <element name='pages'> + <ref name='pagesElem'/> <ref name='unsignedInt'/> </element> </define> + <define name='pagesElem'> + <optional> + <attribute name='unit'> + <ref name='unit'/> + </attribute> + </optional> + <attribute name='size'> + <ref name='unsignedInt'/> + </attribute> + </define> </grammar> -- 2.14.3

https://bugzilla.redhat.com/show_bug.cgi?id=1566416 Commit id 'fe2af45b' added output for logical_block_size and num_blocks for both removeable and fixed storage, but did not update the nodedev capability causing virt-xml-validate to fail. It's listed as optional only because it only prints if the sizes are > 0. For a CDROM drive the values won't be formatted. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/schemas/nodedev.rng | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng index 6b063cc225..0498489cfd 100644 --- a/docs/schemas/nodedev.rng +++ b/docs/schemas/nodedev.rng @@ -578,6 +578,7 @@ <text/> </element> </optional> + <ref name='blockData'/> </element> </define> @@ -585,6 +586,18 @@ <element name='size'> <ref name='unsignedLong'/> </element> + <ref name='blockData'/> + </define> + + <define name='blockData'> + <optional> + <element name='logical_block_size'> + <ref name='unsignedLong'/> + </element> + <element name='num_blocks'> + <ref name='unsignedLong'/> + </element> + </optional> </define> <define name='capdrm'> -- 2.14.3

On Sat, May 19, 2018 at 08:14:30AM -0400, John Ferlan wrote:
The storagevol, capability, and nodedev output grammar files had some issues. Details noted in each patch.
John Ferlan (8): schema: Add physical sizing grammer for storagevol grammar schema: Remove xenmigr from host migrate transport capability schema,tests: Use vpxmigr for host migrate transport capability schema: Add rdma for host migrate transport capability schema: Add vzmigr for host migrate transport capability schema: Add microcode to capability grammar schema: Fix capability grammar for pagesElem schema: Add missing block data for nodedev
docs/schemas/capability.rng | 42 +++++++++++++++++++++++++++++------------- docs/schemas/nodedev.rng | 13 +++++++++++++ docs/schemas/storagevol.rng | 5 +++++ tests/vmx2xmltest.c | 2 +- 4 files changed, 48 insertions(+), 14 deletions(-)
We run the virt-xml-validate test against all sample XML files present in the test suite. So each one of these RNG bugs indicates that there is an missing example XML document that we should also add. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Daniel P. Berrangé
-
John Ferlan