Browse Source

hmp: delvm: use hmp_handle_error

This gives us the consistent 'Error:' prefix added in 66363e9a43,
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: <984634226f.1556141033.git.crobinso@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
master
Cole Robinson 2 months ago
parent
commit
b4e492db03
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      hmp.c

+ 4
- 3
hmp.c View File

@@ -1480,10 +1480,11 @@ void hmp_delvm(Monitor *mon, const QDict *qdict)
1480 1480
     const char *name = qdict_get_str(qdict, "name");
1481 1481
 
1482 1482
     if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) {
1483
-        error_reportf_err(err,
1484
-                          "Error while deleting snapshot on device '%s': ",
1485
-                          bdrv_get_device_name(bs));
1483
+        error_prepend(&err,
1484
+                      "deleting snapshot on device '%s': ",
1485
+                      bdrv_get_device_name(bs));
1486 1486
     }
1487
+    hmp_handle_error(mon, &err);
1487 1488
 }
1488 1489
 
1489 1490
 void hmp_info_snapshots(Monitor *mon, const QDict *qdict)

Loading…
Cancel
Save