Skip to content

spapr.c: set a 'kvm-type' default value instead of relying on NULL

Daniel Henrique Barboza qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 4 repliesIn review
  2. v21 patch 3 repliesSuperseded
  3. v11 patch 7 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1spapr.c: set a 'kvm-type' default value instead of relying on NULLhw/ppc/spapr.c+17 -41 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchGreg Kurz
1/1R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

changes from v2, all proposed by Greg:
* Handle 'NULL' value as default mode fallback in spapr_kvm_type()
* Do not allow for 'AUTO' to be a valid mode in spapr_kvm_type()
* Initialize 'spapr->kvm_type' in spapr_instance_init() like Paolo proposed. This will spare us from changing spapr_get_kvm_type() altogether.
v2 link: https://lists.gnu.org/archive/html/qemu-devel/2020-12/msg02623.html

This patch addresses an issue that happens with the pseries machine after testing Paolo's patch [1]:

$ sudo ./ppc64-softmmu/qemu-system-ppc64 -nographic -nodefaults -machine pseries --enable-kvm
qemu-system-ppc64: Unknown kvm-type specified '' 

The reason lies on how qemu_opt_get() and object_property_get_str() works when there is no 'kvm-type' specified. We were conting on receiving NULL for kvm-type, but the latter will use a blank string "". Instead on relying on NULL, let's expose the already existing 'auto' kvm-type mode to the users and use that as default.

[1] https://lists.gnu.org/archive/html/qemu-devel/2020-12/msg00471.html

Daniel Henrique Barboza (1):
spapr.c: set a 'kvm-type' default value instead of relying on NULL

 hw/ppc/spapr.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.2