]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hmp: Remove dead code in hmp_qemu_io()
authorKevin Wolf <kwolf@redhat.com>
Thu, 15 Sep 2016 15:44:16 +0000 (17:44 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Sep 2016 11:36:09 +0000 (13:36 +0200)
blk can never be NULL, drop the check. This fixes a Coverity warning.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
hmp.c

diff --git a/hmp.c b/hmp.c
index ad33b442d2b600a9406f952a3412a4b578ef1794..0a16aefc2ac12d06037953de4a2e61d46ca0f173 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1924,6 +1924,7 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
 {
     BlockBackend *blk;
     BlockBackend *local_blk = NULL;
+    AioContext *aio_context;
     const char* device = qdict_get_str(qdict, "device");
     const char* command = qdict_get_str(qdict, "command");
     Error *err = NULL;
@@ -1939,17 +1940,12 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
         }
     }
 
-    if (blk) {
-        AioContext *aio_context = blk_get_aio_context(blk);
-        aio_context_acquire(aio_context);
+    aio_context = blk_get_aio_context(blk);
+    aio_context_acquire(aio_context);
 
-        qemuio_command(blk, command);
+    qemuio_command(blk, command);
 
-        aio_context_release(aio_context);
-    } else {
-        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", device);
-    }
+    aio_context_release(aio_context);
 
 fail:
     blk_unref(local_blk);