From patchwork Wed Jun 22 09:16:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changlong Xie X-Patchwork-Id: 9192227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB50E60756 for ; Wed, 22 Jun 2016 09:16:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B974428364 for ; Wed, 22 Jun 2016 09:16:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE0DE283E6; Wed, 22 Jun 2016 09:16:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3419828364 for ; Wed, 22 Jun 2016 09:16:31 +0000 (UTC) Received: from localhost ([::1]:56739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFeGr-0000sD-UC for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jun 2016 05:16:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFeDA-0004db-45 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 05:12:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFeCx-0006UR-9M for qemu-devel@nongnu.org; Wed, 22 Jun 2016 05:12:39 -0400 Received: from [59.151.112.132] (port=5446 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFeCw-0006SY-LY for qemu-devel@nongnu.org; Wed, 22 Jun 2016 05:12:27 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="7952487" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Jun 2016 17:12:12 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id DC34741C0BAC; Wed, 22 Jun 2016 17:12:10 +0800 (CST) Received: from changlox.g08.fujitsu.local (10.167.225.55) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.279.2; Wed, 22 Jun 2016 17:12:10 +0800 From: Changlong Xie To: qemu devel , Jeff Cody Date: Wed, 22 Jun 2016 17:16:47 +0800 Message-ID: <1466587008-3933-2-git-send-email-xiecl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1466587008-3933-1-git-send-email-xiecl.fnst@cn.fujitsu.com> References: <1466587008-3933-1-git-send-email-xiecl.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.225.55] X-yoursite-MailScanner-ID: DC34741C0BAC.A1B56 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xiecl.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Subject: [Qemu-devel] [PATCH 1/2] blockjob: assert(cb) in the entry functions of blockjob 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: Kevin Wolf , Changlong Xie , Fam Zheng , Max Reitz , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Changlong Xie --- block/commit.c | 1 + block/mirror.c | 2 ++ block/stream.c | 1 + 3 files changed, 4 insertions(+) diff --git a/block/commit.c b/block/commit.c index 444333b..13b55c1 100644 --- a/block/commit.c +++ b/block/commit.c @@ -223,6 +223,7 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base, BlockDriverState *overlay_bs; Error *local_err = NULL; + assert(cb); assert(top != bs); if (top == base) { error_setg(errp, "Invalid files for merge: top and base are the same"); diff --git a/block/mirror.c b/block/mirror.c index a04ed9c..fa2bdab 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -912,6 +912,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target, bool is_none_mode; BlockDriverState *base; + assert(cb); if (mode == MIRROR_SYNC_MODE_INCREMENTAL) { error_setg(errp, "Sync mode 'incremental' not supported"); return; @@ -935,6 +936,7 @@ void commit_active_start(BlockDriverState *bs, BlockDriverState *base, int ret; Error *local_err = NULL; + assert(cb); orig_base_flags = bdrv_get_flags(base); if (bdrv_reopen(base, bs->open_flags, errp)) { diff --git a/block/stream.c b/block/stream.c index c0efbda..fc34c63 100644 --- a/block/stream.c +++ b/block/stream.c @@ -226,6 +226,7 @@ void stream_start(BlockDriverState *bs, BlockDriverState *base, { StreamBlockJob *s; + assert(cb); s = block_job_create(&stream_job_driver, bs, speed, cb, opaque, errp); if (!s) { return;