From nobody Thu Nov 6 03:30:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15394208234581001.5267053941678; Sat, 13 Oct 2018 01:53:43 -0700 (PDT) Received: from localhost ([::1]:44220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBFg5-00038x-RV for importer@patchew.org; Sat, 13 Oct 2018 04:53:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBFfA-0002ph-9l for qemu-devel@nongnu.org; Sat, 13 Oct 2018 04:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBFf9-0002PT-9D for qemu-devel@nongnu.org; Sat, 13 Oct 2018 04:52:44 -0400 Received: from m12-18.163.com ([220.181.12.18]:38089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBFf4-0001vM-Ap; Sat, 13 Oct 2018 04:52:39 -0400 Received: from ubuntu.localdomain (unknown [115.192.95.72]) by smtp14 (Coremail) with SMTP id EsCowAC3_x9QssFbJavFWw--.56041S2; Sat, 13 Oct 2018 16:52:33 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=kXvSM90Vsdlg6wPM+E /p6HTbhv2vFk1XCFIU6mVzHzk=; b=Hado90FsItZv3AgLkj4Pg5p/1wYRHPY//h VeJqkXYwe79QjmQG5luFvml3vY7gXAtU4S7u1sz2sdeErvBdWKYCsafJOUWzSytG bZ0u9laoJVrknf8qv3XaqxZaEWfcjhSdAurqaF1Fq++LUy3ZDx2bUexH7Hg5JMpl P3ARXQaZ0= From: Li Qiang To: kwolf@redhat.com, mreitz@redhat.com Date: Sat, 13 Oct 2018 01:52:31 -0700 Message-Id: <20181013085231.55608-1-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: EsCowAC3_x9QssFbJavFWw--.56041S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tFW7Wr43ZrW8ZF1fZw1fZwb_yoW8CF4xpr Z3G3WDCr4kCF109a1DGF9aqF1UGay7Gw1kWan5Ja1fuws7Kr1aqF1DKF4jvFyktrsrZFZ0 qrZrWryUuF4UCr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UmLvNUUUUU= X-Originating-IP: [115.192.95.72] X-CM-SenderInfo: 5oltjvrd6rljoofrz/1tbiTwvebVsGMXDsXQAAsa X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.18 Subject: [Qemu-devel] [PATCH] block: change some function return type to bool X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Li Qiang Reviewed-by: Alberto Garcia --- block/block-backend.c | 8 ++++---- include/sysemu/block-backend.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index dc0cd57724..2a8f3b55f8 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1708,7 +1708,7 @@ void blk_error_action(BlockBackend *blk, BlockErrorAc= tion action, } } =20 -int blk_is_read_only(BlockBackend *blk) +bool blk_is_read_only(BlockBackend *blk) { BlockDriverState *bs =3D blk_bs(blk); =20 @@ -1719,18 +1719,18 @@ int blk_is_read_only(BlockBackend *blk) } } =20 -int blk_is_sg(BlockBackend *blk) +bool blk_is_sg(BlockBackend *blk) { BlockDriverState *bs =3D blk_bs(blk); =20 if (!bs) { - return 0; + return false; } =20 return bdrv_is_sg(bs); } =20 -int blk_enable_write_cache(BlockBackend *blk) +bool blk_enable_write_cache(BlockBackend *blk) { return blk->enable_write_cache; } diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 830d873f24..c96bcdee14 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -166,9 +166,9 @@ BlockErrorAction blk_get_error_action(BlockBackend *blk= , bool is_read, int error); void blk_error_action(BlockBackend *blk, BlockErrorAction action, bool is_read, int error); -int blk_is_read_only(BlockBackend *blk); -int blk_is_sg(BlockBackend *blk); -int blk_enable_write_cache(BlockBackend *blk); +bool blk_is_read_only(BlockBackend *blk); +bool blk_is_sg(BlockBackend *blk); +bool blk_enable_write_cache(BlockBackend *blk); void blk_set_enable_write_cache(BlockBackend *blk, bool wce); void blk_invalidate_cache(BlockBackend *blk, Error **errp); bool blk_is_inserted(BlockBackend *blk); --=20 2.17.1