RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1088165 - libvirtd crashed after hot-unplug the vcpus which is pined to host cpus
Summary: libvirtd crashed after hot-unplug the vcpus which is pined to host cpus
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1091206
TreeView+ depends on / blocked
 
Reported: 2014-04-16 07:34 UTC by Xuesong Zhang
Modified: 2016-04-26 14:41 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.10.2-34.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 04:21:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
libvirt crashed bt info (9.38 KB, text/plain)
2014-04-16 07:35 UTC, Xuesong Zhang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1374 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2014-10-14 08:11:54 UTC

Description Xuesong Zhang 2014-04-16 07:34:25 UTC
Description of problem:
libvirtd crashed after hot-unplug the vcpus which is pined to some host cpus.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-32.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.423.el6.x86_64
kernel-2.6.32-457.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare one shutoff guest, revise the dumpxml as following:
......
  <vcpu placement='static' current='2'>4</vcpu>
......

2. start the guest

3. check the cpu settings in the dumpxml
# virsh dumpxml rhel6.5|grep cpu
  <vcpu placement='static' current='2'>4</vcpu>

4. pin the 2nd cpu to some host cpus.
# virsh vcpupin rhel6.5 1 0,3

5. check the cpu settings in the dumpxml again, the result is as expected.
# virsh dumpxml rhel6.5|grep cpu
  <vcpu placement='static' current='2'>4</vcpu>
  <cputune>
    <vcpupin vcpu='1' cpuset='0,3'/>
  </cputune>


6. hot-unplug the vcpus
# virsh setvcpus rhel6.5 1


7. check the cpu settings in the dumpxml again, then libvirtd dead.
# virsh dumpxml rhel6.5|grep cpu
error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

# service libvirtd status
libvirtd dead but pid file exists




Actual results:
As step 7

Expected results:
libvirt should not crashed, should prompt the user the hot-unplug cpus are pined to host cpus and forbid to hot-unplug it.


Addtional info:
attached is the bt info for reference.

Comment 1 Xuesong Zhang 2014-04-16 07:35:49 UTC
Created attachment 886775 [details]
libvirt crashed bt info

Comment 2 Ján Tomko 2014-04-22 12:54:04 UTC
Patch posted upstream:
https://www.redhat.com/archives/libvir-list/2014-April/msg00825.html

Comment 3 Ján Tomko 2014-04-22 14:50:46 UTC
Now pushed upstream:
commit a0a8dc695e9e20fa8b4ebe9c7ad697a4e9b3ac41
Author:     Ján Tomko <jtomko>
CommitDate: 2014-04-22 14:49:25 +0200

    Properly free vcpupin info for unplugged CPUs
    
    Remove the pointer from def->cputune.vcpupin after unplugging
    the CPU and also free the bitmap contained in the structure
    by calling virDomainVcpuPinDel instead of VIR_FREE.
    
    Introduced by commit 0df1a79.
    
    This makes virDomainLookupVcpuPin redundant.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1088165
                                 
git describe: v1.2.3-144-ga0a8dc6

Posted downstream:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2014-April/msg00455.html

Comment 6 Jincheng Miao 2014-05-04 08:05:44 UTC
The latest libvirt-0.10.2-34.el6 will not crash after hot-unplug the vcpu which is pined.

# virsh start r6
Domain r6 started

# virsh vcpupin r6
VCPU: CPU Affinity
----------------------------------
   0: 0-7
   1: 0-7

# virsh vcpupin r6 1 0,3

# virsh dumpxml r6 | grep cputune
  <cputune>
  </cputune>

# virsh dumpxml r6 | grep -1 cputune
  <vcpu placement='static' current='2'>4</vcpu>
  <cputune>
    <vcpupin vcpu='1' cpuset='0,3'/>
  </cputune>
  <os>

# virsh setvcpus r6 1

# service libvirtd status
libvirtd (pid  7850) is running...

Comment 8 errata-xmlrpc 2014-10-14 04:21:16 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/RHBA-2014-1374.html


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