On Wed, Sep 07, 2016 at 09:52:59AM +0800, Dou Liyang wrote: [...] > > > > The option: > > -smp MODEL,+FOO,+BAR > > I guess you may mean "-cpu", not "-smp"
Oops, yes. Thanks. :) > > > is internally translated to: > > -global MODEL.FOO=on > > -global MODEL.BAR=on > > in addition to setting the CPU model for creating initial CPUs to > > MODEL. > > > > I see. > [...] > > > > > > > > -smp sockets=2,cores=2,maxcpus=4 > > > > > > > -device qemu64-x86_64-cpu,id=cpu1,socket-id=1,core-id=1,thread-id=0 > > > > -device qemu64-x86_64-cpu,id=cpu1,socket-id=1,core-id=2,thread-id=0 > > > > -device qemu64-x86_64-cpu,id=cpu3,socket-id=2,core-id=1,thread-id=0 > > > > -device qemu64-x86_64-cpu,id=cpu4,socket-id=2,core-id=2,thread-id=0 > > > > > > > > or does I need minimum 1 non unplugable cpu > > > > As mentioned above, the default number of CPUs is 1, so "-smp > > sockets=2" is the same as "-smp 1,sockets=2". > > > > I assume you mean something like "-smp 0", but that doesn't work > > today. I would like to eventually allow all CPUs to be created > > using -device, but that's not possible yet. > > I am interested in what is the benefit, if we can create all CPUs using > -device. :) Do you mean the benefit of not allowing "-smp 0", or the benefit of using -device? The benefit of not allowing "-smp 0" is none, except that we probably have existing code that would break if we allow that, and that code needs to be fixed first. About -device: the benefit is having an uniform interface to create every kind of device, and using the same interface and options for hotplugged CPUs and non-hotplug CPUs. (But one problem with -device today is that management software needs to know what are the valid socket/core/thread arguments for the machine but can't run a 'query-hotpluggable-cpus' command before launching QEMU [unless it launches QEMU twice]). -- Eduardo