From patchwork Mon May 30 11:59:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 9141109 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 F20BC60754 for ; Mon, 30 May 2016 12:02:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E37C728066 for ; Mon, 30 May 2016 12:02:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8227281C2; Mon, 30 May 2016 12:02:37 +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 6DFEA28066 for ; Mon, 30 May 2016 12:02:37 +0000 (UTC) Received: from localhost ([::1]:59576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7Lu0-0004sN-Kl for patchwork-qemu-devel@patchwork.kernel.org; Mon, 30 May 2016 08:02:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7Lri-0003n0-Tg for qemu-devel@nongnu.org; Mon, 30 May 2016 08:00:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7Lrc-00084N-H3 for qemu-devel@nongnu.org; Mon, 30 May 2016 08:00:13 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:58542 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7Lrc-00080o-7C for qemu-devel@nongnu.org; Mon, 30 May 2016 08:00:08 -0400 Received: (qmail 10701 invoked by uid 89); 30 May 2016 12:00:04 -0000 Received: from [195.62.97.28] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.99.2/21638. hbedv: 8.3.40.22/7.12.95.236. avast: 1.2.2/16053000. spamassassin: 3.4.1. Clear:RC:1(195.62.97.28):. Processed in 0.137374 secs); 30 May 2016 12:00:04 -0000 Received: from smtp.kamp.de (HELO submission.kamp.de) ([195.62.97.28]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted); 30 May 2016 12:00:02 -0000 X-GL_Whitelist: yes Received: (qmail 30532 invoked from network); 30 May 2016 12:00:02 -0000 Received: from lieven-pc.kamp-intra.net (HELO lieven-pc) (relay@kamp.de@::ffff:172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 30 May 2016 12:00:02 -0000 Received: by lieven-pc (Postfix, from userid 1000) id 0BCBC20A6A; Mon, 30 May 2016 14:00:02 +0200 (CEST) From: Peter Lieven To: qemu-block@nongnu.org Date: Mon, 30 May 2016 13:59:59 +0200 Message-Id: <1464609599-7495-1-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:248:0:51::16 Subject: [Qemu-devel] [PATCH] 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, Peter Lieven , qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP at least bdrv_co_preadv/pwritev expect this. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake --- 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;