mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-08 00:24:59 +00:00
Merge remote-tracking branch 'qmp/for-anthony' into staging
This commit is contained in:
commit
9319a6d3a6
3
error.c
3
error.c
@ -9,11 +9,12 @@
|
|||||||
* This work is licensed under the terms of the GNU LGPL, version 2. See
|
* This work is licensed under the terms of the GNU LGPL, version 2. See
|
||||||
* the COPYING.LIB file in the top-level directory.
|
* the COPYING.LIB file in the top-level directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "qemu-common.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "error_int.h"
|
#include "error_int.h"
|
||||||
#include "qemu-objects.h"
|
#include "qemu-objects.h"
|
||||||
#include "qerror.h"
|
#include "qerror.h"
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
struct Error
|
struct Error
|
||||||
{
|
{
|
||||||
|
3
error.h
3
error.h
@ -25,8 +25,7 @@ typedef struct Error Error;
|
|||||||
* Currently, qerror.h defines these error formats. This function is not
|
* Currently, qerror.h defines these error formats. This function is not
|
||||||
* meant to be used outside of QEMU.
|
* meant to be used outside of QEMU.
|
||||||
*/
|
*/
|
||||||
void error_set(Error **err, const char *fmt, ...)
|
void error_set(Error **err, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
|
||||||
__attribute__((format(printf, 2, 3)));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if an indirect pointer to an error is pointing to a valid
|
* Returns true if an indirect pointer to an error is pointing to a valid
|
||||||
|
1
savevm.c
1
savevm.c
@ -2073,6 +2073,7 @@ int load_vmstate(const char *name)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemu_system_reset(VMRESET_SILENT);
|
||||||
ret = qemu_loadvm_state(f);
|
ret = qemu_loadvm_state(f);
|
||||||
|
|
||||||
qemu_fclose(f);
|
qemu_fclose(f);
|
||||||
|
5
sysemu.h
5
sysemu.h
@ -34,6 +34,9 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
|
|||||||
#define VMSTOP_LOADVM 7
|
#define VMSTOP_LOADVM 7
|
||||||
#define VMSTOP_MIGRATE 8
|
#define VMSTOP_MIGRATE 8
|
||||||
|
|
||||||
|
#define VMRESET_SILENT false
|
||||||
|
#define VMRESET_REPORT true
|
||||||
|
|
||||||
void vm_start(void);
|
void vm_start(void);
|
||||||
void vm_stop(int reason);
|
void vm_stop(int reason);
|
||||||
|
|
||||||
@ -50,7 +53,7 @@ int qemu_powerdown_requested(void);
|
|||||||
void qemu_system_killed(int signal, pid_t pid);
|
void qemu_system_killed(int signal, pid_t pid);
|
||||||
void qemu_kill_report(void);
|
void qemu_kill_report(void);
|
||||||
extern qemu_irq qemu_system_powerdown;
|
extern qemu_irq qemu_system_powerdown;
|
||||||
void qemu_system_reset(void);
|
void qemu_system_reset(bool report);
|
||||||
|
|
||||||
void qemu_add_exit_notifier(Notifier *notify);
|
void qemu_add_exit_notifier(Notifier *notify);
|
||||||
void qemu_remove_exit_notifier(Notifier *notify);
|
void qemu_remove_exit_notifier(Notifier *notify);
|
||||||
|
8
vl.c
8
vl.c
@ -1253,7 +1253,7 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qemu_system_reset(void)
|
void qemu_system_reset(bool report)
|
||||||
{
|
{
|
||||||
QEMUResetEntry *re, *nre;
|
QEMUResetEntry *re, *nre;
|
||||||
|
|
||||||
@ -1261,7 +1261,9 @@ void qemu_system_reset(void)
|
|||||||
QTAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) {
|
QTAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) {
|
||||||
re->func(re->opaque);
|
re->func(re->opaque);
|
||||||
}
|
}
|
||||||
|
if (report) {
|
||||||
monitor_protocol_event(QEVENT_RESET, NULL);
|
monitor_protocol_event(QEVENT_RESET, NULL);
|
||||||
|
}
|
||||||
cpu_synchronize_all_post_reset();
|
cpu_synchronize_all_post_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1403,7 +1405,7 @@ static void main_loop(void)
|
|||||||
if (qemu_reset_requested()) {
|
if (qemu_reset_requested()) {
|
||||||
pause_all_vcpus();
|
pause_all_vcpus();
|
||||||
cpu_synchronize_all_states();
|
cpu_synchronize_all_states();
|
||||||
qemu_system_reset();
|
qemu_system_reset(VMRESET_REPORT);
|
||||||
resume_all_vcpus();
|
resume_all_vcpus();
|
||||||
}
|
}
|
||||||
if (qemu_powerdown_requested()) {
|
if (qemu_powerdown_requested()) {
|
||||||
@ -3293,7 +3295,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
qemu_register_reset(qbus_reset_all_fn, sysbus_get_default());
|
qemu_register_reset(qbus_reset_all_fn, sysbus_get_default());
|
||||||
qemu_run_machine_init_done_notifiers();
|
qemu_run_machine_init_done_notifiers();
|
||||||
|
|
||||||
qemu_system_reset();
|
qemu_system_reset(VMRESET_SILENT);
|
||||||
if (loadvm) {
|
if (loadvm) {
|
||||||
if (load_vmstate(loadvm) < 0) {
|
if (load_vmstate(loadvm) < 0) {
|
||||||
autostart = 0;
|
autostart = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user