]> xenbits.xensource.com Git - libvirt.git/commit
nodeinfo: skip offline CPUs
authorEric Blake <eblake@redhat.com>
Tue, 10 Aug 2010 21:33:37 +0000 (15:33 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 10 Aug 2010 22:25:56 +0000 (16:25 -0600)
commitd413e5d7659f07994a79290a56c904a9b136ee2d
tree6cda59b1e074343da365190c91ab2d7b86c93ff7
parentd1e5676c0d9e4ab51dc37f4fc882f630ef2f15e0
nodeinfo: skip offline CPUs

https://bugzilla.redhat.com/622515 - When hot-unplugging CPUs,
libvirt failed to start a guest that had been pinned to CPUs that
were still online.

Tested on a dual-core laptop, where I also discovered that, per
http://www.cyberciti.biz/files/linux-kernel/Documentation/cpu-hotplug.txt,
/sys/devices/system/cpu/cpu0/online does not exist on systems where it
cannot be hot-unplugged.

* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Ignore CPUs that are
currently offline.  Detect readdir failure.
(parse_socket): Move guts...
(get_cpu_value): ...to new function, shared with...
(cpu_online): New function.
src/nodeinfo.c