From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Allocating Extra Memory To Guest Date: Wed, 06 May 2009 15:24:00 +0300 Message-ID: <4A018160.9080607@redhat.com> References: <3D9CB4061D1EB3408D4A0B910433453C030BABB02A@inbmail01.lsi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: "Kumar, Venkat" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:38225 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756496AbZEFMYh (ORCPT ); Wed, 6 May 2009 08:24:37 -0400 In-Reply-To: <3D9CB4061D1EB3408D4A0B910433453C030BABB02A@inbmail01.lsi.com> Sender: kvm-owner@vger.kernel.org List-ID: Kumar, Venkat wrote: > Kumar, Venkat wrote: > >> Hi, >> >> 1. How should we allocate extra memory to guest other than memory allocated through "qemu_alloc_physram"?? >> >> > > qemu_alloc_physram() is obsolete. I've just removed it to avoid > confusion (and a warning). > > ==> > If kvm-85 is the latest version, I still see "qemu_alloc_physram" invoked to allocate memory. This piece of code is in qemu/vl.c. > The really latest version is in git. See http://www.linux-kvm.org/page/Code. > I presume you want to give kvm memory which is not real RAM - from a > host device? > hw/device-assignment.c does that. > > Please clarify what you want to do. > > ==> > I want to allocate extra RAM for the guest apart from memory allocated through "qemu_alloc_physram". Let's assume that I have allocated some RAM for guest through "qemu_alloc_physram" call and some more memory through "malloc or mmap", how will I register these two virtually discontinuous memory regions with KVM? > You can use qemu_ram_alloc() and cpu_register_physical_memory(). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.