[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 02/33] hmp: Remove dead code in hmp_qemu_io()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 02/33] hmp: Remove dead code in hmp_qemu_io() |
Date: |
Thu, 22 Sep 2016 18:29:03 +0200 |
blk can never be NULL, drop the check. This fixes a Coverity warning.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
hmp.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/hmp.c b/hmp.c
index ad33b44..0a16aef 100644
--- 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);
--
1.8.3.1
- [Qemu-block] [PULL 00/33] Block layer patches, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 02/33] hmp: Remove dead code in hmp_qemu_io(),
Kevin Wolf <=
- [Qemu-block] [PULL 01/33] qcow2: fix encryption during cow of sectors, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 05/33] block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 06/33] block: Update bs->open_flags earlier in bdrv_open_common(), Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 03/33] tests: allow to specify list of formats to test for check-block.sh, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 04/33] block: Remove bdrv_is_snapshot, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 07/33] block: Add "read-only" to the options QDict, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 08/33] block: Don't queue the same BDS twice in bdrv_reopen_queue_child(), Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 09/33] commit: Add 'base' to the reopen queue before 'overlay_bs', Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 10/33] block: rename "read-only" to BDRV_OPT_READ_ONLY, Kevin Wolf, 2016/09/22
- [Qemu-block] [PULL 11/33] block: Fix 'since' for compressed Drive/BlockdevBackup, Kevin Wolf, 2016/09/22