#include "monitor/monitor.h"
#include "monitor/qdev.h"
#include "qapi/opts-visitor.h"
+#include "qapi/qmp/qerror.h"
#include "qapi/string-output-visitor.h"
#include "qapi-visit.h"
#include "ui/console.h"
Error *err = NULL;
if (!filename) {
- error_set(&err, QERR_MISSING_PARAMETER, "target");
+ error_setg(&err, QERR_MISSING_PARAMETER, "target");
hmp_handle_error(mon, &err);
return;
}
false, NULL, false, NULL,
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
true, mode, false, 0, false, 0, false, 0,
- false, 0, false, 0, &err);
+ false, 0, false, 0, false, true, &err);
hmp_handle_error(mon, &err);
}
Error *err = NULL;
if (!filename) {
- error_set(&err, QERR_MISSING_PARAMETER, "target");
+ error_setg(&err, QERR_MISSING_PARAMETER, "target");
hmp_handle_error(mon, &err);
return;
}
if (!filename) {
/* In the future, if 'snapshot-file' is not specified, the snapshot
will be taken internally. Today it's actually required. */
- error_set(&err, QERR_MISSING_PARAMETER, "snapshot-file");
+ error_setg(&err, QERR_MISSING_PARAMETER, "snapshot-file");
hmp_handle_error(mon, &err);
return;
}
}
if (i == MIGRATION_CAPABILITY_MAX) {
- error_set(&err, QERR_INVALID_PARAMETER, cap);
+ error_setg(&err, QERR_INVALID_PARAMETER, cap);
}
qapi_free_MigrationCapabilityStatusList(caps);
}
if (i == MIGRATION_PARAMETER_MAX) {
- error_set(&err, QERR_INVALID_PARAMETER, param);
+ error_setg(&err, QERR_INVALID_PARAMETER, param);
}
if (err) {
void hmp_device_add(Monitor *mon, const QDict *qdict)
{
- do_device_add(mon, qdict, NULL);
+ Error *err = NULL;
+
+ qmp_device_add((QDict *)qdict, NULL, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_device_del(Monitor *mon, const QDict *qdict)
Error *err = NULL;
QemuOpts *opts;
- opts = qemu_opts_parse(qemu_find_opts("chardev"), args, 1);
+ opts = qemu_opts_parse_noisily(qemu_find_opts("chardev"), args, true);
if (opts == NULL) {
error_setg(&err, "Parsing chardev args failed");
} else {
if (blk) {
qemuio_command(blk, command);
} else {
- error_set(&err, QERR_DEVICE_NOT_FOUND, device);
+ error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
+ "Device '%s' not found", device);
}
hmp_handle_error(mon, &err);
obj = object_resolve_path(path, &ambiguous);
if (obj == NULL) {
- error_set(&err, QERR_DEVICE_NOT_FOUND, path);
+ error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
+ "Device '%s' not found", path);
} else {
if (ambiguous) {
monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);