From: Peter Krempa Date: Thu, 19 Apr 2018 13:44:36 +0000 (+0200) Subject: qemu: block: Always set discard for storage nodes X-Git-Tag: v4.4.0-rc1~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e6b60dcac50cc5254c2c54683f89ba50e67ffcd;p=thirdparty%2Flibvirt.git qemu: block: Always set discard for storage nodes Enabling discard for the storage node allows the format drivers to discard snapshots and other things, while configuration of the format layer actually decides whether to actually discard data on request from the host. Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 775c125467..3424ae5676 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1163,7 +1163,10 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src, if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, fileprops) < 0) goto cleanup; - if (virJSONValueObjectAdd(fileprops, "b:read-only", src->readonly, NULL) < 0) + if (virJSONValueObjectAdd(fileprops, + "b:read-only", src->readonly, + "s:discard", "unmap", + NULL) < 0) goto cleanup; }