+##
+# @YankInstances:
+#
+# @instances: List of yank instances.
+#
+# Yank instances are named after the following schema:
+# "blockdev:<node-name>", "chardev:<chardev-name>" and "migration"
+#
+# Since: 5.1
+##
+{ 'struct': 'YankInstances', 'data': {'instances': ['str'] } }
I'm afraid this is a problematic QMP interface.
By making YankInstances a struct, you keep the door open to adding more
members, which is good.
But by making its 'instances' member a ['str'], you close the door to
using anything but a single string for the individual instances. Not so
good.
The single string encodes information which QMP client will need to
parse from the string. We frown on that in QMP. Use QAPI complex types
capabilities for structured data.
Could you use something like this instead?
{ 'enum': 'YankInstanceType',
'data': { 'block-node', 'chardev', 'migration' } }
{ 'struct': 'YankInstanceBlockNode',
'data': { 'node-name': 'str' } }
{ 'struct': 'YankInstanceChardev',
'data' { 'label': 'str' } }
{ 'union': 'YankInstance',
'base': { 'type': 'YankInstanceType' },
'discriminator': 'type',
'data': {
'block-node': 'YankInstanceBlockNode',
'chardev': 'YankInstanceChardev' } }
{ 'command': 'yank',
'data': { 'instances': ['YankInstance'] },
'allow-oob': true }