Bug 1566416

Summary: Storage device fails to validate for extra content " logical_block_size"
Product: Red Hat Enterprise Linux 7 Reporter: Jingjing Shao <jishao>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: yisun
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: dyuan, lmen, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: libvirt-4.4.0-1.el7 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:53:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jingjing Shao 2018-04-12 09:23:35 UTC
Description of problem:
Storage device fails to validate for extra content " logical_block_size"

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

How reproducible:

Steps to Reproduce:
1.# virsh nodedev-list --cap storage

2.# virsh nodedev-dumpxml block_sda_361866da06615c0001f3efbf90e133f74
  <devnode type='dev'>/dev/sda</devnode>
  <devnode type='link'>/dev/disk/by-id/scsi-361866da06615c0001f3efbf90e133f74</devnode>
  <devnode type='link'>/dev/disk/by-id/wwn-0x61866da06615c0001f3efbf90e133f74</devnode>
  <devnode type='link'>/dev/disk/by-path/pci-0000:03:00.0-scsi-0:2:0:0</devnode>
  <capability type='storage'>
    <model>PERC H730 Mini</model>

3. # virsh nodedev-dumpxml block_sda_361866da06615c0001f3efbf90e133f74  > storage.xml

4. # virt-xml-validate  storage.xml  nodedev
storage.xml:17: element logical_block_size: Relax-NG validity error : Element capability has extra content: logical_block_size
storage.xml fails to validate

Actual results:
Storage device fails to validate

Expected results:
The storage device should to be validated successfully

Additional info:

Comment 2 John Ferlan 2018-05-19 12:16:25 UTC
Posted patches for a number of grammar issues:


for this particular one, it's patch 8:


Comment 3 John Ferlan 2018-05-25 14:36:16 UTC
Patch is now pushed:

commit 4804a4db33a37f828d033733bc47f6eff5d262c3
Author: John Ferlan <jferlan@redhat.com>
Date:   Sat May 19 08:00:58 2018 -0400

    schema: Add missing block data for nodedev

    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.
    Update the nodedevxml2xmltest in order to output the values
    for storage based on the logic from udevProcessRemoveableMedia
    and udevProcessSD with respect to the logical_blocksize and
    num_blocks calculations.

$ git describe 4804a4db33a37f828d033733bc47f6eff5d262c3

Comment 5 yisun 2018-06-22 03:05:59 UTC
Verified with: libvirt-4.4.0-2.virtcov.el7.x86_64

1. Having a block device which xml contains "logical_block_size" and "num_blocks"
# virsh nodedev-list --cap storage

# virsh nodedev-dumpxml block_sda_WDC_WD2500AAJS_75M0A0_WD_WMAV24703289
  <devnode type='dev'>/dev/sda</devnode>
  <devnode type='link'>/dev/disk/by-id/ata-WDC_WD2500AAJS-75M0A0_WD-WMAV24703289</devnode>
  <devnode type='link'>/dev/disk/by-id/wwn-0x50014ee0abd7f02e</devnode>
  <devnode type='link'>/dev/disk/by-path/pci-0000:00:0e.0-ata-1.0</devnode>
  <capability type='storage'>
    <model>WDC WD2500AAJS-7</model>

2. save above xml and validate it
# virsh nodedev-dumpxml block_sda_WDC_WD2500AAJS_75M0A0_WD_WMAV24703289 > blk1.xml

# virt-xml-validate blk1.xml 
blk1.xml validates

Comment 7 errata-xmlrpc 2018-10-30 09:53:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.