From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [patch] kvmctl.c: allow custom memory setup. Date: Thu, 18 Oct 2007 00:56:56 +0200 Message-ID: <47169338.4000908@qumranet.com> References: <470C8D28.2060408@qumranet.com> <470F2806.8090902@redhat.com> <4710701C.2040200@qumranet.com> <47134476.1050609@redhat.com> <47134857.9030102@redhat.com> <1192446374.6578.0.camel@izike-woof.qumranet.com> <47134BC0.1000008@redhat.com> <1192447442.6911.5.camel@izike-woof.qumranet.com> <47135284.1060106@redhat.com> <4715DEFC.8010507@redhat.com> <471690D2.2060204@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Avi Kivity To: Gerd Hoffmann Return-path: In-Reply-To: <471690D2.2060204-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Izik Eidus wrote: > Gerd Hoffmann wrote: >> Gerd Hoffmann wrote: >> >>> I've made kvm_create() optionally skip the memory setup, so I can >>> create >>> my own later on. That doesn't work though because creating the vcpu >>> fails then. >>> >> >> Ugh, vmx grabs last 4 pages from slot 0 (looks like for real mode >> emulation). Thus memory must exist before creating the vcpu. Which >> makes fitting filemap-backed memory into the current libkvm init >> procedure a bit difficuilt. >> >> I've decided to split the kvm_create() into a bunch of pieces which can >> be called as needed, so I can first create the vm, then do my custom >> memory setup, then create the vcpu without making vmx unhappy ... >> >> cheers, >> Gerd >> >> > hi, > why not making kvm_create_userspace_memory() recive a pointer to a > userspace allocated memory (that was allocated from file or from > normal malloc) > and make all the changes before kvm_create_userspace_memory() get called? > this way you just need to remove the memory allocation out of > kvm_create_userspace_memory() and alloc as you want. > > what you think about that? > that would bring the ability to qemu allocate the memory and send us the pointer to the allocated memory. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/