From patchwork Wed Jun 8 09:16:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 9163885 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 C249660572 for ; Wed, 8 Jun 2016 09:27:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B16882835B for ; Wed, 8 Jun 2016 09:27:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A67FC28384; Wed, 8 Jun 2016 09:27:57 +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 302EE2835B for ; Wed, 8 Jun 2016 09:27:57 +0000 (UTC) Received: from localhost ([::1]:55465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAZmG-0004DC-75 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 05:27:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAZcC-0003Rb-Mm for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAZcB-0001V2-Jr for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:17:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAZc4-0001QM-6I; Wed, 08 Jun 2016 05:17:24 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF63C6437F; Wed, 8 Jun 2016 09:17:23 +0000 (UTC) Received: from noname.str.redhat.com. (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u589H0eM029817; Wed, 8 Jun 2016 05:17:23 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Wed, 8 Jun 2016 11:16:47 +0200 Message-Id: <1465377417-5012-22-git-send-email-kwolf@redhat.com> In-Reply-To: <1465377417-5012-1-git-send-email-kwolf@redhat.com> References: <1465377417-5012-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 08 Jun 2016 09:17:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 21/31] block: assert that bs->request_alignment is a power of 2 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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Lieven at least bdrv_co_preadv/pwritev expect this. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 736432f..f54bc25 100644 --- a/block.c +++ b/block.c @@ -1018,7 +1018,7 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, assert(bdrv_opt_mem_align(bs) != 0); assert(bdrv_min_mem_align(bs) != 0); - assert((bs->request_alignment != 0) || bdrv_is_sg(bs)); + assert(is_power_of_2(bs->request_alignment) || bdrv_is_sg(bs)); qemu_opts_del(opts); return 0;