All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Alex Williamson <alex.williamson@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PULL 36/40] vl: switch -M parsing to keyval
Date: Wed, 14 Jul 2021 07:16:43 +0100	[thread overview]
Message-ID: <2e95d601-9449-9331-46b1-5a1bb2f48735@ilande.co.uk> (raw)
In-Reply-To: <20210713171000.0e3447f9.alex.williamson@redhat.com>

On 14/07/2021 00:10, Alex Williamson wrote:

> On Tue, 13 Jul 2021 13:43:47 -0600
> Alex Williamson <alex.williamson@redhat.com> wrote:
> 
>> On Tue,  6 Jul 2021 12:01:37 +0200
>> Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>> Switch from QemuOpts to keyval.  This enables the introduction
>>> of non-scalar machine properties, and JSON syntax in the future.
>>>
>>> For JSON syntax to be supported right now, we would have to
>>> consider what would happen if string-based dictionaries (produced by
>>> -M key=val) were to be merged with strongly-typed dictionaries
>>> (produced by -M {'key': 123}).
>>>
>>> The simplest way out is to never enter the situation, and only allow one
>>> -M option when JSON syntax is in use.  However, we want options such as
>>> -smp to become syntactic sugar for -M, and this is a problem; as soon
>>> as -smp becomes a shortcut for -M, QEMU would forbid using -M '{....}'
>>> together with -smp.  Therefore, allowing JSON syntax right now for -M
>>> would be a forward-compatibility nightmare and it would be impossible
>>> anyway to introduce -M incrementally in tools.
>>>
>>> Instead, support for JSON syntax is delayed until after the main
>>> options are converted to QOM compound properties.  These include -boot,
>>> -acpitable, -smbios, -m, -semihosting-config, -rtc and -fw_cfg.  Once JSON
>>> syntax is introduced, these options will _also_ be forbidden together
>>> with -M '{...}'.
>>>
>>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>>> ---
>>>   softmmu/vl.c | 315 ++++++++++++++++++++++++---------------------------
>>>   1 file changed, 146 insertions(+), 169 deletions(-)
>>
>> This breaks the below long standing test VM.  libvirt log and xml
>> provided below.  I'm using libvirt version 7.3.0.
> 
> A trivial reproducer:
> 
> qemu-system-x86_64 -blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.fd","node-name":"pflash0-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"pflash0-format","read-only":true,"driver":"raw","file":"pflash0-storage"}' -machine pc,pflash0=pflash0-format
> 
> backtrace:
> 
> #0  error_setg_internal
>      (errp=0x7fffffffd6c8, src=0x55555618bc10 "../../home/alwillia/Work/qemu.git/qapi/qobject-input-visitor.c", line=172, func=0x55555618bf20 <__func__.27> "qobject_input_get_object", fmt=0x55555618bc98 "Parameter '%s' is missing") at ../../home/alwillia/Work/qemu.git/util/error.c:93
> #1  0x0000555555f8d255 in qobject_input_get_object (qiv=0x5555569c59b0, name=0x555556920ef0 "drive", consume=true, errp=0x7fffffffd6c8) at ../../home/alwillia/Work/qemu.git/qapi/qobject-input-visitor.c:172
> #2  0x0000555555f8d28b in qobject_input_get_keyval (qiv=0x5555569c59b0, name=0x555556920ef0 "drive", errp=0x7fffffffd6c8) at ../../home/alwillia/Work/qemu.git/qapi/qobject-input-visitor.c:184
> #3  0x0000555555f8e3a9 in qobject_input_type_str_keyval (v=0x5555569c59b0, name=0x555556920ef0 "drive", obj=0x7fffffffd5a8, errp=0x7fffffffd6c8)
>      at ../../home/alwillia/Work/qemu.git/qapi/qobject-input-visitor.c:551
> #4  0x0000555555f59e51 in visit_type_str (v=0x5555569c59b0, name=0x555556920ef0 "drive", obj=0x7fffffffd5a8, errp=0x7fffffffd6c8) at ../../home/alwillia/Work/qemu.git/qapi/qapi-visit-core.c:337
> #5  0x00005555558c3b70 in set_drive_helper (obj=0x5555569208a0, v=0x5555569c59b0, name=0x555556920ef0 "drive", opaque=0x5555564c8300 <pflash_cfi01_properties>, iothread=false, errp=0x7fffffffd6c8)
>      at ../../home/alwillia/Work/qemu.git/hw/core/qdev-properties-system.c:97
> #6  0x00005555558c3e0b in set_drive (obj=0x5555569208a0, v=0x5555569c59b0, name=0x555556920ef0 "drive", opaque=0x5555564c8300 <pflash_cfi01_properties>, errp=0x7fffffffd6c8)
>      at ../../home/alwillia/Work/qemu.git/hw/core/qdev-properties-system.c:171
> #7  0x0000555555edb821 in field_prop_set (obj=0x5555569208a0, v=0x5555569c59b0, name=0x555556920ef0 "drive", opaque=0x5555564c8300 <pflash_cfi01_properties>, errp=0x7fffffffd6c8)
>      at ../../home/alwillia/Work/qemu.git/hw/core/qdev-properties.c:86
> #8  0x0000555555eb7f15 in object_property_set (obj=0x5555569208a0, name=0x555556920ef0 "drive", v=0x5555569c59b0, errp=0x7fffffffd768) at ../../home/alwillia/Work/qemu.git/qom/object.c:1402
> #9  0x0000555555ebad9e in property_set_alias (obj=0x55555683dde0, v=0x5555569c59b0, name=0x5555566fc8a0 "pflash0", opaque=0x555556920ed0, errp=0x7fffffffd768)
>      at ../../home/alwillia/Work/qemu.git/qom/object.c:2695
> #10 0x0000555555eb7f15 in object_property_set (obj=0x55555683dde0, name=0x5555566fc8a0 "pflash0", v=0x5555569c59b0, errp=0x7fffffffd7b8) at ../../home/alwillia/Work/qemu.git/qom/object.c:1402
> #11 0x0000555555eb3aa3 in object_set_properties_from_qdict (obj=0x55555683dde0, qdict=0x5555566fa5b0, v=0x5555569c59b0, errp=0x5555565d9308 <error_fatal>)
>      at ../../home/alwillia/Work/qemu.git/qom/object_interfaces.c:55
> #12 0x0000555555eb3bc3 in object_set_properties_from_keyval (obj=0x55555683dde0, qdict=0x5555566fa5b0, from_json=false, errp=0x5555565d9308 <error_fatal>)
>      at ../../home/alwillia/Work/qemu.git/qom/object_interfaces.c:79
> #13 0x0000555555cb3f5f in qemu_apply_machine_options (qdict=0x5555566fa5b0) at ../../home/alwillia/Work/qemu.git/softmmu/vl.c:1833
> #14 0x0000555555cb8606 in qemu_init (argc=7, argv=0x7fffffffdae8, envp=0x7fffffffdb28) at ../../home/alwillia/Work/qemu.git/softmmu/vl.c:3634
> #15 0x00005555558326d1 in main (argc=7, argv=0x7fffffffdae8, envp=0x7fffffffdb28) at ../../home/alwillia/Work/qemu.git/softmmu/main.c:49

Is this the same bug fixed by the proposed patch at 
https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg03324.html?


ATB,

Mark.


  reply	other threads:[~2021-07-14  6:18 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 10:01 [PULL 00/40] Misc patches for 2021-07-06 Paolo Bonzini
2021-07-06 10:01 ` [PULL 01/40] Makefile: Remove /usr/bin/env wrapper from the SHELL variable Paolo Bonzini
2021-07-06 10:01 ` [PULL 02/40] softmmu/vl: Remove obsolete comment about the "frame" parameter Paolo Bonzini
2021-07-06 10:01 ` [PULL 03/40] ui: Fix the "-display sdl,window_close=..." parameter Paolo Bonzini
2021-07-06 10:01 ` [PULL 04/40] ui: Mark the '-no-quit' option as deprecated Paolo Bonzini
2021-07-06 10:01 ` [PULL 05/40] qemu-options: Improve the documentation of the -display options Paolo Bonzini
2021-07-06 10:01 ` [PULL 06/40] coverity-scan: Remove lm32 / unicore32 targets Paolo Bonzini
2021-07-06 10:01 ` [PULL 07/40] coverity-scan: switch to vpath build Paolo Bonzini
2021-07-06 10:01 ` [PULL 08/40] target/i386: Declare constants for XSAVE offsets Paolo Bonzini
2021-07-06 10:01 ` [PULL 09/40] target/i386: Consolidate the X86XSaveArea offset checks Paolo Bonzini
2021-07-06 10:01 ` [PULL 10/40] target/i386: Clarify the padding requirements of X86XSaveArea Paolo Bonzini
2021-07-06 10:01 ` [PULL 11/40] target/i386: Pass buffer and length to XSAVE helper Paolo Bonzini
2021-07-06 10:01 ` [PULL 12/40] target/i386: Make x86_ext_save_areas visible outside cpu.c Paolo Bonzini
2021-07-06 10:01 ` [PULL 13/40] target/i386: Observe XSAVE state area offsets Paolo Bonzini
2021-07-06 10:01 ` [PULL 14/40] target/i386: Populate x86_ext_save_areas offsets using cpuid where possible Paolo Bonzini
2021-07-06 10:01 ` [PULL 15/40] target/i386: Move X86XSaveArea into TCG Paolo Bonzini
2021-07-06 10:01 ` [PULL 16/40] configure: drop vte-2.90 check Paolo Bonzini
2021-07-06 10:01 ` [PULL 17/40] configure, meson: convert vte detection to meson Paolo Bonzini
2021-07-06 10:01 ` [PULL 18/40] configure, meson: convert virgl " Paolo Bonzini
2021-07-06 10:01 ` [PULL 19/40] configure, meson: convert libdaxctl " Paolo Bonzini
2021-07-06 10:01 ` [PULL 20/40] configure, meson: convert libpmem " Paolo Bonzini
2021-07-06 10:01 ` [PULL 21/40] configure, meson: convert liburing " Paolo Bonzini
2021-07-06 10:01 ` [PULL 22/40] configure, meson: convert libxml2 " Paolo Bonzini
2021-07-06 10:01 ` [PULL 23/40] meson: sort existing compiler tests Paolo Bonzini
2021-07-06 10:01 ` [PULL 24/40] meson: store dependency('threads') in a variable Paolo Bonzini
2021-07-06 10:01 ` [PULL 25/40] configure, meson: move CONFIG_IVSHMEM to meson Paolo Bonzini
2021-07-06 10:01 ` [PULL 26/40] configure: convert HAVE_BROKEN_SIZE_MAX " Paolo Bonzini
2021-07-06 10:01 ` [PULL 27/40] configure: convert compiler tests to meson, part 1 Paolo Bonzini
2021-07-06 10:01 ` [PULL 28/40] configure: convert compiler tests to meson, part 2 Paolo Bonzini
2021-07-06 10:01 ` [PULL 29/40] configure: convert compiler tests to meson, part 3 Paolo Bonzini
2021-07-06 10:01 ` [PULL 30/40] configure: convert compiler tests to meson, part 4 Paolo Bonzini
2021-07-06 10:01 ` [PULL 31/40] configure: convert compiler tests to meson, part 5 Paolo Bonzini
2021-07-06 10:01 ` [PULL 32/40] configure: convert compiler tests to meson, part 6 Paolo Bonzini
2021-07-06 10:01 ` [PULL 33/40] qom: export more functions for use with non-UserCreatable objects Paolo Bonzini
2021-07-06 10:01 ` [PULL 34/40] keyval: introduce keyval_merge Paolo Bonzini
2021-07-06 10:01 ` [PULL 35/40] keyval: introduce keyval_parse_into Paolo Bonzini
2021-07-06 10:01 ` [PULL 36/40] vl: switch -M parsing to keyval Paolo Bonzini
2021-07-08 16:31   ` Jason Andryuk
2021-07-08 16:31     ` Jason Andryuk
2021-07-13  2:15     ` [PATCH] vl: Parse legacy default_machine_opts Jason Andryuk
2021-07-22 14:12       ` Anthony PERARD via
2021-07-22 14:12         ` Anthony PERARD
2021-07-22 14:39         ` Paolo Bonzini
2021-07-22 14:39           ` Paolo Bonzini
2021-07-12 19:24   ` [PULL 36/40] vl: switch -M parsing to keyval Volker Rümelin
2021-07-13 19:43   ` Alex Williamson
2021-07-13 23:10     ` Alex Williamson
2021-07-14  6:16       ` Mark Cave-Ayland [this message]
2021-07-14 22:13         ` Alex Williamson
2021-07-22  8:19   ` Peter Krempa
2021-07-22 14:39     ` Paolo Bonzini
2021-07-22 14:50       ` Peter Krempa
2021-07-06 10:01 ` [PULL 37/40] machine: add smp compound property Paolo Bonzini
2021-07-13 10:37   ` Peter Maydell
2021-07-13 11:07     ` Markus Armbruster
2021-07-13 10:53   ` Peter Maydell
2021-07-06 10:01 ` [PULL 38/40] qemu-option: remove now-dead code Paolo Bonzini
2021-07-06 10:01 ` [PULL 39/40] Set icon for QEMU binary on Mac OS Paolo Bonzini
2021-07-06 10:01 ` [PULL 40/40] config-host.mak: remove unused compiler-related lines Paolo Bonzini
2021-07-06 12:10 ` [PULL 00/40] Misc patches for 2021-07-06 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e95d601-9449-9331-46b1-5a1bb2f48735@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=alex.williamson@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.