object: add more commands to preconfig mode

Creating and destroying QOM objects does not require a fully constructed
machine.  Allow running object-add and object-del before machine
initialization has concluded.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-11-03 04:39:02 -05:00
parent c1826ea6a0
commit 9e33013bd4
2 changed files with 6 additions and 2 deletions

View File

@ -1297,6 +1297,7 @@ ERST
.help = "create QOM object",
.cmd = hmp_object_add,
.command_completion = object_add_completion,
.flags = "p",
},
SRST
@ -1311,6 +1312,7 @@ ERST
.help = "destroy QOM object",
.cmd = hmp_object_del,
.command_completion = object_del_completion,
.flags = "p",
},
SRST

View File

@ -857,7 +857,8 @@
# <- { "return": {} }
#
##
{ 'command': 'object-add', 'data': 'ObjectOptions', 'boxed': true }
{ 'command': 'object-add', 'data': 'ObjectOptions', 'boxed': true,
'allow-preconfig': true }
##
# @object-del:
@ -877,4 +878,5 @@
# <- { "return": {} }
#
##
{ 'command': 'object-del', 'data': {'id': 'str'} }
{ 'command': 'object-del', 'data': {'id': 'str'},
'allow-preconfig': true }