From patchwork Fri Jul 22 08:46:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 106239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C5C24B6F71 for ; Fri, 22 Jul 2011 18:47:25 +1000 (EST) Received: from localhost ([::1]:53674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkBOD-0005NK-Ph for incoming@patchwork.ozlabs.org; Fri, 22 Jul 2011 04:47:21 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkBO1-0005CK-V6 for qemu-devel@nongnu.org; Fri, 22 Jul 2011 04:47:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkBO0-0002NY-TB for qemu-devel@nongnu.org; Fri, 22 Jul 2011 04:47:09 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:44549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkBO0-0002JC-Im for qemu-devel@nongnu.org; Fri, 22 Jul 2011 04:47:08 -0400 Received: by mail-wy0-f173.google.com with SMTP id 28so1542600wyf.4 for ; Fri, 22 Jul 2011 01:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=LNAYTdFz1sFzkTA/TXMpuQpos+Hd3eDfqkh1Wrw3yw0=; b=GosjLZ8IAZQQ2feeUUrQG7HfbbO7JE0Xsa5sQAr4lOqFzi6Wx3VRfCUqk2O4if+RKs PYhKe71jA9Ab99GV6JuWjA0NwRwQP3IkGVyUt/YlMQD3MdqtxwkVJygyqHFN/RFfNih0 4hLqwdOijcHZmEZrsQJQn4WQnysDMiINMd4b8= Received: by 10.216.233.92 with SMTP id o70mr1578926weq.57.1311324428037; Fri, 22 Jul 2011 01:47:08 -0700 (PDT) Received: from localhost.localdomain (rockhall.torservers.net [77.247.181.163]) by mx.google.com with ESMTPS id gd1sm1720338wbb.27.2011.07.22.01.47.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jul 2011 01:47:07 -0700 (PDT) From: Frediano Ziglio To: qemu-devel@nongnu.org Date: Fri, 22 Jul 2011 10:46:30 +0200 Message-Id: <1311324390-27830-6-git-send-email-freddy77@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1311324390-27830-1-git-send-email-freddy77@gmail.com> References: <1311324390-27830-1-git-send-email-freddy77@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.173 Cc: Kevin Wolf , Frediano Ziglio Subject: [Qemu-devel] [PATCH 5/5] qcow: remove old #undefined code 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 Signed-off-by: Frediano Ziglio --- block/qcow.c | 63 ---------------------------------------------------------- 1 files changed, 0 insertions(+), 63 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 2feb7d7..42331c7 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -190,24 +190,6 @@ static int qcow_set_key(BlockDriverState *bs, const char *key) return -1; if (AES_set_decrypt_key(keybuf, 128, &s->aes_decrypt_key) != 0) return -1; -#if 0 - /* test */ - { - uint8_t in[16]; - uint8_t out[16]; - uint8_t tmp[16]; - for(i=0;i<16;i++) - in[i] = i; - AES_encrypt(in, tmp, &s->aes_encrypt_key); - AES_decrypt(tmp, out, &s->aes_decrypt_key); - for(i = 0; i < 16; i++) - printf(" %02x", tmp[i]); - printf("\n"); - for(i = 0; i < 16; i++) - printf(" %02x", out[i]); - printf("\n"); - } -#endif return 0; } @@ -441,51 +423,6 @@ static int decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset) return 0; } -#if 0 - -static int qcow_read(BlockDriverState *bs, int64_t sector_num, - uint8_t *buf, int nb_sectors) -{ - BDRVQcowState *s = bs->opaque; - int ret, index_in_cluster, n; - uint64_t cluster_offset; - - while (nb_sectors > 0) { - cluster_offset = get_cluster_offset(bs, sector_num << 9, 0, 0, 0, 0); - index_in_cluster = sector_num & (s->cluster_sectors - 1); - n = s->cluster_sectors - index_in_cluster; - if (n > nb_sectors) - n = nb_sectors; - if (!cluster_offset) { - if (bs->backing_hd) { - /* read from the base image */ - ret = bdrv_read(bs->backing_hd, sector_num, buf, n); - if (ret < 0) - return -1; - } else { - memset(buf, 0, 512 * n); - } - } else if (cluster_offset & QCOW_OFLAG_COMPRESSED) { - if (decompress_cluster(bs, cluster_offset) < 0) - return -1; - memcpy(buf, s->cluster_cache + index_in_cluster * 512, 512 * n); - } else { - ret = bdrv_pread(bs->file, cluster_offset + index_in_cluster * 512, buf, n * 512); - if (ret != n * 512) - return -1; - if (s->crypt_method) { - encrypt_sectors(s, sector_num, buf, buf, n, 0, - &s->aes_decrypt_key); - } - } - nb_sectors -= n; - sector_num += n; - buf += n * 512; - } - return 0; -} -#endif - static int qcow_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov) {