[Qemu-devel] [RFC 2/7] block: Let change-medium add detect-zeroes as bool

Max Reitz posted 7 patches 7 years, 5 months ago
[Qemu-devel] [RFC 2/7] block: Let change-medium add detect-zeroes as bool
Posted by Max Reitz 7 years, 5 months ago
There is no reason to use the wrong type here.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 blockdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blockdev.c b/blockdev.c
index c31bf3d98d..76f811c415 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2654,7 +2654,7 @@ void qmp_blockdev_change_medium(bool has_device, const char *device,
 
     options = qdict_new();
     detect_zeroes = blk_get_detect_zeroes_from_root_state(blk);
-    qdict_put_str(options, "detect-zeroes", detect_zeroes ? "on" : "off");
+    qdict_put_bool(options, "detect-zeroes", detect_zeroes);
 
     if (has_format) {
         qdict_put_str(options, "driver", format);
-- 
2.14.3