From: Laszlo Ersek <lersek@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>, qemu-devel@nongnu.org
Cc: "Denis Plotnikov" <dplotnikov@virtuozzo.com>,
"Marc-André Lureau" <marcandre.lureau@gmail.com>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>,
"Stefan Weil" <sw@weilnetz.de>
Subject: Re: [Qemu-devel] [PATCH v4 1/1] qga: minimal support for fstrim for Windows guests
Date: Wed, 5 Oct 2016 21:56:03 +0200 [thread overview]
Message-ID: <d8355cf6-7473-acaf-474b-84233c126458@redhat.com> (raw)
In-Reply-To: <61bfc324-c3c6-8901-2761-1ea441786652@openvz.org>
On 10/05/16 21:47, Denis V. Lunev wrote:
> 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 <den@openvz.org>
>>> Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
>>> CC: Michael Roth <mdroth@linux.vnet.ibm.com>
>>> CC: Stefan Weil <sw@weilnetz.de>
>>> CC: Marc-André Lureau <marcandre.lureau@gmail.com>
>>> ---
>>> 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.
Thank you for explaining. And, now I've learned about "defrag /L" too :)
Cheers
Laszlo
prev parent reply other threads:[~2016-10-05 19:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 14:01 [Qemu-devel] [PATCH v4 1/1] qga: minimal support for fstrim for Windows guests Denis V. Lunev
2016-10-04 13:43 ` Marc-André Lureau
2016-10-05 11:13 ` Denis V. Lunev
2016-10-25 23:53 ` Michael Roth
2016-10-05 13:51 ` Richard W.M. Jones
2016-10-05 18:55 ` Laszlo Ersek
2016-10-05 19:47 ` Denis V. Lunev
2016-10-05 19:56 ` Laszlo Ersek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8355cf6-7473-acaf-474b-84233c126458@redhat.com \
--to=lersek@redhat.com \
--cc=den@openvz.org \
--cc=dplotnikov@virtuozzo.com \
--cc=marcandre.lureau@gmail.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.