From nobody Mon Feb 9 20:11:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1603372459; cv=none; d=zohomail.com; s=zohoarc; b=AJyGfkXqQmOFz1BqvcVeHL7Ziqxt3iniKNOHP/ow3EKV7jsFR4CYsH1AKig4h2NS/KNtHMX5srqcvX9piGYkNNYP+29RKZNulbRN5vtbVcUgkV1M4V3uU9oPZoMA/4BY9+AUKZx5NOAS2GBnsQcLxK098g7A+mvKmpI2Ub7aQjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603372459; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iL//NuCHF3wann7VlcSol2e8k95O2pSsIKSVBE+M64Y=; b=U9980apTMsKLGU0xFChzozIBNiYG36iySTLhO6gP/c6tF5eW10OzrNyDssJGlxlnDg3LGWTo5lIunnWQiLSOrqwksm1GJrimp7XnC3VnYKr8x3P4Un+NEKnEBz3AKAVCleSfG+Lzx2FZ42/NfbgLhWuTuIHXxQd90Vv+EyzTZCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603372459126743.637258702004; Thu, 22 Oct 2020 06:14:19 -0700 (PDT) Received: from localhost ([::1]:48256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVaQ5-0000JL-UK for importer@patchew.org; Thu, 22 Oct 2020 09:14:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVaG7-00052v-It; Thu, 22 Oct 2020 09:03:59 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5715 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVaFx-0000gn-Rm; Thu, 22 Oct 2020 09:03:59 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1F3A5716043171552079; Thu, 22 Oct 2020 21:03:43 +0800 (CST) Received: from localhost (10.174.184.155) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Thu, 22 Oct 2020 21:03:34 +0800 From: Jiahui Cen To: , , , Subject: [PATCH v3 9/9] docs: add a doc about I/O hang Date: Thu, 22 Oct 2020 21:03:03 +0800 Message-ID: <20201022130303.1092-10-cenjiahui@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022130303.1092-1-cenjiahui@huawei.com> References: <20201022130303.1092-1-cenjiahui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=45.249.212.191; envelope-from=cenjiahui@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 09:03:44 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: cenjiahui@huawei.com, zhang.zhanghailiang@huawei.com, qemu-block@nongnu.org, stefanha@redhat.com, fangying1@huawei.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Give some details about the I/O hang and how to use it. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- docs/io-hang.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/io-hang.rst diff --git a/docs/io-hang.rst b/docs/io-hang.rst new file mode 100644 index 0000000000..53356ceed2 --- /dev/null +++ b/docs/io-hang.rst @@ -0,0 +1,45 @@ +=3D=3D=3D=3D=3D=3D=3D=3D +I/O hang +=3D=3D=3D=3D=3D=3D=3D=3D + +Introduction +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +I/O hang is a mechanism to automatically rehandle AIOs when an error occur= s on +the backend block device, which is unperceivable for Guest. If the error o= n the +backend device is temporary, like NFS returns EIO due to network fluctuati= ons, +once the device is recovered, the AIOs will be resent automatically and do= ne +successfully. If the error on the device is unrecoverable, the failed AIOs= will +be returned to Guest after rehandle timeout. + +This mechanism can provide self-recovery and high availability to VM. From= the +view of Guest, AIOs sent to the device are hung for a time and the finishe= d, and +any other unrelated service in Guest can work as usual. + +Implementation +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Each BlockBackend will have a list to store AIOs which need be rehandled a= nd a +timer to monitor the timeout. + +If I/O hang is enabled, all returned AIOs will be checked and the failed o= nes +will be inserted into BlockBackend's list. The timer will be started and t= he +AIOs in the list will be resent to the backend device. Once the result of = AIOs +relevant to this backend device is success, the AIOs will be returned back= to +Guest. Otherwise, those AIOs will be rehandled periodically until timeout. + +I/O hang provides interfaces to drain all the AIOs in BlockBackend's list.= There +are some situations to drain the rehandling AIOs, eg. resetting virtio-blk. + +I/O hang also provides qapi events, which can be used for manager tools li= ke +libvirt to monitor. + +Examples +=3D=3D=3D=3D=3D=3D=3D=3D + +Enable I/O hang when launching QEMU:: + + $ qemu-system-x86_64 \ + -machine pc,accel=3Dkvm -smp 1 -m 2048 \ + -drive file=3Dshared.img,format=3Draw,cache=3Dnone,aio=3Dnative,= iohang-timeout=3D60 + --=20 2.19.1