Skip to content

Commit 48f596c

Browse files
bonzinijasowang
authored andcommitted
netdev: add more commands to preconfig mode
Creating and destroying network backend does not require a fully constructed machine. Allow the related monitor commands to run before machine initialization has concluded. Signed-off-by: Paolo Bonzini <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Signed-off-by: Jason Wang <[email protected]>
1 parent 1b03117 commit 48f596c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

hmp-commands.hx

+2
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,7 @@ ERST
12691269
.help = "add host network device",
12701270
.cmd = hmp_netdev_add,
12711271
.command_completion = netdev_add_completion,
1272+
.flags = "p",
12721273
},
12731274

12741275
SRST
@@ -1283,6 +1284,7 @@ ERST
12831284
.help = "remove host network device",
12841285
.cmd = hmp_netdev_del,
12851286
.command_completion = netdev_del_completion,
1287+
.flags = "p",
12861288
},
12871289

12881290
SRST

qapi/net.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
# <- { "return": {} }
5656
#
5757
##
58-
{ 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true }
58+
{ 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true,
59+
'allow-preconfig': true }
5960

6061
##
6162
# @netdev_del:
@@ -75,7 +76,8 @@
7576
# <- { "return": {} }
7677
#
7778
##
78-
{ 'command': 'netdev_del', 'data': {'id': 'str'} }
79+
{ 'command': 'netdev_del', 'data': {'id': 'str'},
80+
'allow-preconfig': true }
7981

8082
##
8183
# @NetLegacyNicOptions:

0 commit comments

Comments
 (0)