aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-05-02 13:26:29 +0200
committerLuiz Capitulino <lcapitulino@redhat.com>2014-05-08 14:20:00 -0400
commite940f543ae7606819c9083fdb524e5b85914f032 (patch)
tree41a016f0ee62766627165bd1563b7994c723ec9a /hmp.c
parent636713bad4240836947c04c26e1cd001d3bcbff1 (diff)
qmp hmp: Consistently name Error * objects err, and not errp
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c138
1 files changed, 69 insertions, 69 deletions
diff --git a/hmp.c b/hmp.c
index 903e0a1dd7..9469163913 100644
--- a/hmp.c
+++ b/hmp.c
@@ -754,10 +754,10 @@ void hmp_memsave(Monitor *mon, const QDict *qdict)
uint32_t size = qdict_get_int(qdict, "size");
const char *filename = qdict_get_str(qdict, "filename");
uint64_t addr = qdict_get_int(qdict, "val");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_memsave(addr, size, filename, true, monitor_get_cpu_index(), &errp);
- hmp_handle_error(mon, &errp);
+ qmp_memsave(addr, size, filename, true, monitor_get_cpu_index(), &err);
+ hmp_handle_error(mon, &err);
}
void hmp_pmemsave(Monitor *mon, const QDict *qdict)
@@ -765,21 +765,21 @@ void hmp_pmemsave(Monitor *mon, const QDict *qdict)
uint32_t size = qdict_get_int(qdict, "size");
const char *filename = qdict_get_str(qdict, "filename");
uint64_t addr = qdict_get_int(qdict, "val");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_pmemsave(addr, size, filename, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_pmemsave(addr, size, filename, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_ringbuf_write(Monitor *mon, const QDict *qdict)
{
const char *chardev = qdict_get_str(qdict, "device");
const char *data = qdict_get_str(qdict, "data");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_ringbuf_write(chardev, data, false, 0, &errp);
+ qmp_ringbuf_write(chardev, data, false, 0, &err);
- hmp_handle_error(mon, &errp);
+ hmp_handle_error(mon, &err);
}
void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
@@ -787,13 +787,13 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
uint32_t size = qdict_get_int(qdict, "size");
const char *chardev = qdict_get_str(qdict, "device");
char *data;
- Error *errp = NULL;
+ Error *err = NULL;
int i;
- data = qmp_ringbuf_read(chardev, size, false, 0, &errp);
- if (errp) {
- monitor_printf(mon, "%s\n", error_get_pretty(errp));
- error_free(errp);
+ data = qmp_ringbuf_read(chardev, size, false, 0, &err);
+ if (err) {
+ monitor_printf(mon, "%s\n", error_get_pretty(err));
+ error_free(err);
return;
}
@@ -828,7 +828,7 @@ static bool key_is_missing(const BlockInfo *bdev)
void hmp_cont(Monitor *mon, const QDict *qdict)
{
BlockInfoList *bdev_list, *bdev;
- Error *errp = NULL;
+ Error *err = NULL;
bdev_list = qmp_query_block(NULL);
for (bdev = bdev_list; bdev; bdev = bdev->next) {
@@ -839,8 +839,8 @@ void hmp_cont(Monitor *mon, const QDict *qdict)
}
}
- qmp_cont(&errp);
- hmp_handle_error(mon, &errp);
+ qmp_cont(&err);
+ hmp_handle_error(mon, &err);
out:
qapi_free_BlockInfoList(bdev_list);
@@ -853,41 +853,41 @@ void hmp_system_wakeup(Monitor *mon, const QDict *qdict)
void hmp_inject_nmi(Monitor *mon, const QDict *qdict)
{
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_inject_nmi(&errp);
- hmp_handle_error(mon, &errp);
+ qmp_inject_nmi(&err);
+ hmp_handle_error(mon, &err);
}
void hmp_set_link(Monitor *mon, const QDict *qdict)
{
const char *name = qdict_get_str(qdict, "name");
int up = qdict_get_bool(qdict, "up");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_set_link(name, up, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_set_link(name, up, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_block_passwd(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_str(qdict, "device");
const char *password = qdict_get_str(qdict, "password");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_block_passwd(true, device, false, NULL, password, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_block_passwd(true, device, false, NULL, password, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_balloon(Monitor *mon, const QDict *qdict)
{
int64_t value = qdict_get_int(qdict, "value");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_balloon(value, &errp);
- if (errp) {
- monitor_printf(mon, "balloon: %s\n", error_get_pretty(errp));
- error_free(errp);
+ qmp_balloon(value, &err);
+ if (err) {
+ monitor_printf(mon, "balloon: %s\n", error_get_pretty(err));
+ error_free(err);
}
}
@@ -895,10 +895,10 @@ void hmp_block_resize(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_str(qdict, "device");
int64_t size = qdict_get_int(qdict, "size");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_block_resize(true, device, false, NULL, size, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_block_resize(true, device, false, NULL, size, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
@@ -909,11 +909,11 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
int reuse = qdict_get_try_bool(qdict, "reuse", 0);
int full = qdict_get_try_bool(qdict, "full", 0);
enum NewImageMode mode;
- Error *errp = NULL;
+ Error *err = NULL;
if (!filename) {
- error_set(&errp, QERR_MISSING_PARAMETER, "target");
- hmp_handle_error(mon, &errp);
+ error_set(&err, QERR_MISSING_PARAMETER, "target");
+ hmp_handle_error(mon, &err);
return;
}
@@ -926,8 +926,8 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
qmp_drive_mirror(device, filename, !!format, format,
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
true, mode, false, 0, false, 0, false, 0,
- false, 0, false, 0, &errp);
- hmp_handle_error(mon, &errp);
+ false, 0, false, 0, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_drive_backup(Monitor *mon, const QDict *qdict)
@@ -938,11 +938,11 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
int reuse = qdict_get_try_bool(qdict, "reuse", 0);
int full = qdict_get_try_bool(qdict, "full", 0);
enum NewImageMode mode;
- Error *errp = NULL;
+ Error *err = NULL;
if (!filename) {
- error_set(&errp, QERR_MISSING_PARAMETER, "target");
- hmp_handle_error(mon, &errp);
+ error_set(&err, QERR_MISSING_PARAMETER, "target");
+ hmp_handle_error(mon, &err);
return;
}
@@ -954,8 +954,8 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
qmp_drive_backup(device, filename, !!format, format,
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
- true, mode, false, 0, false, 0, false, 0, &errp);
- hmp_handle_error(mon, &errp);
+ true, mode, false, 0, false, 0, false, 0, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
@@ -965,13 +965,13 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
const char *format = qdict_get_try_str(qdict, "format");
int reuse = qdict_get_try_bool(qdict, "reuse", 0);
enum NewImageMode mode;
- Error *errp = NULL;
+ Error *err = NULL;
if (!filename) {
/* In the future, if 'snapshot-file' is not specified, the snapshot
will be taken internally. Today it's actually required. */
- error_set(&errp, QERR_MISSING_PARAMETER, "snapshot-file");
- hmp_handle_error(mon, &errp);
+ error_set(&err, QERR_MISSING_PARAMETER, "snapshot-file");
+ hmp_handle_error(mon, &err);
return;
}
@@ -979,18 +979,18 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
qmp_blockdev_snapshot_sync(true, device, false, NULL,
filename, false, NULL,
!!format, format,
- true, mode, &errp);
- hmp_handle_error(mon, &errp);
+ true, mode, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_snapshot_blkdev_internal(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_str(qdict, "device");
const char *name = qdict_get_str(qdict, "name");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_blockdev_snapshot_internal_sync(device, name, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_blockdev_snapshot_internal_sync(device, name, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_snapshot_delete_blkdev_internal(Monitor *mon, const QDict *qdict)
@@ -998,11 +998,11 @@ void hmp_snapshot_delete_blkdev_internal(Monitor *mon, const QDict *qdict)
const char *device = qdict_get_str(qdict, "device");
const char *name = qdict_get_str(qdict, "name");
const char *id = qdict_get_try_str(qdict, "id");
- Error *errp = NULL;
+ Error *err = NULL;
qmp_blockdev_snapshot_delete_internal_sync(device, !!id, id,
- true, name, &errp);
- hmp_handle_error(mon, &errp);
+ true, name, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
@@ -1310,7 +1310,7 @@ void hmp_device_del(Monitor *mon, const QDict *qdict)
void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
{
- Error *errp = NULL;
+ Error *err = NULL;
int paging = qdict_get_try_bool(qdict, "paging", 0);
int zlib = qdict_get_try_bool(qdict, "zlib", 0);
int lzo = qdict_get_try_bool(qdict, "lzo", 0);
@@ -1324,8 +1324,8 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
char *prot;
if (zlib + lzo + snappy > 1) {
- error_setg(&errp, "only one of '-z|-l|-s' can be set");
- hmp_handle_error(mon, &errp);
+ error_setg(&err, "only one of '-z|-l|-s' can be set");
+ hmp_handle_error(mon, &err);
return;
}
@@ -1351,8 +1351,8 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
prot = g_strconcat("file:", file, NULL);
qmp_dump_guest_memory(paging, prot, has_begin, begin, has_length, length,
- true, dump_format, &errp);
- hmp_handle_error(mon, &errp);
+ true, dump_format, &err);
+ hmp_handle_error(mon, &err);
g_free(prot);
}
@@ -1444,19 +1444,19 @@ out:
void hmp_getfd(Monitor *mon, const QDict *qdict)
{
const char *fdname = qdict_get_str(qdict, "fdname");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_getfd(fdname, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_getfd(fdname, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_closefd(Monitor *mon, const QDict *qdict)
{
const char *fdname = qdict_get_str(qdict, "fdname");
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_closefd(fdname, &errp);
- hmp_handle_error(mon, &errp);
+ qmp_closefd(fdname, &err);
+ hmp_handle_error(mon, &err);
}
void hmp_send_key(Monitor *mon, const QDict *qdict)
@@ -1606,10 +1606,10 @@ void hmp_nbd_server_add(Monitor *mon, const QDict *qdict)
void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict)
{
- Error *errp = NULL;
+ Error *err = NULL;
- qmp_nbd_server_stop(&errp);
- hmp_handle_error(mon, &errp);
+ qmp_nbd_server_stop(&err);
+ hmp_handle_error(mon, &err);
}
void hmp_cpu_add(Monitor *mon, const QDict *qdict)