aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-04-24 17:49:08 -0400
committerDr. David Alan Gilbert <dgilbert@redhat.com>2019-05-01 10:40:32 +0100
commitb4e492db03a25395087e867f8f944f7b2a2e1cef (patch)
tree26bf6cd3ac9f25c2857c24ffc24855b6e7861027
parentf75d15231e56cb0f2bafe19faf1229c459a60731 (diff)
hmp: delvm: use hmp_handle_error
This gives us the consistent 'Error:' prefix added in 66363e9a43f, which helps users like libvirt who still need to scrape hmp error messages to detect failure. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com> Message-Id: <984634226fa14316641f31f84e7dd0bb770bd94c.1556141033.git.crobinso@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
-rw-r--r--hmp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hmp.c b/hmp.c
index 4bb3af748e..56a3ed7375 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1480,10 +1480,11 @@ void hmp_delvm(Monitor *mon, const QDict *qdict)
const char *name = qdict_get_str(qdict, "name");
if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) {
- error_reportf_err(err,
- "Error while deleting snapshot on device '%s': ",
- bdrv_get_device_name(bs));
+ error_prepend(&err,
+ "deleting snapshot on device '%s': ",
+ bdrv_get_device_name(bs));
}
+ hmp_handle_error(mon, &err);
}
void hmp_info_snapshots(Monitor *mon, const QDict *qdict)