#include "monitor/qdev.h"
#include "qapi/opts-visitor.h"
#include "qapi/qmp/qerror.h"
+#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
#include "qapi/util.h"
#include "qapi-visit.h"
#include "qom/object_interfaces.h"
#include "ui/console.h"
+#include "block/nbd.h"
#include "block/qapi.h"
#include "qemu-io.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
+#include "exec/ramlist.h"
#include "hw/intc/intc.h"
#ifdef CONFIG_SPICE
monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY],
params->x_checkpoint_delay);
+ assert(params->has_block_incremental);
+ monitor_printf(mon, "%s: %s\n",
+ MigrationParameter_lookup[MIGRATION_PARAMETER_BLOCK_INCREMENTAL],
+ params->block_incremental ? "on" : "off");
}
qapi_free_MigrationParameters(params);
{
int saved_vm_running = runstate_is_running();
const char *name = qdict_get_str(qdict, "name");
+ Error *err = NULL;
vm_stop(RUN_STATE_RESTORE_VM);
- if (load_vmstate(name) == 0 && saved_vm_running) {
+ if (load_vmstate(name, &err) == 0 && saved_vm_running) {
vm_start();
}
+ hmp_handle_error(mon, &err);
}
void hmp_savevm(Monitor *mon, const QDict *qdict)
{
- save_vmstate(qdict_get_try_str(qdict, "name"));
+ Error *err = NULL;
+
+ save_vmstate(qdict_get_try_str(qdict, "name"), &err);
+ hmp_handle_error(mon, &err);
}
void hmp_delvm(Monitor *mon, const QDict *qdict)
{
const char *param = qdict_get_str(qdict, "parameter");
const char *valuestr = qdict_get_str(qdict, "value");
+ Visitor *v = string_input_visitor_new(valuestr);
uint64_t valuebw = 0;
- long valueint = 0;
+ int64_t valueint = 0;
+ bool valuebool = false;
Error *err = NULL;
bool use_int_value = false;
int i, ret;
p.has_x_checkpoint_delay = true;
use_int_value = true;
break;
+ case MIGRATION_PARAMETER_BLOCK_INCREMENTAL:
+ p.has_block_incremental = true;
+ visit_type_bool(v, param, &valuebool, &err);
+ if (err) {
+ goto cleanup;
+ }
+ p.block_incremental = valuebool;
+ break;
}
if (use_int_value) {
- if (qemu_strtol(valuestr, NULL, 10, &valueint) < 0) {
- error_setg(&err, "Unable to parse '%s' as an int",
- valuestr);
+ visit_type_int(v, param, &valueint, &err);
+ if (err) {
goto cleanup;
}
/* Set all integers; only one has_FOO will be set, and
}
cleanup:
+ visit_free(v);
if (err) {
error_report_err(err);
}
bool all = qdict_get_try_bool(qdict, "all", false);
Error *local_err = NULL;
BlockInfoList *block_list, *info;
- SocketAddressLegacy *addr;
+ SocketAddress *addr;
if (writable && !all) {
error_setg(&local_err, "-w only valid together with -a");
goto exit;
}
- qmp_nbd_server_start(addr, false, NULL, &local_err);
- qapi_free_SocketAddressLegacy(addr);
+ nbd_server_start(addr, NULL, &local_err);
+ qapi_free_SocketAddress(addr);
if (local_err != NULL) {
goto exit;
}
qapi_free_DumpQueryResult(result);
}
+void hmp_info_ramblock(Monitor *mon, const QDict *qdict)
+{
+ ram_block_dump(mon);
+}
+
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;