From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Sharing variables/memory between host and guest ? Date: Sun, 13 Jul 2008 13:10:28 +0300 Message-ID: <4879D494.7020803@qumranet.com> References: <896ae46a0807111716u49fda2d7uf6481aa6c09daa90@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Arn Return-path: Received: from il.qumranet.com ([212.179.150.194]:44424 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407AbYGMKKa (ORCPT ); Sun, 13 Jul 2008 06:10:30 -0400 In-Reply-To: <896ae46a0807111716u49fda2d7uf6481aa6c09daa90@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Arn wrote: > How can one share memory (a few variables not necessarily a page) > between host/hypervisor and guest VM ? > Since the guest is just a process within the host, there should be > existing ways to do this. > What about using something like debugfs or sysfs, is it possible to > share variables this way ? Note, I want a system that > is fast, i.e. changes to shared variable/memory should be visible instantly. > > I search the kvm-devel archives and found emails referring to "kshmem" > but a search on the kvm-70 code turns up nothing. > There are also some emails on sharing a page but no final outcome or > what exactly to do. > > If you use the -mem-path qemu option, all guest memory will be in a file on tmpfs. You can mmap that file and access all guest memory. Of course, this is hitting the problem with a fairly bit hammer; more refined approaches are possible. -- error compiling committee.c: too many arguments to function