qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] [PATCH] hostmem: Add clear option to file backend


From: David Hildenbrand
Subject: Re: [External] [PATCH] hostmem: Add clear option to file backend
Date: Thu, 2 Mar 2023 12:54:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 02.03.23 12:48, Feiran Zheng wrote:


On 2 Mar 2023, at 11:39, David Hildenbrand <david@redhat.com> wrote:

On 02.03.23 12:37, Feiran Zheng wrote:
On 2 Mar 2023, at 11:31, David Hildenbrand <david@redhat.com> wrote:

On 02.03.23 12:09, Fam Zheng wrote:
This adds a memset to clear the backing memory. This is useful in the
case of PMEM DAX to drop dirty data, if the backing memory is handed
over from a previous application or firmware which didn't clean up
before exiting.

Why can't the VM manager do that instead? If you have a file that's certainly 
easily possible.
Hi David,
Technically yes, but I have a simple VM manager here which wants to avoid 
replicating the same mmap code, such as handling the flags depending on 
share=on|off,hugepages=on|off. All in all this approach requires the least 
additional code to achieve it.

so ... we're supposed to maintain that code in QEMU instead to make your life 
easier ? :)

Sorry, for this particular use case I don't see the big benefit of moving that 
code into QEMU.


I am posting because this does not only makes my life easier, supposedly it 
also make other developers life easier, because the file here can be a char 
file and there is no easy way to clear it (/dev/dax1.0) from command line if 
you want to invoke a QEMU command directly.

Maybe I’m missing a convenient command to clear a DAX char file?

Can't you simply use dd and read from /dev/zero?

--
Thanks,

David / dhildenb




reply via email to

[Prev in Thread] Current Thread [Next in Thread]