mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
xen_disk: add discard support
Implement discard support for xen_disk. It makes use of the existing discard code in qemu. The discard support is enabled unconditionally. The tool stack may provide a property "discard-enable" in the backend node to optionally disable discard support. This is helpful in case the backing file was intentionally created non-sparse to avoid fragmentation. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
parent
8b6bb0ad17
commit
f31352041b
3 changed files with 52 additions and 0 deletions
|
@ -144,6 +144,13 @@ static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
|
|||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
/* The followings are only to compile op_discard related code on older
|
||||
* Xen releases. */
|
||||
#define BLKIF_OP_DISCARD 5
|
||||
struct blkif_request_discard {
|
||||
uint64_t nr_sectors;
|
||||
uint64_t sector_number;
|
||||
};
|
||||
#else
|
||||
static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
|
||||
uint64_t addr, uint32_t data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue