[PATCH v4 0/7] qemu-storage-daemon: Remove QemuOpts from --object

Markus Armbruster posted 7 patches 3 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201011073505.1185335-1-armbru@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
include/qemu/help_option.h           |  11 ++
include/qemu/option.h                |   2 +-
include/qom/object_interfaces.h      |  21 ++-
qapi/qobject-input-visitor.c         |   2 +-
qom/object_interfaces.c              |  99 ++++++++------
storage-daemon/qemu-storage-daemon.c |  15 +--
tests/test-keyval.c                  | 187 ++++++++++++++++++---------
util/keyval.c                        | 103 +++++++++++----
8 files changed, 297 insertions(+), 143 deletions(-)
[PATCH v4 0/7] qemu-storage-daemon: Remove QemuOpts from --object
Posted by Markus Armbruster 3 years, 6 months ago
This replaces the QemuOpts-based help code for --object in the storage
daemon with code based on the keyval parser.

Review of v3 led me to preexisting issues.  Instead of posting my
fixes separately, then working with Kevin to rebase his work on top of
mine, I did the rebase myself and am posting it together with my fixes
as v4.  Hope that's okay.

Note: to test qemu-storage-daemon --object help, you need Philippe's
"[PATCH v3] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE"
and its prerequisites (first 10 patches of Paolo's "[PULL 00/39] SCSI,
qdev, qtest, meson patches for 2020-10-10"), so it doesn't crash with
"missing interface 'fw_cfg-data-generator' for object 'tls-creds'".

v4:
- PATCH 1-3: New
- PATCH 4:
  * Rebased
  * Commit message typos [Eric]
  * Replace flawed is_help_option_n() by starts_with_help_option()
    [me]
  * Update grammar and accompanying prose [me]
  * Update keyval_parse_one()'s contract, tweak keyval_parse()'s [me]
  * Revert the keyval_parse_one() change to a rebased version of v1,
    because it's simpler and the edge case that led to the more
    complicated version no longer exists [me].
  * Rearrange tests so the simple cases come first
- PATCH 5-7: Unchanged

v3:
- Always parse help options, no matter if the caller implements help or
  not. If it doesn't, return an error. [Markus]
- Document changes to the keyval parser grammar [Markus]
- Support both 'help' and '?' [Eric]
- Test case fixes [Eric]
- Improved documentation of user_creatable_print_help(_from_qdict)
  [Markus]

v2:
- Fixed double comma by reusing the existing key and value parsers [Eric]
- More tests to cover the additional cases

Kevin Wolf (4):
  keyval: Parse help options
  qom: Factor out helpers from user_creatable_print_help()
  qom: Add user_creatable_print_help_from_qdict()
  qemu-storage-daemon: Remove QemuOpts from --object parser

Markus Armbruster (3):
  keyval: Fix and clarify grammar
  test-keyval: Demonstrate misparse of ',' with implied key
  keyval: Fix parsing of ',' in value of implied key

 include/qemu/help_option.h           |  11 ++
 include/qemu/option.h                |   2 +-
 include/qom/object_interfaces.h      |  21 ++-
 qapi/qobject-input-visitor.c         |   2 +-
 qom/object_interfaces.c              |  99 ++++++++------
 storage-daemon/qemu-storage-daemon.c |  15 +--
 tests/test-keyval.c                  | 187 ++++++++++++++++++---------
 util/keyval.c                        | 103 +++++++++++----
 8 files changed, 297 insertions(+), 143 deletions(-)

-- 
2.26.2


Re: [PATCH v4 0/7] qemu-storage-daemon: Remove QemuOpts from --object
Posted by Kevin Wolf 3 years, 6 months ago
Am 11.10.2020 um 09:34 hat Markus Armbruster geschrieben:
> This replaces the QemuOpts-based help code for --object in the storage
> daemon with code based on the keyval parser.
> 
> Review of v3 led me to preexisting issues.  Instead of posting my
> fixes separately, then working with Kevin to rebase his work on top of
> mine, I did the rebase myself and am posting it together with my fixes
> as v4.  Hope that's okay.
> 
> Note: to test qemu-storage-daemon --object help, you need Philippe's
> "[PATCH v3] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE"
> and its prerequisites (first 10 patches of Paolo's "[PULL 00/39] SCSI,
> qdev, qtest, meson patches for 2020-10-10"), so it doesn't crash with
> "missing interface 'fw_cfg-data-generator' for object 'tls-creds'".

Thanks, fixed up the typos in patch 4 and applied patches 1-4. I'm
taking patches 5-7 from my original series because you didn't add your
S-o-b (they are unchanged anyway, so no practical difference).

Kevin


Re: [PATCH v4 0/7] qemu-storage-daemon: Remove QemuOpts from --object
Posted by Markus Armbruster 3 years, 6 months ago
Kevin Wolf <kwolf@redhat.com> writes:

> Am 11.10.2020 um 09:34 hat Markus Armbruster geschrieben:
>> This replaces the QemuOpts-based help code for --object in the storage
>> daemon with code based on the keyval parser.
>> 
>> Review of v3 led me to preexisting issues.  Instead of posting my
>> fixes separately, then working with Kevin to rebase his work on top of
>> mine, I did the rebase myself and am posting it together with my fixes
>> as v4.  Hope that's okay.
>> 
>> Note: to test qemu-storage-daemon --object help, you need Philippe's
>> "[PATCH v3] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE"
>> and its prerequisites (first 10 patches of Paolo's "[PULL 00/39] SCSI,
>> qdev, qtest, meson patches for 2020-10-10"), so it doesn't crash with
>> "missing interface 'fw_cfg-data-generator' for object 'tls-creds'".
>
> Thanks, fixed up the typos in patch 4 and applied patches 1-4. I'm
> taking patches 5-7 from my original series because you didn't add your
> S-o-b (they are unchanged anyway, so no practical difference).

Makes sense.  I didn't feel like slapping my S-o-b on patches I reposted
unchanged.

Thanks!