From patchwork Mon Jun 27 18:19:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 922032 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5RILTDc021783 for ; Mon, 27 Jun 2011 18:21:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370Ab1F0SUw (ORCPT ); Mon, 27 Jun 2011 14:20:52 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:60765 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336Ab1F0SUl (ORCPT ); Mon, 27 Jun 2011 14:20:41 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate02.web.de (Postfix) with ESMTP id 6B0801A3CD672; Mon, 27 Jun 2011 20:20:27 +0200 (CEST) Received: from [2.204.233.154] (helo=localhost.localdomain) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QbGQ6-0007wf-00; Mon, 27 Jun 2011 20:20:27 +0200 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , Alex Williamson Subject: [PATCH 05/13] qemu-kvm: Remove qemu_ram_unmap Date: Mon, 27 Jun 2011 20:19:48 +0200 Message-Id: <267b0d259bcfcf48bc9dd2be3d14febe9b9189cd.1309198794.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+0QMp8kJm4i9qi65lZ+QcFozJzNHZufnt5gm+7 g0Xcz8yqtSP6Apc4DPfC6CdeTvdi/xp6l//be9Z+NqMgW42v8n 2SpRcN1Rg= 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Jun 2011 18:21:56 +0000 (UTC) From: Jan Kiszka Upstream gained identical qemu_ram_free_from_ptr. Signed-off-by: Jan Kiszka --- cpu-common.h | 1 - exec.c | 13 ------------- hw/device-assignment.c | 2 +- 3 files changed, 1 insertions(+), 15 deletions(-) diff --git a/cpu-common.h b/cpu-common.h index 1ccf2f4..b027e43 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -60,7 +60,6 @@ ram_addr_t cpu_get_physical_page_desc(target_phys_addr_t addr); ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name, ram_addr_t size, void *host); ram_addr_t qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size); -void qemu_ram_unmap(ram_addr_t addr); void qemu_ram_free(ram_addr_t addr); void qemu_ram_free_from_ptr(ram_addr_t addr); void qemu_ram_remap(ram_addr_t addr, ram_addr_t length); diff --git a/exec.c b/exec.c index c728290..68f5b33 100644 --- a/exec.c +++ b/exec.c @@ -2982,19 +2982,6 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name, return new_block->offset; } -void qemu_ram_unmap(ram_addr_t addr) -{ - RAMBlock *block; - - QLIST_FOREACH(block, &ram_list.blocks, next) { - if (addr == block->offset) { - QLIST_REMOVE(block, next); - qemu_free(block); - return; - } - } -} - ram_addr_t qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size) { return qemu_ram_alloc_from_ptr(dev, name, size, NULL); diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 6a2a8c9..36ad6b0 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -836,7 +836,7 @@ static void free_assigned_device(AssignedDevice *dev) if (region->r_size & 0xFFF) { cpu_unregister_io_memory(region->memory_index); } else { - qemu_ram_unmap(region->memory_index); + qemu_ram_free_from_ptr(region->memory_index); } if (munmap(region->u.r_virtbase, (pci_region->size + 0xFFF) & 0xFFFFF000)) {