Skip to content

system/vl.c: parse all '-accel' opts

Daniel Henrique Barboza qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2system/vl.c: do not allow mixed -accel optssystem/vl.c+14 -13 replies
2/2system/vl.c: parse all -accel optionssystem/vl.c+1 -04 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] system/vl.c: parse all '-accel' opts

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 <[email protected]>
Cc Thomas Huth <[email protected]>

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(-)
Signature · 1 line
2.45.2