[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for op
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists |
Date: |
Wed, 23 Jun 2010 19:08:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Jan Kiszka <address@hidden> writes:
> Markus Armbruster wrote:
>> Jan Kiszka <address@hidden> writes:
>>
>>> From: Jan Kiszka <address@hidden>
>>>
>>> This enables command line completion inside option strings. A list of
>>> expected key names and their completion type can be appended to the 'O'
>>> inside parentheses ('O(key:type,...)'). The first use case is block
>>> device completion for the 'drive' option of 'device_add'.
>>>
>>> Signed-off-by: Jan Kiszka <address@hidden>
>>> ---
>>> monitor.c | 68
>>> ++++++++++++++++++++++++++++++++++++++++++++++---------
>>> qemu-monitor.hx | 2 +-
>>> 2 files changed, 58 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/monitor.c b/monitor.c
>>> index c1006b4..3e0d862 100644
>>> --- a/monitor.c
>>> +++ b/monitor.c
>>> @@ -68,6 +68,9 @@
>>> * 'O' option string of the form NAME=VALUE,...
>>> * parsed according to QemuOptsList given by its name
>>> * Example: 'device:O' uses qemu_device_opts.
>>> + * Command completion for specific keys can be requested via
>>> + * appending '(NAME:TYPE,...)' with 'F', 'B' as type.
>>> + * Example: 'device:O(bus:Q)' to expand 'bus=...' as qtree
>>> path.
>>> * Restriction: only lists with empty desc are supported
>>> * TODO lift the restriction
>>> * 'i' 32 bit integer
>>
>> Ugh.
>>
>> Replacement of args_type by a proper data structure is long overdue. We
>> keep piling features into that poor, hapless string.
>>
>> Information on how to complete QemuOptsList options arguably belongs
>> into the option description, i.e. QemuOptDesc.
>
> For sure, that would be better. I just wonder how much of it should be
> stuffed into this series. I guess I will drop this part for now, just
> focusing on what device_show makes direct use of. Same for separate args
> for HMP and QMP.
Sensible.
Speaking of args_type. We've accumulated too many ways to represent
dynamic data types, and too many ways to describe data types.
The most powerful dynamic data type is QObject. It comes with a useful
plain-text representation (JSON). We lack a data type for describing
QObjects. We use args_type to describe special QObjects, namely monitor
command arguments. We've clearly stretched that to the limit and then
some. We could use a general solution. JSON Schema as its plain-text
representation could be nice.
Then we have QemuOpts. It's more limited (flat list instead of trees),
but it comes with a real data type to describe it (QemuOptsList).
There's also QEMUOptionParameter. Serves a similar purpose. I don't
know why we have both.
Over in qdev-land, we find Property, which can be viewed a data type to
describe (parts of) a struct.
Some unification would be nice.
- Re: [Qemu-devel] [PATCH v4 08/23] qdev: Introduce qdev_iterate_recursive, (continued)
- [Qemu-devel] [PATCH v4 07/23] qdev: Allow device specification by qtree path for device_del, Jan Kiszka, 2010/06/15
- [Qemu-devel] [PATCH v4 09/23] monitor: Fix leakage during completion processing, Jan Kiszka, 2010/06/15
- [Qemu-devel] [PATCH v4 10/23] monitor: Fix command completion vs. boolean switches, Jan Kiszka, 2010/06/15
- [Qemu-devel] [PATCH v4 13/23] monitor: Allow to specify HMP-specifc command arguments, Jan Kiszka, 2010/06/15
- [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists, Jan Kiszka, 2010/06/15
- Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists, Markus Armbruster, 2010/06/23
- Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists, Jan Kiszka, 2010/06/23
- Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists, Luiz Capitulino, 2010/06/28
- Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists, Jan Kiszka, 2010/06/28
- Re: [Qemu-devel] [PATCH v4 11/23] monitor: Add completion support for option lists, Luiz Capitulino, 2010/06/28
- [Qemu-devel] [PATCH] monitor: Allow to exclude commands from QMP, Jan Kiszka, 2010/06/28
[Qemu-devel] [PATCH v4 15/23] monitor: Establish cmd flags and convert the async tag, Jan Kiszka, 2010/06/15
[Qemu-devel] [PATCH v4 16/23] monitor: Allow to exclude commands from QMP, Jan Kiszka, 2010/06/15
[Qemu-devel] [PATCH v4 14/23] monitor: return length of printed string via monitor_[v]printf, Jan Kiszka, 2010/06/15
[Qemu-devel] [PATCH v4 17/23] Add base64 encoder/decoder, Jan Kiszka, 2010/06/15
[Qemu-devel] [PATCH v4 21/23] QMP: Teach basic capability negotiation to python example, Jan Kiszka, 2010/06/15