From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v2 08/18] nvdimm: init backend memory mapping and config data area Date: Thu, 17 Sep 2015 16:23:50 +0800 Message-ID: <55FA7896.1030907@linux.intel.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 To: Paolo Bonzini , Stefan Hajnoczi Return-path: In-Reply-To: <55F8423A.3020600@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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! :)