Bug 1473091 - <disk> <driver name=...> should be optional
Summary: <disk> <driver name=...> should be optional
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-20 01:55 UTC by Eric Blake
Modified: 2017-09-14 20:22 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-09-14 20:22:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Eric Blake 2017-07-20 01:55:26 UTC
Description of problem:
Upgrading from Fedora 25 to Fedora 26 (older libvirt to libvirt-3.5.0-1.fc26.x86_64) broke several of my existing domains, which no longer validated according to XML.  This regression has already been fixed upstream, but needs to be backported to the Fedora build.


Version-Release number of selected component (if applicable):
libvirt-3.5.0-1.fc26.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Update a domain's <disk> description to include a line like this:

     <disk type='file' device='disk'>
      <driver type='raw' cache='none'/>
2.
3.

Actual results:
virt-xml-validate refuses to accept it, where it used to be valid. Workaround: add name='qemu' as another attribute to <driver>

Expected results:
No regression

Additional info:
Fixed upstream by commit:
commit b494e09d058f09b48d0fd8855edd557101294671
Author: Jim Fehlig <jfehlig>
Date:   Tue Jul 18 10:20:35 2017 -0600

    docs: schema: make disk driver name attribute optional
    
    /domain/devices/disk/driver/@name is not a required or mandatory
    attribute according to formatdomain, and indeed it was agreed on
    IRC that the attribute is "optional for input, recommended (but
    not required) for output". Currently the schema requires the
    attribute, causing virt-xml-validate to fail on disk config where
    the driver name is not explicitly specified. E.g.
    
    # cat test.xml | grep -A 5 cdrom
        <disk type='file' device='cdrom'>
          <driver type='raw'/>
          <target dev='hdb' bus='ide'/>
          <readonly/>
          <address type='drive' controller='0' bus='0' target='0' unit='1'/>
        </disk>
    
    # virt-xml-validate test.xml
    Relax-NG validity error : Extra element devices in interleave
    test.xml:21: element devices: Relax-NG validity error : Element domain failed to validate content
    test.xml fails to validate
    
    Relaxing the name attribute to be optional fixes the validation
    
    # virt-xml-validate test.xml
    test.xml validates

Comment 1 Fedora Update System 2017-08-04 20:52:03 UTC
libvirt-3.2.1-5.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3c92db10b8

Comment 2 Fedora Update System 2017-08-07 06:23:22 UTC
libvirt-3.2.1-5.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3c92db10b8

Comment 3 Fedora Update System 2017-08-23 08:16:48 UTC
libvirt-2.2.1-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-226cbd995b

Comment 4 Fedora Update System 2017-08-23 19:51:28 UTC
libvirt-3.2.1-5.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2017-08-24 00:53:30 UTC
libvirt-2.2.1-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


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