Bug 845448 - [blockcopy]sometimes Ctrl+C can't terminate blockcopy when use --wait with other options
[blockcopy]sometimes Ctrl+C can't terminate blockcopy when use --wait with ot...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On: 837787
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-03 02:31 EDT by zhpeng
Modified: 2013-09-08 20:03 EDT (History)
8 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:20:38 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)

  None (edit)
Description zhpeng 2012-08-03 02:31:20 EDT
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-11 23:12:36 EDT
'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 10:58:50 EDT
Changing status to POST:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-October/msg00624.html
Comment 9 zhe peng 2012-10-31 01:54:14 EDT
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 02:20:38 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.

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.