qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] system/vl.c: parse all '-accel' opts
@ 2024-07-01 13:30 Daniel Henrique Barboza
  2024-07-01 13:30 ` [PATCH 1/2] system/vl.c: do not allow mixed -accel opts Daniel Henrique Barboza
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Daniel Henrique Barboza @ 2024-07-01 13:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: ajones, Daniel Henrique Barboza, Paolo Bonzini, Thomas Huth

Hi,

In the current handling of  '-accel' only the first instance is parsed.
All other instances (aside from a 'helper' command that triggers the
help text and exits) is ignored.

This also means that we can mix different accelerators in the same
command line. In fact we can do whatever we want as long as the first
instance of '-accel' is valid. E.g. this command line will boot a x86_64
KVM guest without problems:

qemu-system-x86_64 -accel kvm -accel tcg -accel not_an_accel (...)

And this will boot a KVM guest with kernel-irqchip=off because it will
ignore the second '-accel' that sets its back to 'on':

qemu-system-x86_64 -accel kvm,kernel-irqchip=off \
    -accel kvm,kernel-irqchip=on (...)

My initial intention was to fix a problem we're having with libvirt and
RISC-V where we can't set 'riscv-aia' by appending '-accel kvm,riscv-aia=val'
via <qemu:cmdline> in the domain XML. libvirt will add a leading
'-accel kvm' in the regular command line and ignore the second. But to
fix that (patch 2) we must first guarantee that we're not mixing different
accelerators.

Both patches can be squashed in a single patch if preferrable. I'm
sending in separate because I'm not fully confident in patch 1.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>

Daniel Henrique Barboza (2):
  system/vl.c: do not allow mixed -accel opts
  system/vl.c: parse all -accel options

 system/vl.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

-- 
2.45.2



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-07-04 11:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 13:30 [PATCH 0/2] system/vl.c: parse all '-accel' opts Daniel Henrique Barboza
2024-07-01 13:30 ` [PATCH 1/2] system/vl.c: do not allow mixed -accel opts Daniel Henrique Barboza
2024-07-01 15:23   ` Richard Henderson
2024-07-01 15:53     ` Daniel Henrique Barboza
2024-07-01 16:23       ` Paolo Bonzini
2024-07-01 13:30 ` [PATCH 2/2] system/vl.c: parse all -accel options Daniel Henrique Barboza
2024-07-01 14:34   ` Philippe Mathieu-Daudé
2024-07-01 16:43     ` Paolo Bonzini
2024-07-01 19:47       ` Philippe Mathieu-Daudé
2024-07-04 11:01       ` Alex Bennée
2024-07-01 16:31 ` [PATCH 0/2] system/vl.c: parse all '-accel' opts Paolo Bonzini
2024-07-01 17:20   ` Daniel Henrique Barboza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).