From nobody Fri May 3 12:52:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=nutanix.com ARC-Seal: i=1; a=rsa-sha256; t=1562571908; cv=none; d=zoho.com; s=zohoarc; b=SfDwomWEGwJhbQZ4RRDbTani1hQQBaLaqeiLbcH57CcnHqEsmWhm4MDNJMxmB30C0cUNhuFBMeVy6ah0PTUG+AZjnPJWEvqmZ8mPuI4/KUThL/QFoLnwxAkAS0UUPJ8yzkEcAu+NMVRddxjda9R1wFXPKwCMJpOf9bUaQOdSCa4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562571908; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=KKUDdoLt03xyzMRwG/7d5BgVyOT97UD0kvxTb66hLC4=; b=L8WF0r2UUTImSxVougsWb3FgZ3aPAH7NrVdbNcohTOjJw04E/00ust8PICoR2ZJFG4o6tpBpVulRWEO+aLwfvTgN/xvKlZ4iS0IITqnQjRSRN6qkDpOYIDaK3mFVs4amPQa5QI8OixT2gXBIioiFMryygyCvO2OjvdPV4UFEjlg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562571908450617.9012788209594; Mon, 8 Jul 2019 00:45:08 -0700 (PDT) Received: from localhost ([::1]:39160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkOKf-00027Y-F0 for importer@patchew.org; Mon, 08 Jul 2019 03:45:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48790) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkJuf-0003Ic-5j for qemu-devel@nongnu.org; Sun, 07 Jul 2019 23:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkJuX-00009c-WE for qemu-devel@nongnu.org; Sun, 07 Jul 2019 23:01:54 -0400 Received: from [192.146.154.1] (port=22458 helo=shaju-abraham.dev.nutanix.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hkJuC-0008IT-00; Sun, 07 Jul 2019 23:01:29 -0400 Received: by shaju-abraham.dev.nutanix.com (Postfix, from userid 0) id 70BBE40628; Sun, 7 Jul 2019 19:55:12 -0700 (PDT) From: shaju.abraham@nutanix.com To: qemu-devel@nongnu.org Date: Sun, 7 Jul 2019 19:55:03 -0700 Message-Id: <1562554503-177179-1-git-send-email-shaju.abraham@nutanix.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.146.154.1 X-Mailman-Approved-At: Mon, 08 Jul 2019 03:42:45 -0400 Subject: [Qemu-devel] [PATCH] Fix Guest VM crash due to iSCSI Sense Key error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shaju Abraham , jsnow@redhat.com, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Shaju Abraham During the IDE DMA transfer for a ISCSI target,when libiscsi encounters a SENSE KEY error, it sets the task->sense to the value "COMMAND ABORTED". The function iscsi_translate_sense() later translaters this error to -ECANC= ELED and this value is passed to the callback function. In the case of IDE DMA = read or write, the callback function returns immediately if the value of the ret argument is -ECANCELED. Later when ide_cancel_dma_sync() function is invoked the assertion "s->bus->dma->aiocb =3D=3D ((void *)0)" fails and the qemu process gets ter= minated. Fix the issue by making the value of s->bus->dma->aiocb =3D NULL when -ECANCELED is passed to the callback. Signed-off-by: Shaju Abraham Reviewed-by: Stefan Hajnoczi --- hw/ide/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 6afadf8..78ea357 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -841,6 +841,7 @@ static void ide_dma_cb(void *opaque, int ret) bool stay_active =3D false; =20 if (ret =3D=3D -ECANCELED) { + s->bus->dma->aiocb =3D NULL; return; } =20 --=20 1.9.4