From patchwork Tue Aug 9 07:46:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 109166 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 9C7A6B6F81 for ; Tue, 9 Aug 2011 18:38:19 +1000 (EST) Received: from localhost ([::1]:52578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qqh2S-0006Ob-Gu for incoming@patchwork.ozlabs.org; Tue, 09 Aug 2011 03:47:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qqh1e-00041I-OP for qemu-devel@nongnu.org; Tue, 09 Aug 2011 03:47:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qqh1d-0006tU-8v for qemu-devel@nongnu.org; Tue, 09 Aug 2011 03:46:58 -0400 Received: from mail-ey0-f171.google.com ([209.85.215.171]:43960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qqh1d-0006nW-3i for qemu-devel@nongnu.org; Tue, 09 Aug 2011 03:46:57 -0400 Received: by mail-ey0-f171.google.com with SMTP id 24so3371321eyg.16 for ; Tue, 09 Aug 2011 00:46:56 -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=KGLMXkOlvSkXDXGvJkbwMJETB54h9zVmruPwWEk0aCI=; b=KR/vNflKi7kWVi6iTWWMS7oeXFDwKRU73SdCE9nWUi1i8iDKtkohKt1opdl1X5Nc5m eQ67t3OIqsLiKR0Hoa87iucMIdRW9ITusxtisLC6RPx0kOHBpKsC4rbk7SqG8ngJno0B Vk5TDlsTq/TVgNMhUqGeYtiZNb/oo/WSFDTA0= Received: by 10.213.107.142 with SMTP id b14mr1308277ebp.38.1312876016468; Tue, 09 Aug 2011 00:46:56 -0700 (PDT) Received: from obol602.omnitel.it ([206.217.137.183]) by mx.google.com with ESMTPS id p49sm2857459eef.58.2011.08.09.00.46.53 (version=SSLv3 cipher=OTHER); Tue, 09 Aug 2011 00:46:55 -0700 (PDT) From: Frediano Ziglio To: kwolf@redhat.com Date: Tue, 9 Aug 2011 09:46:40 +0200 Message-Id: <1312876010-15361-6-git-send-email-freddy77@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1312876010-15361-1-git-send-email-freddy77@gmail.com> References: <1312876010-15361-1-git-send-email-freddy77@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.171 Cc: qemu-devel@nongnu.org, Frediano Ziglio Subject: [Qemu-devel] [PATCH v2 05/15] 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 00f339f..0989799 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) {