From patchwork Mon Feb 18 14:09:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 221388 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 B65A02C02A9 for ; Tue, 19 Feb 2013 01:13:18 +1100 (EST) Received: from localhost ([::1]:38172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7RT2-0006yN-AZ for incoming@patchwork.ozlabs.org; Mon, 18 Feb 2013 09:13:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7RSn-0006jL-Kq for qemu-devel@nongnu.org; Mon, 18 Feb 2013 09:13:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7RSd-0002J3-Pd for qemu-devel@nongnu.org; Mon, 18 Feb 2013 09:13:01 -0500 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:39658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7RSd-0002Hk-9I for qemu-devel@nongnu.org; Mon, 18 Feb 2013 09:12:51 -0500 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 18 Feb 2013 19:40:27 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 18 Feb 2013 19:40:24 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 4143B394004F for ; Mon, 18 Feb 2013 19:42:44 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1IECfRl24182938 for ; Mon, 18 Feb 2013 19:42:41 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1IECgkT008530 for ; Tue, 19 Feb 2013 01:12:43 +1100 Received: from RH63Wenchao ([9.77.177.33]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1IEA8vo030211; Tue, 19 Feb 2013 01:12:39 +1100 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2013 22:09:27 +0800 Message-Id: <1361196578-19016-4-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1361196578-19016-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1361196578-19016-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13021814-3864-0000-0000-000006E140CE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.3 Cc: kwolf@redhat.com, aliguori@us.ibm.com, phrdina@redhat.com, stefanha@gmail.com, armbru@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com, Wenchao Xia Subject: [Qemu-devel] [PATCH V6 03/14] 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 19c2d7b..0ed8190 100644 --- a/block.c +++ b/block.c @@ -3077,21 +3077,21 @@ bool bdrv_can_read_snapshot(BlockDriverState *bs) } /* return whether internal snapshot can be write on @bs */ -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 4c48052..2dabb87 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -322,7 +322,7 @@ void bdrv_get_full_backing_filename(BlockDriverState *bs, BlockInfo *bdrv_query_info(BlockDriverState *s); BlockStats *bdrv_query_stats(const BlockDriverState *bs); bool bdrv_can_read_snapshot(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,