Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1092253 - Improve the error message when blockpull with a wrong base path
Improve the error message when blockpull with a wrong base path
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-29 01:32 EDT by chhu
Modified: 2015-03-05 02:34 EST (History)
7 users (show)

See Also:
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 02:34:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description chhu 2014-04-29 01:32:46 EDT
Description:
Met internal error when blockpull with a wrong base path, need improve the error message.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-33.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.423.el6.x86_64

How reproducible:
100%

Steps to reproduce:
1. Create a domain, and create three snapshots.
# virsh create r6-qcow2.xml
Domain r6-qcow2 created from r6-qcow2.xml

# virsh snapshot-create-as r6-qcow2 s1 --disk-only
Domain snapshot s1 created
# virsh snapshot-create-as r6-qcow2 s2 --disk-only
Domain snapshot s2 created
# virsh snapshot-create-as r6-qcow2 s3 --disk-only
Domain snapshot s3 created

# virsh domblklist r6-qcow2
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/r6-qcow2.s3

2. do blockpull with a wrong base path
# virsh blockpull r6-qcow2 vda 8796093022207 s1
error: internal error Unexpected error

# virsh blockpull r6-qcow2 vda 8796093 s1
error: internal error Unexpected error

# virsh blockpull r6-qcow2 vda 8796093022207 r6-qcow2.s1
Block Pull started

Actual results:
In step2: met internal error Unexpected error

Expected results:
In step2: improve the error message when the base path is wrong.
Comment 1 Peter Krempa 2014-05-30 09:59:11 EDT
Fixed upstream as a side-effect of:

commit f22b7899a87466d45589572a5da17b860da2d6af
Author: Jiri Denemark <jdenemar@redhat.com>
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@redhat.com>
Comment 4 Pei Zhang 2014-11-25 20:26:35 EST
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.
Comment 6 errata-xmlrpc 2015-03-05 02:34:55 EST
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

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