storage: Add TRIM algorithm to storage volume API

This new algorithm adds support for wiping volumes using TRIM.

It does not overwrite all the data in a volume, but it tells the
backing storage pool/driver that all bytes in a volume can be
discarded.

It depends on the backing storage pool how this is handled.

A SCSI backend might send UNMAP commands to remove all data present
on a LUN.

A Ceph backend might use rbd_discard() to instruct the Ceph cluster
that all data on that RBD volume can be discarded.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
This commit is contained in:
Wido den Hollander
2016-01-27 11:20:07 +01:00
committed by John Ferlan
parent f226ecbfbb
commit 63cdc92f04
5 changed files with 22 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
* Description: Provides APIs for the management of storage pools and volumes
* Author: Daniel Veillard <veillard@redhat.com>
*
* Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -153,6 +153,9 @@ typedef enum {
VIR_STORAGE_VOL_WIPE_ALG_RANDOM = 8, /* 1-pass random */
VIR_STORAGE_VOL_WIPE_ALG_TRIM = 9, /* 1-pass, trim all data on the
volume by using TRIM or DISCARD */
# ifdef VIR_ENUM_SENTINELS
VIR_STORAGE_VOL_WIPE_ALG_LAST
/*