OSDN Git Service

qga: minimal support for fstrim for Windows guests
authorDenis V. Lunev <den@openvz.org>
Mon, 3 Oct 2016 14:01:25 +0000 (17:01 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Nov 2016 00:09:21 +0000 (19:09 -0500)
commit91274487a979b693c264be35b2ffcb703f0a104e
tree68bdcec46860d01faf3be58ccb5e2f4e22b9fc08
parente80b4b8fb6babce7dcc91ea9ddeecbc351fd4646
qga: minimal support for fstrim for Windows guests

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>
* check g_utf16_to_utf8() return value for GError handling instead
  of GError directly (Marc-AndrĂ©)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-win32.c