Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4NVp-0002Pl-Ch for qemu-devel@nongnu.org; Thu, 05 Jun 2008 18:00:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4NVo-0002OE-8x for qemu-devel@nongnu.org; Thu, 05 Jun 2008 18:00:48 -0400 Received: from [199.232.76.173] (port=38317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4NVo-0002O1-4c for qemu-devel@nongnu.org; Thu, 05 Jun 2008 18:00:48 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42870 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K4NVn-0003h9-Ru for qemu-devel@nongnu.org; Thu, 05 Jun 2008 18:00:47 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K4NVm-0000d1-EM for qemu-devel@nongnu.org; Thu, 05 Jun 2008 22:00:46 +0000 Received: from ths by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K4NVm-0000cw-6L for qemu-devel@nongnu.org; Thu, 05 Jun 2008 22:00:46 +0000 MIME-Version: 1.0 Errors-To: ths Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Thiemo Seufer Message-Id: Date: Thu, 05 Jun 2008 22:00:46 +0000 Subject: [Qemu-devel] [4673] Remove dead-code (else-block) from block-qcow.c, by Marc Bevand. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4673 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4673 Author: ths Date: 2008-06-05 22:00:45 +0000 (Thu, 05 Jun 2008) Log Message: ----------- Remove dead-code (else-block) from block-qcow.c, by Marc Bevand. Modified Paths: -------------- trunk/block-qcow.c Modified: trunk/block-qcow.c =================================================================== --- trunk/block-qcow.c 2008-06-05 21:53:49 UTC (rev 4672) +++ trunk/block-qcow.c 2008-06-05 22:00:45 UTC (rev 4673) @@ -339,33 +339,28 @@ return -1; } else { cluster_offset = bdrv_getlength(s->hd); - if (allocate == 1) { - /* round to cluster size */ - cluster_offset = (cluster_offset + s->cluster_size - 1) & - ~(s->cluster_size - 1); - bdrv_truncate(s->hd, cluster_offset + s->cluster_size); - /* if encrypted, we must initialize the cluster - content which won't be written */ - if (s->crypt_method && - (n_end - n_start) < s->cluster_sectors) { - uint64_t start_sect; - start_sect = (offset & ~(s->cluster_size - 1)) >> 9; - memset(s->cluster_data + 512, 0x00, 512); - for(i = 0; i < s->cluster_sectors; i++) { - if (i < n_start || i >= n_end) { - encrypt_sectors(s, start_sect + i, - s->cluster_data, - s->cluster_data + 512, 1, 1, - &s->aes_encrypt_key); - if (bdrv_pwrite(s->hd, cluster_offset + i * 512, - s->cluster_data, 512) != 512) - return -1; - } + /* round to cluster size */ + cluster_offset = (cluster_offset + s->cluster_size - 1) & + ~(s->cluster_size - 1); + bdrv_truncate(s->hd, cluster_offset + s->cluster_size); + /* if encrypted, we must initialize the cluster + content which won't be written */ + if (s->crypt_method && + (n_end - n_start) < s->cluster_sectors) { + uint64_t start_sect; + start_sect = (offset & ~(s->cluster_size - 1)) >> 9; + memset(s->cluster_data + 512, 0x00, 512); + for(i = 0; i < s->cluster_sectors; i++) { + if (i < n_start || i >= n_end) { + encrypt_sectors(s, start_sect + i, + s->cluster_data, + s->cluster_data + 512, 1, 1, + &s->aes_encrypt_key); + if (bdrv_pwrite(s->hd, cluster_offset + i * 512, + s->cluster_data, 512) != 512) + return -1; } } - } else { - cluster_offset |= QCOW_OFLAG_COMPRESSED | - (uint64_t)compressed_size << (63 - s->cluster_bits); } } /* update L2 table */