From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcUZn-0000rd-0d for qemu-devel@nongnu.org; Thu, 17 Sep 2015 04:29:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcUZi-000370-1b for qemu-devel@nongnu.org; Thu, 17 Sep 2015 04:29:54 -0400 Received: from mga11.intel.com ([192.55.52.93]:9553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcUZh-00036s-SV for qemu-devel@nongnu.org; Thu, 17 Sep 2015 04:29:49 -0400 References: <1439563931-12352-1-git-send-email-guangrong.xiao@linux.intel.com> <1439563931-12352-9-git-send-email-guangrong.xiao@linux.intel.com> <20150825160353.GD8344@stefanha-thinkpad.redhat.com> <55DD979A.70804@linux.intel.com> <55F8423A.3020600@redhat.com> From: Xiao Guangrong Message-ID: <55FA7896.1030907@linux.intel.com> Date: Thu, 17 Sep 2015 16:23:50 +0800 MIME-Version: 1.0 In-Reply-To: <55F8423A.3020600@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 08/18] nvdimm: init backend memory mapping and config data area List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Stefan Hajnoczi Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, rth@twiddle.net On 09/16/2015 12:07 AM, Paolo Bonzini wrote: > > > On 26/08/2015 12:40, Xiao Guangrong wrote: >>>> >>>> + >>>> + size = get_file_size(fd); >>>> + buf = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); >>> >>> I guess the user will want to choose between MAP_SHARED and MAP_PRIVATE. >>> This can be added in the future. >> >> Good idea, it will allow guest to write data but discards its content >> after it exits. Will implement O_RDONLY + MAP_PRIVATE in the near future. > > FWIW, if Igor's backend/frontend idea is implemented, the choice between > MAP_SHARED and MAP_PRIVATE should belong in the backend. Yes. I can not agree with you more! :)