From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGTsJ-0008S0-5F for qemu-devel@nongnu.org; Wed, 19 Oct 2011 07:00:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGTs9-0005tC-FN for qemu-devel@nongnu.org; Wed, 19 Oct 2011 06:59:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGTs8-0005s9-Q5 for qemu-devel@nongnu.org; Wed, 19 Oct 2011 06:59:45 -0400 From: Avi Kivity Date: Wed, 19 Oct 2011 12:59:17 +0200 Message-Id: <1319021966-25613-10-git-send-email-avi@redhat.com> In-Reply-To: <1319021966-25613-1-git-send-email-avi@redhat.com> References: <1319021966-25613-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 09/18] s390-virtio: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org Signed-off-by: Avi Kivity --- hw/s390-virtio.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 778cffe..60c66e9 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -29,6 +29,7 @@ #include "hw/virtio.h" #include "hw/sysbus.h" #include "kvm.h" +#include "exec-memory.h" #include "hw/s390-virtio-bus.h" @@ -128,7 +129,8 @@ static void s390_init(ram_addr_t my_ram_size, const char *cpu_model) { CPUState *env = NULL; - ram_addr_t ram_addr; + MemoryRegion *sysmem = get_system_memory(); + MemoryRegion *ram = g_new(MemoryRegion, 1); ram_addr_t kernel_size = 0; ram_addr_t initrd_offset; ram_addr_t initrd_size = 0; @@ -150,8 +152,8 @@ static void s390_init(ram_addr_t my_ram_size, s390_bus = s390_virtio_bus_init(&my_ram_size); /* allocate RAM */ - ram_addr = qemu_ram_alloc(NULL, "s390.ram", my_ram_size); - cpu_register_physical_memory(0, my_ram_size, ram_addr); + memory_region_init_ram(ram, NULL, "s390.ram", my_ram_size); + memory_region_add_subregion(sysmem, 0, ram); /* allocate storage keys */ storage_keys = g_malloc0(my_ram_size / TARGET_PAGE_SIZE); -- 1.7.6.3