aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hmp.c b/hmp.c
index 081c12145c..e3ddd4654d 100644
--- a/hmp.c
+++ b/hmp.c
@@ -881,7 +881,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict)
Error *errp = NULL;
qmp_balloon(value, &errp);
- if (error_is_set(&errp)) {
+ if (errp) {
monitor_printf(mon, "balloon: %s\n", error_get_pretty(errp));
error_free(errp);
}
@@ -1118,7 +1118,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
}
qmp_change(device, target, !!arg, arg, &err);
- if (error_is_set(&err) &&
+ if (err &&
error_get_class(err) == ERROR_CLASS_DEVICE_ENCRYPTED) {
error_free(err);
monitor_read_block_device_key(mon, device, NULL, NULL);
@@ -1336,12 +1336,12 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict)
QemuOpts *opts;
opts = qemu_opts_from_qdict(qemu_find_opts("netdev"), qdict, &err);
- if (error_is_set(&err)) {
+ if (err) {
goto out;
}
netdev_add(opts, &err);
- if (error_is_set(&err)) {
+ if (err) {
qemu_opts_del(opts);
}