Bug 1593563

Summary: xml of scsi_generic and vports device fail to validate
Product: [Community] Virtualization Tools Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, chhu, fjin, jsuchane, libvirt-maint, xuzhang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-12-17 12:26:22 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:
Embargoed:

Description yalzhang@redhat.com 2018-06-21 05:44:16 UTC
Description of problem:
xml of scsi_generic and vports device fail to validate

Version-Release number of selected component (if applicable):
libvirt-4.4.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. xml of scsi_generic device fail to validate:

# virsh nodedev-list --cap scsi_generic
scsi_generic_sg0

# virsh nodedev-dumpxml scsi_generic_sg0 > generic

# virt-xml-validate generic
generic:6: element capability: Relax-NG validity error : Element capability failed to validate content

# virsh nodedev-dumpxml scsi_generic_sg0 
<device>
  <name>scsi_generic_sg0</name>
  <path>/sys/devices/pci0000:00/0000:00:03.0/0000:09:00.0/host0/target0:2:0/0:2:0:0/scsi_generic/sg0</path>
  <devnode type='dev'>/dev/sg0</devnode>
  <parent>scsi_0_2_0_0</parent>
  <capability type='scsi_generic'>
    <char>/dev/sg0</char>
  </capability>
</device>

2. xml of HBA device failed to validate
# virsh nodedev-list --cap vports
scsi_host8
scsi_host9

# virsh nodedev-dumpxml scsi_host9 > host9
# virt-xml-validate host9
host9:7: element unique_id: Relax-NG validity error : Element capability has extra content: unique_id
host9 fails to validate

# virsh nodedev-dumpxml scsi_host9
<device>
  <name>scsi_host9</name>
  <path>/sys/devices/pci0000:00/0000:00:09.0/0000:18:00.0/host9</path>
  <parent>pci_0000_18_00_0</parent>
  <capability type='scsi_host'>
    <host>9</host>
    <unique_id>9</unique_id>
    <capability type='fc_host'>
      <wwnn>20000024ff370144</wwnn>
      <wwpn>21000024ff370144</wwpn>
      <fabric_wwn>ffffffffffffffff</fabric_wwn>
    </capability>
    <capability type='vport_ops'>
      <max_vports>254</max_vports>
      <vports>0</vports>
    </capability>
  </capability>
</device>

Actual results:
xml of scsi_generic and scsi_host(with vports) device fail to validate

Expected results:
should succeed to validate

Additional info:
fc_host without vport pass the validation
# virsh nodedev-list --cap fc_host
scsi_host10
scsi_host12
scsi_host8
scsi_host9

# virsh nodedev-list --cap vports
scsi_host8
scsi_host9

# virsh nodedev-dumpxml scsi_host12 > scsi_host
# virt-xml-validate scsi_host
scsi_host validates

# virsh nodedev-dumpxml scsi_host12
<device>
  <name>scsi_host12</name>
  <path>/sys/devices/pci0000:00/0000:00:09.0/0000:18:00.1/host8/vport-8:0-3/host12</path>
  <parent>scsi_host8</parent>
  <capability type='scsi_host'>
    <host>12</host>
    <unique_id>12</unique_id>
    <capability type='fc_host'>
      <wwnn>20000024ff370144</wwnn>
      <wwpn>2101001b32a90000</wwpn>
      <fabric_wwn>2001000dec9877c1</fabric_wwn>
    </capability>
  </capability>
</device>

Comment 2 Daniel Berrangé 2024-12-17 12:26:22 UTC
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.