From patchwork Mon May 3 22:48:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 96583 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o43Mv2fW031841 for ; Mon, 3 May 2010 22:57:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759562Ab0ECW47 (ORCPT ); Mon, 3 May 2010 18:56:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41969 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759546Ab0ECW46 (ORCPT ); Mon, 3 May 2010 18:56:58 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o43Muwl9017153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 May 2010 18:56:58 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o43MuvWg007203; Mon, 3 May 2010 18:56:58 -0400 Received: from amt.cnet (vpn-8-8.rdu.redhat.com [10.11.8.8]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o43MuuWS006976; Mon, 3 May 2010 18:56:57 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 58BAD65607A; Mon, 3 May 2010 19:56:11 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o43MuAFa026916; Mon, 3 May 2010 19:56:10 -0300 Message-Id: <20100503224905.703505696@amt.cnet> User-Agent: quilt/0.47-1 Date: Mon, 03 May 2010 19:48:23 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: avi@redhat.com, jan.kiszka@web.de, Marcelo Tosatti Subject: [patch 4/6] remove unused kvm_dirty_bitmap array References: <20100503224819.773169076@amt.cnet> Content-Disposition: inline; filename=remove-unused-dirty-bitmap X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 03 May 2010 22:57:02 +0000 (UTC) Index: qemu-kvm-memslot/qemu-kvm.c =================================================================== --- qemu-kvm-memslot.orig/qemu-kvm.c +++ qemu-kvm-memslot/qemu-kvm.c @@ -2154,7 +2154,6 @@ void kvm_set_phys_mem(target_phys_addr_t * dirty pages logging */ /* FIXME: use unsigned long pointer instead of unsigned char */ -unsigned char *kvm_dirty_bitmap = NULL; int kvm_physical_memory_set_dirty_tracking(int enable) { int r = 0; @@ -2163,17 +2162,9 @@ int kvm_physical_memory_set_dirty_tracki return 0; if (enable) { - if (!kvm_dirty_bitmap) { - unsigned bitmap_size = BITMAP_SIZE(phys_ram_size); - kvm_dirty_bitmap = qemu_malloc(bitmap_size); - r = kvm_dirty_pages_log_enable_all(kvm_context); - } + r = kvm_dirty_pages_log_enable_all(kvm_context); } else { - if (kvm_dirty_bitmap) { - r = kvm_dirty_pages_log_reset(kvm_context); - qemu_free(kvm_dirty_bitmap); - kvm_dirty_bitmap = NULL; - } + r = kvm_dirty_pages_log_reset(kvm_context); } return r; }