qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 1/1] qga: minimal support for fstrim for Wind


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH v4 1/1] qga: minimal support for fstrim for Windows guests
Date: Wed, 5 Oct 2016 22:47:48 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 10/05/2016 09:55 PM, Laszlo Ersek wrote:
> On 10/03/16 16:01, Denis V. Lunev wrote:
>> Unfortunately, there is no public Windows API to start trimming the
>> filesystem. The only viable way here is to call 'defrag.exe /L' for
>> each volume.
>>
>> This is working since Win8 and Win2k12.
>>
>> Signed-off-by: Denis V. Lunev <address@hidden>
>> Signed-off-by: Denis Plotnikov <address@hidden>
>> CC: Michael Roth <address@hidden>
>> CC: Stefan Weil <address@hidden>
>> CC: Marc-André Lureau <address@hidden>
>> ---
>>  qga/commands-win32.c | 97 
>> ++++++++++++++++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 94 insertions(+), 3 deletions(-)
> Just to educate myself (really, you can ignore my question as "review
> comment", because it's not one): why is this necessary? In Windows 8 and
> Windows Server 2012 R2, simply putting your NTFS filesystem on a SCSI
> disk (such as virtio-scsi-pci / scsi-hd) or AHCI, and specifying
> discard=on for the -drive, will result in the guest automatically
> trimming the NTFS (with a little delay) after deleting files, and the
> host getting those blocks back.
The same as for Linux. But if the one exact block has been freed
by half at one operation and by another half in the different operation
as far as I could understand it will not be freed.

This patch implements the ability to trim all the disc as done for Linux
to go over all the disc and discard all possible areas. I think that this
would be useful f.e. to prepare template images.

Den



reply via email to

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