Bug 1104862 - [RFE] Volume creation as external snapshot shouldn't require capacity
Summary: [RFE] Volume creation as external snapshot shouldn't require capacity
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1150411 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-04 20:43 UTC by Federico Simoncelli
Modified: 2015-03-02 07:48 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-03-02 07:48:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 958510 0 unspecified CLOSED virStorageVolCreateXML requires <capacity> even when <backingStore> is specified 2021-02-22 00:41:40 UTC

Internal Links: 958510

Description Federico Simoncelli 2014-06-04 20:43:53 UTC
Description of problem:
The capacity element should be optional when creating a volume with a backing file (by default it should be the same of the base):

# virsh vol-create default /dev/stdin <<EOF
<volume>
  <name>test-base.qcow2</name>
  <capacity unit='bytes'>21474836480</capacity>
  <target>
    <format type='qcow2'/>
  </target>
</volume>
EOF

# virsh vol-create default /dev/stdin <<EOF
<volume>
  <name>test-snapshot1.qcow2</name>
  <target>
    <format type='qcow2'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_content_t:s0</label>
    </permissions>
  </target>
  <backingStore>
    <path>test-base.qcow2</path>
    <format type='qcow2'/>
  </backingStore>
</volume>
EOF

error: Failed to create vol from /dev/stdin
error: XML error: missing capacity element

Comment 1 Federico Simoncelli 2014-09-22 09:36:10 UTC
Eric, any insight about this?

Comment 2 Eric Blake 2014-09-22 15:51:03 UTC
What insight are you looking for? Yes, this sounds like a reasonable request that someone should code up.

Comment 3 Shanzhi Yu 2014-10-08 09:21:46 UTC
*** Bug 1150411 has been marked as a duplicate of this bug. ***

Comment 4 Ján Tomko 2015-03-02 07:48:49 UTC
Fixed upstream as of
commit 155ca616eb231181f6978efc9e3a1eb0eb60af8a
Author:     Ján Tomko <jtomko>
CommitDate: 2015-03-02 08:07:11 +0100

    Allow creating volumes with a backing store but no capacity
    
    The tool creating the image can get the capacity from the backing
    storage. Just refresh the volume afterwards.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=958510

git describe: v1.2.13-17-g155ca61


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