]> Git Repo - qemu.git/commitdiff
blockdev: Use error_report() in hmp_commit()
authorKevin Wolf <[email protected]>
Mon, 27 May 2019 16:01:41 +0000 (18:01 +0200)
committerKevin Wolf <[email protected]>
Fri, 25 Oct 2019 13:15:01 +0000 (15:15 +0200)
Instead of using monitor_printf() to report errors, hmp_commit() should
use error_report() like other places do.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
blockdev.c

index 03c7cd76517b77257abd5756d2053dcc917c6cbb..ba491e3ef5a375c365e792c261979642876acb40 100644 (file)
@@ -1088,11 +1088,11 @@ void hmp_commit(Monitor *mon, const QDict *qdict)
 
         blk = blk_by_name(device);
         if (!blk) {
-            monitor_printf(mon, "Device '%s' not found\n", device);
+            error_report("Device '%s' not found", device);
             return;
         }
         if (!blk_is_available(blk)) {
-            monitor_printf(mon, "Device '%s' has no medium\n", device);
+            error_report("Device '%s' has no medium", device);
             return;
         }
 
@@ -1105,8 +1105,7 @@ void hmp_commit(Monitor *mon, const QDict *qdict)
         aio_context_release(aio_context);
     }
     if (ret < 0) {
-        monitor_printf(mon, "'commit' error for '%s': %s\n", device,
-                       strerror(-ret));
+        error_report("'commit' error for '%s': %s", device, strerror(-ret));
     }
 }
 
This page took 0.051163 seconds and 4 git commands to generate.