From patchwork Thu Mar 7 06:07:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 225739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BA54F2C0371 for ; Thu, 7 Mar 2013 17:14:13 +1100 (EST) Received: from localhost ([::1]:51569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDU5j-0005yN-HK for incoming@patchwork.ozlabs.org; Thu, 07 Mar 2013 01:14:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDU2E-0008HV-Vi for qemu-devel@nongnu.org; Thu, 07 Mar 2013 01:10:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDU2D-0004fq-Nq for qemu-devel@nongnu.org; Thu, 07 Mar 2013 01:10:34 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:59667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDU2D-0004fh-3R for qemu-devel@nongnu.org; Thu, 07 Mar 2013 01:10:33 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Mar 2013 11:37:12 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 7 Mar 2013 11:37:10 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id CE201125804E for ; Thu, 7 Mar 2013 11:41:27 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r276AOJS14352634 for ; Thu, 7 Mar 2013 11:40:24 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r276AReE000720 for ; Thu, 7 Mar 2013 17:10:28 +1100 Received: from RH63Wenchao (wenchaox.cn.ibm.com [9.115.122.208]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r2767TJw021188; Thu, 7 Mar 2013 17:10:22 +1100 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2013 14:07:22 +0800 Message-Id: <1362636445-7188-18-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1362636445-7188-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1362636445-7188-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13030706-8878-0000-0000-0000062A289A X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.7 Cc: kwolf@redhat.com, aliguori@us.ibm.com, capitulino@redhat.com, stefanha@gmail.com, armbru@redhat.com, pbonzini@redhat.com, Wenchao Xia Subject: [Qemu-devel] [PATCH V8 17/20] block: return bool for bdrv_can_snapshot() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This function should return bool instead of int, just as bdrv_can_read_snapshot(). Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- block.c | 8 ++++---- include/block/block.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index 124a9eb..77e21f5 100644 --- a/block.c +++ b/block.c @@ -3123,21 +3123,21 @@ bool bdrv_debug_is_suspended(BlockDriverState *bs, const char *tag) /**************************************************************/ /* handling of snapshots */ -int bdrv_can_snapshot(BlockDriverState *bs) +bool bdrv_can_snapshot(BlockDriverState *bs) { BlockDriver *drv = bs->drv; if (!drv || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) { - return 0; + return false; } if (!drv->bdrv_snapshot_create) { if (bs->file != NULL) { return bdrv_can_snapshot(bs->file); } - return 0; + return false; } - return 1; + return true; } int bdrv_is_snapshot(BlockDriverState *bs) diff --git a/include/block/block.h b/include/block/block.h index 0f750d7..c883857 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -327,7 +327,7 @@ void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz); BlockInfo *bdrv_query_info(BlockDriverState *s); BlockStats *bdrv_query_stats(const BlockDriverState *bs); -int bdrv_can_snapshot(BlockDriverState *bs); +bool bdrv_can_snapshot(BlockDriverState *bs); int bdrv_is_snapshot(BlockDriverState *bs); BlockDriverState *bdrv_snapshots(void); int bdrv_snapshot_create(BlockDriverState *bs,