From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: Mapping guest memory from another process? Date: Wed, 4 Sep 2013 10:47:46 +0200 Message-ID: <20130904084746.GA9654@stefanha-thinkpad.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Cutter 409 Return-path: Received: from mail-ea0-f173.google.com ([209.85.215.173]:63669 "EHLO mail-ea0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934392Ab3IDIru (ORCPT ); Wed, 4 Sep 2013 04:47:50 -0400 Received: by mail-ea0-f173.google.com with SMTP id g10so9736eak.4 for ; Wed, 04 Sep 2013 01:47:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Sep 03, 2013 at 07:56:33PM -0400, Cutter 409 wrote: > I'm working on a tool that needs the ability to map the physical > memory of a virtual machine into its own address space. With Xen, I > can simply call xc_map_foreign_pages(). > > Is there something similar for KVM? So far, I can only figure out how > to do it if I were the process that created the VM (then I could > mmap() the handle of the virtual machine). Is there a way for an > outside process to do this? You can get QEMU to do a shared mapping of a files as guest RAM using -mem-path and -mem-prealloc, see man qemu. Stefan