Skip to content

Commit 8e8581e

Browse files
committed
hmp: add exit_preconfig
Add the exit_preconfig command to return to normality. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20180620153947.30834-7-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1 parent 8c7c7ec commit 8e8581e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

hmp-commands.hx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ STEXI
5555
@item q or quit
5656
@findex quit
5757
Quit the emulator.
58+
ETEXI
59+
60+
{
61+
.name = "exit_preconfig",
62+
.args_type = "",
63+
.params = "",
64+
.help = "exit the preconfig state",
65+
.cmd = hmp_exit_preconfig,
66+
.flags = "p",
67+
},
68+
69+
STEXI
70+
@item exit_preconfig
71+
@findex exit_preconfig
72+
This command makes QEMU exit the preconfig state and proceed with
73+
VM initialization using configuration data provided on the command line
74+
and via the QMP monitor during the preconfig state. The command is only
75+
available during the preconfig state (i.e. when the --preconfig command
76+
line option was in use).
5877
ETEXI
5978

6079
{

hmp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,14 @@ void hmp_system_powerdown(Monitor *mon, const QDict *qdict)
10681068
qmp_system_powerdown(NULL);
10691069
}
10701070

1071+
void hmp_exit_preconfig(Monitor *mon, const QDict *qdict)
1072+
{
1073+
Error *err = NULL;
1074+
1075+
qmp_exit_preconfig(&err);
1076+
hmp_handle_error(mon, &err);
1077+
}
1078+
10711079
void hmp_cpu(Monitor *mon, const QDict *qdict)
10721080
{
10731081
int64_t cpu_index;

hmp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void hmp_quit(Monitor *mon, const QDict *qdict);
4444
void hmp_stop(Monitor *mon, const QDict *qdict);
4545
void hmp_system_reset(Monitor *mon, const QDict *qdict);
4646
void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
47+
void hmp_exit_preconfig(Monitor *mon, const QDict *qdict);
4748
void hmp_cpu(Monitor *mon, const QDict *qdict);
4849
void hmp_memsave(Monitor *mon, const QDict *qdict);
4950
void hmp_pmemsave(Monitor *mon, const QDict *qdict);

0 commit comments

Comments
 (0)