Bug 845448 - [blockcopy]sometimes Ctrl+C can't terminate blockcopy when use --wait with other options
Summary: [blockcopy]sometimes Ctrl+C can't terminate blockcopy when use --wait with ot...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 837787
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-03 06:31 UTC by zhpeng
Modified: 2013-09-09 00:03 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.2-3.el6
Doc Type: Bug Fix
Doc Text:
Cause: SIGINT wasn't blocked during the call to virDomainGetBlockJobInfo in virsh. Consequence: Pressing Ctrl-C might only terminate virsh, without aborting the job. Fix: Block SIGINT for the duration of virDomainGetBlockJobInfo. Result: Block jobs with --wait can be aborted.
Clone Of:
Environment:
Last Closed: 2013-02-21 07:20:38 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description zhpeng 2012-08-03 06:31:20 UTC
Description of problem:
sometimes Ctrl+C can't terminate blockcopy when use --wait with other options

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.297.el6.x86_64
libvirt-0.9.10-21.el6_3.3.x86_64


How reproducible:
30%-50%

Steps to Reproduce:
1, create a guest with a disk
# virsh create test.xml
Domain test created from test.xml
2, blockcopy with --wait and other option (example: --finish) before it finished press CTRL+C
# virsh  blockcopy test vda /var/lib/libvirt/images/bak --wait --finish
^Cerror: failed to query job for disk vda
 
# virsh blockjob test vda   -----> terminated
3, delete the copy file and do it again
# virsh  blockcopy test vda /var/lib/libvirt/images/bak --wait --finish
^Cerror: failed to query job for disk vda
error: poll on socket failed: Interrupted system call
# virsh blockjob test vda
Block Copy: [ 10 %]         -----> Job is not terminated


Actually results:
Some times Ctrl+C not works

Expected results:
Always works.

Additional info:
Because BZ 837583,so i don't test it with libvirt-0.9.13-3

Comment 4 Eric Blake 2012-10-12 03:12:36 UTC
'virsh blockpull' has the same issue, so you should be able to test with that sequence while still waiting for 'virsh blockcopy' and 'virsh blockcommit' to actually work with RHEL 6.4 qemu-kvm-rhev.

Fixed by this upstream commit:
commit 13fefaf37fd083ed2a928c414a983b16b0f2d5b7
Author: Ján Tomko <jtomko@redhat.com>
Date:   Thu Oct 11 17:12:13 2012 +0200

    virsh: block SIGINT while getting BlockJobInfo
    
    SIGINT hasn't been blocked, which could lead to losing it somewhere in
    virDomainGetBlockJobInfo and not aborting the job.

Comment 5 Ján Tomko 2012-10-12 14:58:50 UTC
Changing status to POST:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-October/msg00624.html

Comment 9 zhe peng 2012-10-31 05:54:14 UTC
this bug can be reproduce with build:

libvirt-0.9.10-21.el6_3.3.x86_64

verify with:
libvirt-0.10.2-6.el6.x86_64

step:
1. create a guest with a disk
#cat vm1.xml
<domain type="kvm">
 <name>vm1</name>
 <memory>131072</memory>
 <devices>
   <disk device="disk" type="block">
      <source dev="/dev/vgtest1/lvleafimg1"/>
      <target bus="ide" dev="hda"/>
       <driver name="qemu" type="qcow2"/>
   </disk>
 </devices>
   <os>
     <type arch="x86_64" machine="pc">hvm</type>
   </os>
</domain>

# virsh create vm1.xml
Domain vm1 created from vm1.xml
2, blockcopy with --wait and other option (example: --finish) before it finished press CTRL+C
# virsh  blockcopy vm1 hda /var/lib/libvirt/images/bak --wait --finish
^Cerror: failed to query job for disk hda
 
# virsh blockjob test vda   -----> terminated
3, delete the copy file and do it again
# virsh  blockcopy test vda /var/lib/libvirt/images/bak --wait --finish
^Cerror: failed to query job for disk vda

# virsh blockjob test vda
no output
the job is terminated.
I try this several times, all worked well.
verification passed.

Comment 10 errata-xmlrpc 2013-02-21 07:20:38 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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html


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