On Fri, May 14, 2021 at 06:00:37PM +0200, Paolo Bonzini wrote: > On 14/05/21 14:48, Mirela Grujic wrote: > > > > With our approach, transitioning to the QMP configuration suppose to > > happen gradually, i.e. we still specify some configuration options via > > command line. For your approach to be applicable to our use case we > > would at least need a QMP equivalent for the following: > > > > qemu-system-riscv64 \ > > -M sifive_dt \ > > -cpu > > rv64,i=true,g=false,m=true,a=true,f=true,d=true,c=true,s=false,u=false,x-b=true,pmp=true,mmu=false,num-pmp-regions=8 > > \ > > -smp 1 \ > > -device ... > > > > AFAIU from the materials you shared, we would need to add -cpu and > > -device, but I don't see any reason why we wouldn't do this. > > -cpu is indeed the big one that I had not looked at so far, while -device > should be mostly covered by the existing device_add command. > > One possibility for -cpu is to make it an argument of machine-set too. For > example the above would be > > { 'execute': 'machine-set', arguments: { > 'type': 'sifive_dt', > 'smp': { 'cpus': 1 }, > 'cpu': { 'model': 'rv64', 'i': true, 'g': false, ... } > }
CPUs are a little complex because they have association with both machine types and accelerator backends. You have 'accel-set' being issued after 'machine-set', but the 'host' CPU model is only valid if you have set the KVM accelerator, not TCG. It is desirable that you get an error report about bad CPU at the time you specify the CPU config, rather than have that error delayed to when a later command runs and invalidates your CPU choice. This is a long winded way of saying either 'accel-set' should be run before 'machine-set', or 'cpu' would have to be set as its own command or as part of 'accel-set'. My gut feeling though is accel-set would be more logical being done first, as that also influences the set of features available in other areas of QEMU configuration. Was there a reason you listed it after machine-set ? Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|