Bug 1214664 - Libvirt throws XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng after virsh edit
Summary: Libvirt throws XML document failed to validate against schema: Unable to vali...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-23 10:26 UTC by Vadim A. Misbakh-Soloviov
Modified: 2015-10-06 19:36 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-10-06 19:36:21 UTC
Embargoed:


Attachments (Terms of Use)
Domain config example (2.81 KB, text/plain)
2015-04-23 10:26 UTC, Vadim A. Misbakh-Soloviov
no flags Details

Description Vadim A. Misbakh-Soloviov 2015-04-23 10:26:47 UTC
Created attachment 1017888 [details]
Domain config example

Description of problem:
After update to the latest versions (can't say exactly version when it started, but for now it is 1.2.14) on all my servers I started to experience following situation: if I edit domain configuration (even increase or decrease RAM by 1kb) and exit editor, libvirt throws following error:
```
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content

Failed. Try again? [y,n,i,f,?]:
```

If I press "i" it says "Domain <name> XML configuration edited." and then flawlessly start that domain without any errors reported. 

Is it a bug or did I miss something during update?

Version-Release number of selected component (if applicable):
1.2.14

How reproducible:
Every time

Steps to Reproduce:
1. virsh edit <domainname> 
2. <change something>
3. save and exit

Actual results:
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content



Expected results:
Domain <domainname> XML configuration edited.

Additional info:

Config is attached

Comment 1 Daniel Berrangé 2015-04-23 10:47:28 UTC
Thanks for the example XML. The problem is the <graphics> element has a port number that is not validating against the schema:

    <graphics type='vnc' port='55910' autoport='no' passwd='[hidden]'/>
    <graphics type='spice' port='56910' autoport='no' passwd='[hidden]'/>

The RNG schema has a bug in that it uses a data type 'short' which allows range  [-32,768, 32,767] which excludes otherwise valid port numbers :-(

Comment 3 Cole Robinson 2015-10-06 19:36:21 UTC
commit 615bdfda07b7a59125c16ac780762a07d97ef4fe
Author: Daniel P. Berrange <berrange>
Date:   Thu Apr 23 11:49:23 2015 +0100

    rng: fix port number range validation
    
In v1.2.15


Note You need to log in before you can comment on or make changes to this bug.