Bug 1204017

Summary: vm deadlock if do setvcpus failed
Product: Red Hat Enterprise Linux 7 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.1CC: dyuan, honzhang, mzhan, pkrempa, rbalakri, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.13-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:24:34 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-03-20 07:37:27 UTC
description of problem:
vm deadlock if do setvcpus failed

Version-Release number of selected component (if applicable):
libvirt-1.2.8-16.el7_1.1.x86_64
qemu-kvm-rhev-2.1.2-23.el7_1.1.x86_64

How reproducible:
100%

Steps to Reproduce:
 
1.prepare a offline vm and make it will failed when do setvcpus to a offline vm(becuase bug 1204006):

# virsh setvcpus test3 10
error: Failed to create controller cpu for group: No such file or directory

# virsh setvcpus test3 10
error: Timed out during operation: cannot acquire state change lock


Actual results:
vm deadlock if do setvcpus failed

Expected results:
no deaklock

Additional info:

This was introduce in a backport in bug
https://bugzilla.redhat.com/show_bug.cgi?id=1161540

and fixed by upstream commit:

commit 0df2f0404fdc87691c940565e42fbde83ce71679
Author: Peter Krempa <pkrempa>
Date:   Wed Feb 18 18:05:21 2015 +0100

    qemu: Exit job on error path of qemuDomainSetVcpusFlags()
    
    Commit e105dc981438bc33fa771bd67cece6234dbf6c8d moved some code but
    didn't adjust the jump labels so that the job would be terminated.


and because bug 1204006 will make this deadlock easy to meet, so i think
need filed a bug to track it and check if we need backport.

Comment 3 Luyao Huang 2015-05-18 10:11:40 UTC
Because cannot verify this bug with the same steps (because bug 1204006 have been fixed in libvirt-1.2.15-2.el7.x86_64) with libvirt-1.2.15-2.el7.x86_64,
I chose another way to verify this issue:

1. prepare a running vm with max cpu 2 and current 1:

# virsh dumpxml test3
  <vcpu placement='static' current='1'>2</vcpu>

2. umount cgroup cpuset:

# umount /sys/fs/cgroup/cpuset

3. no deadlock:
# virsh setvcpus test3 2
error: Failed to create controller cpuset for group: No such file or directory

# virsh setvcpus test3 2
error: Failed to create controller cpuset for group: No such file or directory


And verify use the same steps with comment 0 with libvirt-1.2.13-1.el7.x86_64:

1. prepare a inactive vm with cpu 2 and current 1:

# virsh dumpxml test3
  <vcpu placement='static' current='1'>2</vcpu>

2. no deadlock:
# virsh setvcpus test3 2
error: Failed to create controller cpuacct for group: No such file or directory

# virsh setvcpus test3 2
error: Failed to create controller cpuacct for group: No such file or directory

Comment 5 errata-xmlrpc 2015-11-19 06:24:34 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