Bug 807186

Summary: Must be hotplug vcpus in order
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Igor Mammedov <imammedo>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, areis, bsarathy, chayang, dyasny, flang, juzhang, michen, mkenneth, qzhang, shu, sluo, virt-maint, wdai
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-27 16:23:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description FuXiangChun 2012-03-27 08:58:11 UTC
Description of problem:
If there is one time random hotplug vcpus then other hotplug operation will fail.

for example:
start guest with -smp 1 and maxcpus=160 option.
the first hotplug:
(qemu) cpu_set 10 online

other hotplug   

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1./usr/libexec/qemu-kvm -M rhel6.3.0 -cpu host --enable-kvm -m 4G -smp
1,maxcpus=161 -name rhel6.3 -uuid ddcbfb49-3411-1701-3c36-6bdbc00bedbb -rtc
base=utc,clock=host,driftfix=slew -drive
file=/dev/vg-54/lvtest,if=none,id=ide,format=qcow2,cache=none,werror=stop,rerror=stop
-device ide-drive,drive=ide,id=drive-ide0-0-0,bootindex=1 -netdev
tap,id=hostnet1 -device e1000,netdev=hostnet1,id=net1,mac=86:12:50:a4:32:72
-spice port=5911,disable-ticketing -vga qxl -device sga -chardev
socket,id=serial0,path=/var/test1,server,nowait -device
isa-serial,chardev=serial0 -balloon virtio -monitor
unix:/tmp/monitor2,server,nowait -monitor stdio

2.the first hotplug vcpu
(qemu) cpu_set 100 online

3.continue to hotplug vcpus in order 
  (qemu) cpu_set 2 online

Actual results:
hotplug fail

Expected results:
hotplug operation is successful within range of maxcpus

Additional info:
after step 2, use 'top' and 'cat /proc/cpuinfo' cann't get vcpu but 'ls /sys/device/system/cpus/' can see added vcpu in guest.

Comment 1 FuXiangChun 2012-03-27 09:01:11 UTC
host info:
# uname -r
2.6.32-257.el6.x86_64

qemu vesion:
qemu-kvm-0.12.1.2-2.265.el6.x86_64

guest info:

rhel6.3 64bit guest

kernel version:
uname -r
2.6.32-251.el6.x86_64

Comment 3 Igor Mammedov 2012-03-27 16:23:28 UTC
I'd say it is WONTFIX for 6.3 with high chance of regression if I start touch cpu_index and apic code to fix it.
Lets deal with it upstream first, and then maybe rhel7 will have fix for it.

For now plug cpus only in consecutive order or use libvirt which does this.