diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-09-15 17:44:16 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-09-23 13:36:09 +0200 |
commit | 1813d33015f0a6780609739999f3962f2dc56921 (patch) | |
tree | 37395095026fb66622da5f95b327d3503f0fddb6 /hmp.c | |
parent | bb9f8dd0e15a9744b8d09d06ecb6a18ca3dcc173 (diff) |
hmp: Remove dead code in hmp_qemu_io()
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>
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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); |