Bug 1092253
| Summary: | Improve the error message when blockpull with a wrong base path | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu |
| Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 | CC: | ajia, dyuan, mzhan, pkrempa, pzhang, rbalakri, shyu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.7-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-03-05 07:34:55 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
chhu
2014-04-29 05:32:46 UTC
Fixed upstream as a side-effect of:
commit f22b7899a87466d45589572a5da17b860da2d6af
Author: Jiri Denemark <jdenemar>
Date: Fri Apr 18 14:35:33 2014 +0200
Add support for addressing backing stores by index
Each backing store of a given disk is associated with a unique index
(which is also formatted in domain XML) for easier addressing of any
particular backing store. With this patch, any backing store can be
addressed by its disk target and the index. For example, "vdc[4]"
addresses the backing store with index equal to 4 of the disk identified
by "vdc" target. Such shorthand can be used in any API in place for a
backing file path:
virsh blockcommit domain vda --base vda[3] --top vda[2]
Signed-off-by: Jiri Denemark <jdenemar>
verify version:
libvirt-1.2.8-8.el7.x86_64
qemu-kvm-rhev-2.1.2-12.1.el7.x86_64
kernel-3.10.0-208.el7.x86_64
steps:
1> test about blockpull:
1.define and start a domain
# virsh list
Id Name State
----------------------------------------------------
51 r7q2 running
# virsh domblklist r7q2
Target Source
------------------------------------------------
vda /var/lib/libvirt/images/r7q2.img
2.create snapshots for domain
# for i in 1 2 3 4 ; do virsh snapshot-create-as r7q2 s$i --disk-only ; done
Domain snapshot s1 created
Domain snapshot s2 created
Domain snapshot s3 created
Domain snapshot s4 created
# virsh snapshot-list r7q2
Name Creation Time State
------------------------------------------------------------
s1 2014-11-21 09:23:33 +0800 disk-snapshot
s2 2014-11-21 09:23:33 +0800 disk-snapshot
s3 2014-11-21 09:23:34 +0800 disk-snapshot
s4 2014-11-21 09:23:34 +0800 disk-snapshot
check backing file in domain XML
# virsh dumpxml r7q2
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.s4'/>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.s3'/>
<backingStore type='file' index='2'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.s2'/>
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.s1'/>
<backingStore type='file' index='4'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.img'/>
<backingStore/>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
3.try to do blockpull with wrong base path
# virsh blockpull r7q2 vda 1024 s1
error: invalid argument: could not find image 's1' beneath '/var/lib/libvirt/images/r7q2.s4' in chain for '/var/lib/libvirt/images/r7q2.s4'
# virsh blockpull r7q2 vda 1024 --base vda[0]
error: invalid argument: could not find image 'vda[0]' beneath '/var/lib/libvirt/images/r7q2.s4' in chain for '/var/lib/libvirt/images/r7q2.s4'
4. try to do blockpull using disk target with index
# virsh blockpull r7q2 vda 1024 --base vda[3] --verbose --wait
Block Pull: [100 %]
Pull complete
# virsh dumpxml r7q2
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.s4'/>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.s1'/>
<backingStore type='file' index='2'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7q2.img'/>
<backingStore/>
</backingStore>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
2> test about blockcommit
1. define and start a domain , do snapshot for the domain
check the backing file in domain XML
# virsh dumpxml r7q2
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s4'/>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s3'/>
<backingStore type='file' index='2'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s2'/>
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s1'/>
<backingStore type='file' index='4'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.img'/>
<backingStore/>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>
2.try to do blockcommit with wrong path
# virsh blockcommit r7q2 vdb --top vdb[1] --base vda --verbose --wait
error: invalid argument: could not find image 'vda' beneath '/var/lib/libvirt/images/r7qcow2.s2' in chain for '/var/lib/libvirt/images/r7qcow2.s4'
# virsh blockcommit r7q2 vdb --top vdb[1] --base vdb[1] --verbose --wait
error: invalid argument: could not find backing store 1 in chain for '/var/lib/libvirt/images/r7qcow2.s4'
# virsh blockcommit r7q2 vdb --top vdb[3] --base vdb[1] --verbose --wait
error: invalid argument: could not find backing store 1 in chain for '/var/lib/libvirt/images/r7qcow2.s4'
3. try to do blockcommit using disk target with index and canonical path at the same time
# virsh blockcommit r7q2 vdb --top vdb[1] --base /var/lib/libvirt/images/r7qcow2.s2 --verbose --wait
Block Commit: [100 %]
Now in synchronized phase
Commit successfully ,check domain XML backing files changed.
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s4'/>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s2'/>
<backingStore type='file' index='2'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s1'/>
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.img'/>
<backingStore/>
</backingStore>
</backingStore>
</backingStore>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>
4. try to do blockcommit using disk target with index
# virsh blockcommit r7q2 vdb --top vdb[1] --base vdb[3] --verbose --wait
Block Commit: [100 %]
Now in synchronized phase
# virsh dumpxml r7q2
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.s4'/>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/r7qcow2.img'/>
<backingStore/>
</backingStore>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>
it has a clear error message and support target disk with index .
move to verified.
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/RHSA-2015-0323.html |