[libvirt] [RFC PATCH 14/30] [RFC] qemu: block: Always set discard for storage nodes

Peter Krempa pkrempa at redhat.com
Thu Apr 19 15:25:11 UTC 2018


According to my research it seems that qemu always sets discard for the
storage nodes. Replicate this in our generator.
---
 src/qemu/qemu_block.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 44662a4603..0357d93384 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1155,7 +1155,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;
     }

-- 
2.14.3




More information about the libvir-list mailing list