Bug 1142703

Summary: Improve the error report when there is already a blockpull job
Product: Red Hat Enterprise Linux 7 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dyuan, mzhan, rbalakri, yanyang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.14-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 05:47:20 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 Shanzhi Yu 2014-09-17 08:54:46 UTC
Description of problem:

Improve the error report when there is already a blockpull job

Version-Release number of selected component (if applicable):

libvirt-1.2.8-2.el7.x86_64

How reproducible:

100%

Steps to Reproduce:

1. Prepare a running guest
#virsh list
# virsh list
 Id    Name                           State
----------------------------------------------------
 12    rhel6.5                        running

2. Create external disk snapshot
# virsh snapshot-create-as rhel6.5 s1 --disk-only  
Domain snapshot s1 created

3. Do blockpull
# virsh blockpull rhel6.5 vda --verbose --wait --bandwidth 1
Block Pull: [ 0 % ]

4. Do blockcommit/blockcopy before blockpull is done

# /usr/bin/virsh blockcommit rhel6.5  vda --active
error: internal error: unable to execute QEMU command 'block-commit': Device 'drive-virtio-disk0' is busy: block device is in use by block job: stream

# /usr/bin/virsh blockcopy rhel6.5 vda /mnt/sss
error: internal error: unable to execute QEMU command 'drive-mirror': Device 'drive-virtio-disk0' is busy: block device is in use by block job: stream

# /usr/bin/virsh blockpull rhel6.5 vda
error: internal error: Unexpected error: (GenericError) 'Device 'drive-virtio-disk0' is busy: block device is in use by block job: stream'


Actual results:


Expected results:

Libvirt should give more accurate error report like
"error: block pull still active: disk 'vda' already in active block job"

Additional info:

Comment 2 Pavel Hrdina 2015-06-18 12:19:33 UTC
Upstream commin:

commit 51f9f03a4ca50b070c0fbfb29748d49f583e15e1
Author: Peter Krempa <pkrempa>
Date:   Fri Mar 13 17:22:04 2015 +0100

    qemu: Disallow concurrent block jobs on a single disk
    
    While qemu may be prepared to do this libvirt is not. Forbid the block
    ops until we fix our code.


v1.2.13-177-g51f9f03

Comment 4 Yang Yang 2015-07-22 09:58:35 UTC
Verified with libvirt-1.2.17-2.el7.x86_64 and qemu-kvm-rhev-2.3.0-12.el7.x86_64

Steps
1. do concurrent block ops when blockpull is running
in terminal 1
# virsh blockpull vm1 vda --wait --verbose --bandwidth 1
Block Pull: [  2 %]

in terminal 2
# virsh blockpull vm1 vda --wait --verbose --bandwidth 1
error: Operation not supported: disk 'vda' already in active block job

# virsh blockcommit vm1 vda --verbose --bandwidth 1 --active --wait
error: Operation not supported: disk 'vda' already in active block job

# virsh blockcopy vm1 vda /tmp/copy
error: Operation not supported: disk 'vda' already in active block job


2. do concurrent block ops when blockcommit is running
in terminal 1
# virsh blockcommit vm1 vda --wait --verbose --bandwidth 1 --active
Block Commit: [  6 %]

in terminal 2
# virsh blockcommit vm1 vda --verbose --bandwidth 1 --active --wait
error: block copy still active: disk 'vda' already in active block job

# virsh blockpull vm1 vda --wait --verbose --bandwidth 1
error: block copy still active: disk 'vda' already in active block job

# virsh blockcopy vm1 vda /tmp/copy
error: block copy still active: disk 'vda' already in active block job

3. do concurrent block ops when blockcopy is running
in terminal 1
# virsh blockcopy vm1 vda /tmp/copy --wait --verbose --bandwidth 1

Now in mirroring phase

The issue is tracked by Bug 1210903

in terminal 2
# virsh blockcopy vm1 vda /tmp/copy
error: block copy still active: disk 'vda' already in active block job

# virsh blockpull vm1 vda --wait --verbose --bandwidth 1
error: block copy still active: disk 'vda' already in active block job

# virsh blockcommit vm1 vda --verbose --bandwidth 1 --active --wait
error: block copy still active: disk 'vda' already in active block job

Comment 6 errata-xmlrpc 2015-11-19 05:47:20 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/RHBA-2015-2202.html