From patchwork Wed Jun 4 11:51:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 355874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A3065140098 for ; Wed, 4 Jun 2014 21:57:24 +1000 (EST) Received: from localhost ([::1]:59919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws9oo-0001ec-Dz for incoming@patchwork.ozlabs.org; Wed, 04 Jun 2014 07:57:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws9jh-0001e7-OU for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws9ja-0002Q6-VG for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:52:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws9ja-0002Pc-ME for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:51:58 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s54BpuU3014305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jun 2014 07:51:56 -0400 Received: from blackfin.pond.sub.org (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s54Bps8B032072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jun 2014 07:51:56 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C5018303FEAF; Wed, 4 Jun 2014 13:51:51 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 4 Jun 2014 13:51:49 +0200 Message-Id: <1401882711-30508-9-git-send-email-armbru@redhat.com> In-Reply-To: <1401882711-30508-1-git-send-email-armbru@redhat.com> References: <1401882711-30508-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, benoit@irqsave.net, stefanha@redhat.com, mreitz@redhat.com Subject: [Qemu-devel] [PATCH v4 08/10] block: Drop superfluous aligning of bdrv_getlength()'s value 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 It returns a multiple of the sector size. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Reviewed-by: Benoit Canet --- block.c | 1 - block/qcow2.c | 1 - 2 files changed, 2 deletions(-) diff --git a/block.c b/block.c index ee007c2..cae9085 100644 --- a/block.c +++ b/block.c @@ -1261,7 +1261,6 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp) error_setg_errno(errp, -total_size, "Could not get image size"); goto out; } - total_size &= BDRV_SECTOR_MASK; /* Create the temporary image */ ret = get_tmp_filename(tmp_filename, PATH_MAX + 1); diff --git a/block/qcow2.c b/block/qcow2.c index 1f15adf..1cfcb63 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1926,7 +1926,6 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num, /* align end of file to a sector boundary to ease reading with sector based I/Os */ cluster_offset = bdrv_getlength(bs->file); - cluster_offset = (cluster_offset + 511) & ~511; bdrv_truncate(bs->file, cluster_offset); return 0; }