From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Sharing variables/memory between host and guest ? Date: Sat, 19 Jul 2008 11:29:31 +0300 Message-ID: <4881A5EB.4040000@qumranet.com> References: <896ae46a0807111716u49fda2d7uf6481aa6c09daa90@mail.gmail.com> <4879D494.7020803@qumranet.com> <896ae46a0807141443p78df612csb5801d8ae7af17ca@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]:14127 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751786AbYGSI3d (ORCPT ); Sat, 19 Jul 2008 04:29:33 -0400 In-Reply-To: <896ae46a0807141443p78df612csb5801d8ae7af17ca@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 ? >>> >>> >> 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. >> > > Could you outline the other approaches ? > > Have qemu expose the shared memory as a pci device, and write a guest driver to exploit it. This is what the vga emulation does. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.