4 # Check that detect-zeroes=unmap works on writes with registered I/O buffers.
5 # This is a regression test for
6 # https://gitlab.com/qemu-project/qemu/-/issues/1404 where I/O requests failed
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 owner
=stefanha@redhat.com
29 echo "QA output created by $seq"
31 status
=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
41 # get standard environment, filters and checks
47 _supported_proto generic
51 IMGSPEC
="$TEST_IMG,discard=unmap,detect-zeroes=unmap"
54 echo "== writing zero buffer to image =="
55 QEMU_IO_OPTIONS
="$QEMU_IO_OPTIONS_NO_FMT" $QEMU_IO -c "write -r -P 0 0 4k" --image-opts "$IMGSPEC" | _filter_qemu_io