[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/36] block: change some function return type to boo
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 09/36] block: change some function return type to bool |
Date: |
Mon, 5 Nov 2018 17:37:17 +0100 |
From: Li Qiang <address@hidden>
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
include/sysemu/block-backend.h | 6 +++---
block/block-backend.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
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);
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, BlockErrorAction
action,
}
}
-int blk_is_read_only(BlockBackend *blk)
+bool blk_is_read_only(BlockBackend *blk)
{
BlockDriverState *bs = blk_bs(blk);
@@ -1719,18 +1719,18 @@ int blk_is_read_only(BlockBackend *blk)
}
}
-int blk_is_sg(BlockBackend *blk)
+bool blk_is_sg(BlockBackend *blk)
{
BlockDriverState *bs = blk_bs(blk);
if (!bs) {
- return 0;
+ return false;
}
return bdrv_is_sg(bs);
}
-int blk_enable_write_cache(BlockBackend *blk)
+bool blk_enable_write_cache(BlockBackend *blk)
{
return blk->enable_write_cache;
}
--
2.19.1
- [Qemu-devel] [PULL 00/36] Block layer patches, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 02/36] block: replace "discard" literal with BDRV_OPT_DISCARD macro, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 03/36] qemu-io-cmds: Fix two format strings, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 01/36] block/vvfat: Fix crash when reporting error about too many files in directory, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 07/36] crypto: initialize sector size even when opening with no IO flag, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 04/36] block/qcow2: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 05/36] block/qcow: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 06/36] block/qcow2-bitmap: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 08/36] qcow2: Get the request alignment for encrypted images from QCryptoBlock, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 09/36] block: change some function return type to bool,
Kevin Wolf <=
- [Qemu-devel] [PULL 10/36] iotests: make 083 specific to raw, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 12/36] block/vhdx: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 22/36] block: Require auto-read-only for existing fallbacks, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 15/36] quorum: Return an error if the blkverify mode has invalid settings, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 30/36] option: Make option help nicer to read, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 19/36] block: Update flags in bdrv_set_read_only(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 31/36] chardev: Indent list of chardevs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 18/36] iotest: Test x-blockdev-change on a Quorum, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 23/36] nbd: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 14/36] quorum: Remove quorum_err(), Kevin Wolf, 2018/11/05