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 <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
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;
}