RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1092253 - Improve the error message when blockpull with a wrong base path
Summary: Improve the error message when blockpull with a wrong base path
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-29 05:32 UTC by chhu
Modified: 2015-03-05 07:34 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:34:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description chhu 2014-04-29 05:32:46 UTC
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 13:59:11 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>

Comment 4 Pei Zhang 2014-11-26 01:26:35 UTC
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 07:34:55 UTC
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.