Received: from eggs.gnu.org ([2001:4830:134:3::10]:46596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn6sb-0005zh-BQ for qemu-devel@nongnu.org; Thu, 22 Sep 2016 12:29:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn6sZ-000541-Gd for qemu-devel@nongnu.org; Thu, 22 Sep 2016 12:29:44 -0400 From: Kevin Wolf Date: Thu, 22 Sep 2016 18:29:03 +0200 Message-Id: <1474561774-19256-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1474561774-19256-1-git-send-email-kwolf@redhat.com> References: <1474561774-19256-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 02/33] hmp: Remove dead code in hmp_qemu_io() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org blk can never be NULL, drop the check. This fixes a Coverity warning. Signed-off-by: Kevin Wolf Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 =3D NULL; + AioContext *aio_context; const char* device =3D qdict_get_str(qdict, "device"); const char* command =3D qdict_get_str(qdict, "command"); Error *err =3D NULL; @@ -1939,17 +1940,12 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict= ) } } =20 - if (blk) { - AioContext *aio_context =3D blk_get_aio_context(blk); - aio_context_acquire(aio_context); + aio_context =3D blk_get_aio_context(blk); + aio_context_acquire(aio_context); =20 - qemuio_command(blk, command); + qemuio_command(blk, command); =20 - aio_context_release(aio_context); - } else { - error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND, - "Device '%s' not found", device); - } + aio_context_release(aio_context); =20 fail: blk_unref(local_blk); --=20 1.8.3.1