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>
This commit is contained in:
parent
bb9f8dd0e1
commit
1813d33015
14
hmp.c
14
hmp.c
@ -1924,6 +1924,7 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
|
|||||||
{
|
{
|
||||||
BlockBackend *blk;
|
BlockBackend *blk;
|
||||||
BlockBackend *local_blk = NULL;
|
BlockBackend *local_blk = NULL;
|
||||||
|
AioContext *aio_context;
|
||||||
const char* device = qdict_get_str(qdict, "device");
|
const char* device = qdict_get_str(qdict, "device");
|
||||||
const char* command = qdict_get_str(qdict, "command");
|
const char* command = qdict_get_str(qdict, "command");
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
@ -1939,17 +1940,12 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blk) {
|
aio_context = blk_get_aio_context(blk);
|
||||||
AioContext *aio_context = blk_get_aio_context(blk);
|
aio_context_acquire(aio_context);
|
||||||
aio_context_acquire(aio_context);
|
|
||||||
|
|
||||||
qemuio_command(blk, command);
|
qemuio_command(blk, command);
|
||||||
|
|
||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
} else {
|
|
||||||
error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
|
|
||||||
"Device '%s' not found", device);
|
|
||||||
}
|
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
blk_unref(local_blk);
|
blk_unref(local_blk);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user