Bug 1218145

Summary: vm deadlock when deleting a nonexistent iothread with --config
Product: Red Hat Enterprise Linux 7 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: dyuan, fjin, honzhang, jtomko, mzhan, rbalakri
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.16-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:30:01 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 Luyao Huang 2015-05-04 09:34:56 UTC
description of problem:
vm deadlock when del an unexist iothread with --config

Version-Release number of selected component (if applicable):
libvirt-1.2.15-1.el7.x86_64
qemu-kvm-rhev-2.2.0-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
prepare a running vm:

# virsh list
 Id    Name                           State
----------------------------------------------------
 4     test3                          running

2.
# virsh iothreaddel test3 1234567891 --config
error: invalid argument: cannot find IOThread '1234567891' in persistent iothreadids

# virsh iothreaddel test3 1234567891 --current
error: Timed out during operation: cannot acquire state change lock (held by remoteDispatchDomainDelIOThread)

Actual results:
 vm deadlock when del an unexist iothread with --config

Expected results:
no deadlock

infomation:

Comment 1 Luyao Huang 2015-05-04 09:38:17 UTC
Patch already send to upstream:

https://www.redhat.com/archives/libvir-list/2015-May/msg00016.html

Comment 2 Ján Tomko 2015-05-04 10:22:29 UTC
Pushed upstream:
commit 3f7cad7a8fb5f646a924975517ff3f04c723540b
Author:     Luyao Huang <lhuang>
CommitDate: 2015-05-04 12:18:55 +0200

    qemu: fix the vm deadlock when deleting a nonexistent iothread
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1218145
    
    Jump to endjob instead of cleanup to fix this deadlock.
    
    Signed-off-by: Luyao Huang <lhuang>

git describe: v1.2.15-8-g3f7cad7

Comment 4 Fangge Jin 2015-08-20 08:57:18 UTC
I can reproduce this bug on build libvirt-1.2.15-1.el7.x86_64

Verify it on build libvirt-1.2.17-5.el7.x86_64

Steps:
1.Prepare a guest with iothreadinfo like below:
# virsh iothreadinfo rhel7d2
 IOThread ID     CPU Affinity   
---------------------------------------------------
 1               4
 2               6
 6               1-4,6
 8               1-4,6

2.# virsh iothreaddel rhel7d2 12345 --config
error: invalid argument: cannot find IOThread '12345' in persistent iothreadids

3.# virsh iothreaddel rhel7d2 12345 --current
error: invalid argument: cannot find IOThread '12345' in iothreadids list

4.# virsh iothreaddel rhel7d2 1 --current

5.# virsh iothreadinfo rhel7d2 
 IOThread ID     CPU Affinity   
---------------------------------------------------
 2               6
 6               1-4,6
 8               1-4,6

Comment 6 errata-xmlrpc 2015-11-19 06:30:01 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