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 636349 - libvirt-0.8.4 fails to start VMs after upgrade
Summary: libvirt-0.8.4 fails to start VMs after upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: rc
: 6.1
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 635857 636347
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-21 23:34 UTC by Eric Blake
Modified: 2011-05-19 13:21 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 636347
Environment:
Last Closed: 2011-05-19 13:21:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Description Eric Blake 2010-09-21 23:34:43 UTC
+++ This bug was initially created as a clone of Bug #636347 +++

Upstream commit d413e5d7 was applied after 0.8.3, but was backported to RHEL 6.0 as patch 185, so 0.8.1-26.el6 is also vulnerable.

Description of problem:
I just upgraded one of our servers to libvirt-0.8.4 but I can't use virsh or virt-manager anymore. Syslog says the following "error : get_cpu_value:88 : cannot open /sys/devices/system/cpu/cpu1/online: No such file or directory"
I only have /sys/devices/system/cpu/online which states the number of CPUs the server has, e.g. 0-7.

I suspected the kernel option "hotpluggable cpu support", which was not enabled on my host. After enabling it libvirt works again even though I still don't have "/sys/devices/system/cpu/cpu1/online".


I agree with danpb's analysis that commit d413e5d7 is the culprit.  I only tested that commit on a hot-plug enabled kernel.  So the fact that disabling hot-plugging makes /sys/devices/system/cpu/cpu<n>/ directories disappear makes sense, but was something I never encountered during my testing.

My patch only allowed a missing directory for cpu0 (since x86_64 systems with hot-unplug cpu support still disallow hot-unplugging cpu0).  The fix is to allow a missing directory for all possible cpus.





diff --git i/src/nodeinfo.c w/src/nodeinfo.c
index 65eeb24..3dac9f3 100644
--- i/src/nodeinfo.c
+++ w/src/nodeinfo.c
@@ -65,7 +65,8 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
 /* Return the positive decimal contents of the given
  * CPU_SYS_PATH/cpu%u/FILE, or -1 on error.  If MISSING_OK and the
  * file could not be found, return 1 instead of an error; this is
- * because some machines cannot hot-unplug cpu0.  */
+ * because some machines cannot hot-unplug cpu0, or because
+ * hot-unplugging is disabled.  */
 static int
 get_cpu_value(unsigned int cpu, const char *file, bool missing_ok)
 {
@@ -113,7 +114,7 @@ cleanup:
 static int
 cpu_online(unsigned int cpu)
 {
-    return get_cpu_value(cpu, "online", cpu == 0);
+    return get_cpu_value(cpu, "online", true);
 }

 static unsigned long count_thread_siblings(unsigned int cpu)

Comment 2 Eric Blake 2010-09-22 15:17:04 UTC
The RHEL kernel always has hot-plugging enabled, so within RHEL, this is only an issue for people that re-build their own kernel with hot-plugging disabled.  Therefore, it is not critical to get this into 6.0, and deferring to 6.1 makes sense on that front.  And even though we are fixing the same issue for 5.6 (bug #636347), deferring this fix in 6.0 should not be viewed as a regression given that there is no direct upgrade path from 5.6 to 6.0.

Comment 3 Eric Blake 2010-12-16 00:27:51 UTC
Fixed by upstream commit be026480f9cdc729f0c35f4d861a5dcda2388098

    nodeinfo: work when hot-plugging is disabled

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=635857.

    * src/nodeinfo.c (cpu_online): Allow missing directory for all
    CPUs, not just cpu0.

Will be picked up by rebasing for RHEL 6.1.

Comment 6 weizhang 2011-03-04 06:41:20 UTC
verified pass on
libvirt-0.8.7-8.el6.x86_64
qemu-kvm-0.12.1.2-2.148.el6.x86_64
kernel-2.6.32-118.el6.x86_64

Steps:
1. #cp /sys/devices/system/cpu/ /tmp/fakesysfs/
2. in /tmp/fakesysfs/cpu<N> remove 'online' file
3. #mount --bind /tmp/fakesysfs /sys/devices/system/cpu
4. #service libvirtd restart
5. #virsh start guest
Domain guest started

#virsh dumpxml guest
<domain type='kvm' id='2'>
  <name>guest</name>
  <uuid>63321e4c-ec97-a6c5-2867-dee9eb7918b7</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>4</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
...

Comment 9 errata-xmlrpc 2011-05-19 13:21:50 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html


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