The man page of qemu(2.6.2), states the following:
-smp [cpus=]n[,cores=cores][,threads=threads][,sockets=sockets][,maxcpus=maxcpus]
Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs to 4. For the PC target, the number of cores per
socket, the number of threads per cores and the total number of sockets can be specified. Missing values will be computed. *If any on the three values is given, the total number of CPUs n can be
omitted*. maxcpus specifies the maximum number of hotpluggable CPUs.
So, I built the master branch of libvirt and tested the following:
Client:
$ ./run ./tools/virsh domxml-from-native qemu-argv <(echo '/usr/bin/qemu-system-x86_64 -enable-kvm -smp cores=2,threads=1,sockets=1')
error: Disconnected from qemu:///session due to I/O error
error: Cannot recv data: Connection reset by peer
Server:
$ ./run gdb ./daemon/libvirtd
GNU gdb (GDB) Fedora 7.11.1-86.fc24
...
Starting program: /home/wani/libvirt/daemon/.libs/lt-libvirtd
[Thread debugging using libthread_db enabled]
...
[Thread 0x7fffc462c700 (LWP 16850) exited]
...
Thread 4 "lt-libvirtd" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe4cf1700 (LWP 16836)]
qemuDomainDefVcpusPostParse (def=0x7fffb8000ec0) at qemu/qemu_domain.c:2480
2480 if (!vcpu->online) {
qemuDomainDefVcpusPostParse() calls vcpu = virDomainDefGetVcpu(def, 0), which returns NULL.
I'd be happy to send a patch, but I am not sure what the right solution is.
- Should not specifying n to -smp allowed?
- Should -cpus=n also be parsed in qemuParseCommandLineSmp()?
Cheers!
Nehal J Wani