Bug 1020219 - virsh vol-create command doesn't throw error when specified the parameters those are not required
Summary: virsh vol-create command doesn't throw error when specified the parameters th...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-17 10:13 UTC by chandrashekar shastri
Modified: 2016-04-10 15:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-10 15:03:58 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 97729 0 None None None Never

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


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