render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
3807f0
From 9cccc94408d59ddd8f3b999bb62e133d443987f5 Mon Sep 17 00:00:00 2001
3807f0
From: Peter Krempa <pkrempa@redhat.com>
3807f0
Date: Tue, 27 Jul 2021 19:12:09 +0200
3807f0
Subject: [PATCH] qemu: block: Use 'discard': 'unmap' for the copy-on-read
3807f0
 block filter
3807f0
3807f0
---
3807f0
 src/qemu/qemu_block.c                                       | 1 +
3807f0
 tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args | 2 +-
3807f0
 2 files changed, 2 insertions(+), 1 deletion(-)
3807f0
3807f0
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
3807f0
index 1610f72d07..4691dff4f7 100644
3807f0
--- a/src/qemu/qemu_block.c
3807f0
+++ b/src/qemu/qemu_block.c
3807f0
@@ -2157,6 +2157,7 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk)
3807f0
                                           "s:driver", "copy-on-read",
3807f0
                                           "s:node-name", priv->nodeCopyOnRead,
3807f0
                                           "s:file", disk->src->nodeformat,
3807f0
+                                          "s:discard", "unmap",
3807f0
                                           NULL));
3807f0
 
3807f0
     return ret;
3807f0
diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args
3807f0
index 93d3a06c88..690d4f3ea1 100644
3807f0
--- a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args
3807f0
+++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args
3807f0
@@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-test/.config \
3807f0
 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \
3807f0
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/f14.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
3807f0
 -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage"}' \
3807f0
--blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vda","file":"libvirt-2-format"}' \
3807f0
+-blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vda","file":"libvirt-2-format","discard":"unmap"}' \
3807f0
 -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=libvirt-CoR-vda,id=virtio-disk0,bootindex=2 \
3807f0
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
3807f0
 -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \
3807f0
-- 
3807f0
2.32.0
3807f0