Bug 1155887
Summary: | [Doc]Only expose managed attribute for PCI hostdev | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Hu Jianwei <jiahu> |
Component: | libvirt | Assignee: | Erik Skultety <eskultet> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.1 | CC: | dyuan, eskultet, honzhang, mzhan, rbalakri |
Target Milestone: | rc | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.14-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 05:54:25 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
Hu Jianwei
2014-10-23 05:59:08 UTC
Host devices (like most types of devices) are formatted into the XML description uniformly. That means, they're represented by certain internal structures which have all the relevant elements defined and all the irrelevant elements cleared and formatting behaves accordingly. Now fixing this issue would not only require tweaking conditions in formatting, but more importantly switching from simple Boolean logic to ternary logic. If the user's not 100% sure, http://libvirt.org/formatdomain.html#elementsHostDevSubsys describes the meaning of attributes and elements. Even if there's 'managed' attribute set to 'yes' when dealing with USB/SCSI devices, it will be ignored silently, no unexpected behaviour. (In reply to Erik Skultety from comment #2) > Host devices (like most types of devices) are formatted into the XML > description uniformly. That means, they're represented by certain internal > structures which have all the relevant elements defined and all the > irrelevant elements cleared and formatting behaves accordingly. Based on your above explanation, I think libvirt should remove "managed" attribute from XML layer for USB/SCSI devices during using "dumpxml" command at least, like: [root@localhost ~]# virsh dumpxml r71 ... <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x0781'/> <product id='0x5580'/> <address bus='4' device='2'/> </source> <alias name='hostdev0'/> </hostdev> ... Contrarily, dumpxml can leave it on after adding some relevant codes if it's possible. > Now fixing this issue would not only require tweaking conditions in > formatting, but more importantly switching from simple Boolean logic to > ternary logic. > If the user's not 100% sure, > http://libvirt.org/formatdomain.html#elementsHostDevSubsys describes the > meaning of attributes and elements. Even if there's 'managed' attribute set > to 'yes' when dealing with USB/SCSI devices, it will be ignored silently, no > unexpected behaviour. Consumer saw it from dumpxml's output, so people will believe it's a useful attribute, but it's useless for USB/SCSI in background, it's hard to understand. Rather than special casing hostdev device types and attributes (both of which might as well grow in count sometime in the future), I proposed an upstream patch https://www.redhat.com/archives/libvir-list/2015-February/msg01210.html to update the documentation to make the usage/appearance of 'managed' attribute more clear. Thanks, I changed it as a doc bug, reassigned it to you, please help me fix it. Fixed upstream: commit ccfe9e480986c075a6a04f7792a5b30350396d83 Author: Erik Skultety <eskultet> Date: Fri Feb 27 12:45:57 2015 +0100 docs: add a note that attr 'managed' is only used by PCI devices Our documentation isn't 100% clear about hostdev 'managed' attribute usage, because it only makes sense to use it with PCI devices, yet we format this attribute to all hostdev devices. By adding a note into the docs, we can possibly avoid confusion from customer's side and also avoid a solution using ternary logic. v1.2.13-22-gccfe9e4 Verify it as follows.The result is expected. Move its status to VERIFIED. # rpm -q libvirt libvirt-debuginfo libvirt-1.2.17-1.el7.x86_64 libvirt-debuginfo-1.2.15-2.el7.x86_64 # vim /usr/share/doc/libvirt-docs-1.2.17/html/formatdomain.html 2909 <p> 2910 Note: The <code>managed</code> attribute is only used with PCI devices 2911 and is ignored by all the other device types, thus setting 2912 <code>managed</code> explicitly with other than PCI device has the same 2913 effect as omitting it. 2914 </p> 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. https://rhn.redhat.com/errata/RHBA-2015-2202.html |