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
Eric, any insight about this?
What insight are you looking for? Yes, this sounds like a reasonable request that someone should code up.
*** Bug 1150411 has been marked as a duplicate of this bug. ***
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