File kvm-qemu-preXX-dictzip5.patch of Package kvm

From 5cd8516cd3327e9e4b850d60ae4936892ed8efba Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 18 Jan 2010 18:16:56 +0100
Subject: [PATCH] DZIP: Make the cache actually free its contents

I had a little thinko in the DictZip freeing code. To free a buffer from the
cache, we should look at the actual cache variable and not some other struct.

This fixes big memory consumption seen with DZip.
---
 block/dictzip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block/dictzip.c b/block/dictzip.c
index b991e6d..95ffe91 100644
--- a/block/dictzip.c
+++ b/block/dictzip.c
@@ -390,7 +390,7 @@ static void dictzip_read_cb(void *opaque, int ret)
         s->cache_index = 0;
     
     cache->len = 0;
-    if (cache[s->cache_index].buf)
+    if (cache->buf)
         qemu_free(cache->buf);
     cache->start = acb->gz_start;
     cache->buf = buf;
-- 
1.6.0.2

openSUSE Build Service is sponsored by