monitor: Remove monitor parameter from save_vmstate
load_vmstate() already use error_report, so be consistent. There is an identical error message in load_vmstate() that ends in a period. Remove it. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
fd4144d413
commit
c34c2f3701
@ -76,7 +76,7 @@ void qemu_add_machine_init_done_notifier(Notifier *notify);
|
|||||||
void qemu_remove_machine_init_done_notifier(Notifier *notify);
|
void qemu_remove_machine_init_done_notifier(Notifier *notify);
|
||||||
|
|
||||||
void hmp_savevm(Monitor *mon, const QDict *qdict);
|
void hmp_savevm(Monitor *mon, const QDict *qdict);
|
||||||
int save_vmstate(Monitor *mon, const char *name);
|
int save_vmstate(const char *name);
|
||||||
int load_vmstate(const char *name);
|
int load_vmstate(const char *name);
|
||||||
void hmp_delvm(Monitor *mon, const QDict *qdict);
|
void hmp_delvm(Monitor *mon, const QDict *qdict);
|
||||||
void hmp_info_snapshots(Monitor *mon, const QDict *qdict);
|
void hmp_info_snapshots(Monitor *mon, const QDict *qdict);
|
||||||
|
@ -2070,7 +2070,7 @@ int qemu_loadvm_state(QEMUFile *f)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int save_vmstate(Monitor *mon, const char *name)
|
int save_vmstate(const char *name)
|
||||||
{
|
{
|
||||||
BlockDriverState *bs, *bs1;
|
BlockDriverState *bs, *bs1;
|
||||||
QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
|
QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
|
||||||
@ -2084,8 +2084,8 @@ int save_vmstate(Monitor *mon, const char *name)
|
|||||||
AioContext *aio_context;
|
AioContext *aio_context;
|
||||||
|
|
||||||
if (!bdrv_all_can_snapshot(&bs)) {
|
if (!bdrv_all_can_snapshot(&bs)) {
|
||||||
monitor_printf(mon, "Device '%s' is writable but does not "
|
error_report("Device '%s' is writable but does not support snapshots",
|
||||||
"support snapshots.\n", bdrv_get_device_name(bs));
|
bdrv_get_device_name(bs));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2102,7 +2102,7 @@ int save_vmstate(Monitor *mon, const char *name)
|
|||||||
|
|
||||||
bs = bdrv_all_find_vmstate_bs();
|
bs = bdrv_all_find_vmstate_bs();
|
||||||
if (bs == NULL) {
|
if (bs == NULL) {
|
||||||
monitor_printf(mon, "No block device can accept snapshots\n");
|
error_report("No block device can accept snapshots");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
aio_context = bdrv_get_aio_context(bs);
|
aio_context = bdrv_get_aio_context(bs);
|
||||||
@ -2111,7 +2111,7 @@ int save_vmstate(Monitor *mon, const char *name)
|
|||||||
|
|
||||||
ret = global_state_store();
|
ret = global_state_store();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
monitor_printf(mon, "Error saving global state\n");
|
error_report("Error saving global state");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
vm_stop(RUN_STATE_SAVE_VM);
|
vm_stop(RUN_STATE_SAVE_VM);
|
||||||
@ -2143,7 +2143,7 @@ int save_vmstate(Monitor *mon, const char *name)
|
|||||||
/* save the VM state */
|
/* save the VM state */
|
||||||
f = qemu_fopen_bdrv(bs, 1);
|
f = qemu_fopen_bdrv(bs, 1);
|
||||||
if (!f) {
|
if (!f) {
|
||||||
monitor_printf(mon, "Could not open VM state file\n");
|
error_report("Could not open VM state file");
|
||||||
goto the_end;
|
goto the_end;
|
||||||
}
|
}
|
||||||
ret = qemu_savevm_state(f, &local_err);
|
ret = qemu_savevm_state(f, &local_err);
|
||||||
@ -2156,8 +2156,8 @@ int save_vmstate(Monitor *mon, const char *name)
|
|||||||
|
|
||||||
ret = bdrv_all_create_snapshot(sn, bs, vm_state_size, &bs);
|
ret = bdrv_all_create_snapshot(sn, bs, vm_state_size, &bs);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
monitor_printf(mon, "Error while creating snapshot on '%s'\n",
|
error_report("Error while creating snapshot on '%s'",
|
||||||
bdrv_get_device_name(bs));
|
bdrv_get_device_name(bs));
|
||||||
goto the_end;
|
goto the_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2173,7 +2173,7 @@ int save_vmstate(Monitor *mon, const char *name)
|
|||||||
|
|
||||||
void hmp_savevm(Monitor *mon, const QDict *qdict)
|
void hmp_savevm(Monitor *mon, const QDict *qdict)
|
||||||
{
|
{
|
||||||
save_vmstate(mon, qdict_get_try_str(qdict, "name"));
|
save_vmstate(qdict_get_try_str(qdict, "name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_xen_save_devices_state(const char *filename, Error **errp)
|
void qmp_xen_save_devices_state(const char *filename, Error **errp)
|
||||||
@ -2245,7 +2245,7 @@ int load_vmstate(const char *name)
|
|||||||
MigrationIncomingState *mis = migration_incoming_get_current();
|
MigrationIncomingState *mis = migration_incoming_get_current();
|
||||||
|
|
||||||
if (!bdrv_all_can_snapshot(&bs)) {
|
if (!bdrv_all_can_snapshot(&bs)) {
|
||||||
error_report("Device '%s' is writable but does not support snapshots.",
|
error_report("Device '%s' is writable but does not support snapshots",
|
||||||
bdrv_get_device_name(bs));
|
bdrv_get_device_name(bs));
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ void replay_vmstate_init(void)
|
|||||||
{
|
{
|
||||||
if (replay_snapshot) {
|
if (replay_snapshot) {
|
||||||
if (replay_mode == REPLAY_MODE_RECORD) {
|
if (replay_mode == REPLAY_MODE_RECORD) {
|
||||||
if (save_vmstate(cur_mon, replay_snapshot) != 0) {
|
if (save_vmstate(replay_snapshot) != 0) {
|
||||||
error_report("Could not create snapshot for icount record");
|
error_report("Could not create snapshot for icount record");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user