Bug 1020219

Summary: virsh vol-create command doesn't throw error when specified the parameters those are not required
Product: [Community] Virtualization Tools Reporter: chandrashekar shastri <cshastri>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, rbalakri, shyu
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-10 15:03:58 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 chandrashekar shastri 2013-10-17 10:13:02 UTC
Description of problem:

In the below link : From the section Target Elements it is mentioned that 

http://libvirt.org/formatstorage.html

path
    Provides the location at which the volume can be accessed on the local filesystem, as an absolute path. This is a readonly attribute, so shouldn't be specified when creating a volume.

If we specify the path and other parameters it still works properly instead of throwing error.


virsh pool-dumpxml guest_images_disk
<pool type='disk'>
  <name>guest_images_disk</name>
  <uuid>69ff269b-a6b8-4cf9-9b6a-4b564bf436dc</uuid>
  <capacity unit='bytes'>16106110464</capacity>
  <allocation unit='bytes'>1073741824</allocation>
  <available unit='bytes'>13958609408</available>
  <source>
    <device path='/dev/sdd'>
    <freeExtent start='17408' end='2147501056'/>
    <freeExtent start='3221242880' end='4294984704'/>
    <freeExtent start='5368726528' end='16106110464'/>
    </device>
    <format type='gpt'/>
  </source>
  <target>
    <path>/dev</path>
    <permissions>
      <mode>0755</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>


virsh vol-create --pool guest_images_disk vol1.xml

vol1.xml
-----------------------------------------------
<volume>
  <name>vol1_in_pool</name>
  <key>/1.qcow2</key>
  <source>
  </source>
  <capacity unit='bytes'>1073741824</capacity>
  <allocation unit='bytes'>143360</allocation>
  <target>
    <path>/dev/sdd8</path>
    <permissions>
      <mode>0644</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
    <timestamps>
      <atime>1379313090.538768450</atime>
      <mtime>1379313090.538768450</mtime>
      <ctime>1379313090.538768450</ctime>
    </timestamps>
  </target>
</volume>
-------------------------------------------------

Comment 1 Cole Robinson 2016-04-10 15:03:58 UTC
Lots of XML bits work like that, for better or worse; if the parameter isn't something the XML parser reads, then it's silently ignored. I doubt we will ever fix this pattern