#!/usr/bin/env bash
#
# Test reopening a backing image after block-stream and block-commit
#
# Copyright (C) 2018 Igalia, S.L.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# creator
owner=berto@igalia.com

seq=`basename $0`
echo "QA output created by $seq"

here=`pwd`
status=1	# failure is the default!

_cleanup()
{
    _cleanup_test_img
    _rm_test_img "$TEST_IMG.base"
    _rm_test_img "$TEST_IMG.int"
}
trap "_cleanup; exit \$status" 0 1 2 3 15

# get standard environment, filters and checks
. ./common.rc
. ./common.filter
. ./common.qemu

# Any format implementing BlockDriver.bdrv_change_backing_file
_supported_fmt qcow2 qed
_supported_proto file fuse
_supported_os Linux

IMG_SIZE=1M

# Create the images
TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE
TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT
_make_test_img -b "$TEST_IMG.int" -F $IMGFMT -F $IMGFMT

# First test: reopen $TEST.IMG changing the detect-zeroes option on
# its backing file ($TEST_IMG.int).
echo
echo "*** Change an option on the backing file"
echo
_launch_qemu -drive if=none,file="${TEST_IMG}"
_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'qmp_capabilities' }" \
    'return'

_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'human-monitor-command',
       'arguments': { 'command-line':
                      'qemu-io none0 \"reopen -o backing.detect-zeroes=on\"' } }" \
    "return"

_cleanup_qemu

# Second test: stream $TEST_IMG.base into $TEST_IMG.int and then
# reopen $TEST.IMG changing the detect-zeroes option on its new
# backing file ($TEST_IMG.base).
echo
echo "*** Stream and then change an option on the backing file"
echo
_launch_qemu -drive if=none,file="${TEST_IMG}"
_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'qmp_capabilities' }" \
    'return'

_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'block-stream', \
       'arguments': { 'device': 'none0',
                      'base': '${TEST_IMG}.base' } }" \
    'return'

# Wait for block-stream to finish
sleep 0.5

_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'human-monitor-command',
       'arguments': { 'command-line':
                      'qemu-io none0 \"reopen -o backing.detect-zeroes=on\"' } }" \
    "return"

_cleanup_qemu

# Third test: commit $TEST_IMG.int into $TEST_IMG.base and then reopen
# $TEST.IMG changing the detect-zeroes option on its new backing file
# ($TEST_IMG.base).
echo
echo "*** Commit and then change an option on the backing file"
echo
# Create the images again
TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE
TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT
_make_test_img -b "$TEST_IMG.int" -F $IMGFMT

_launch_qemu -drive if=none,file="${TEST_IMG}"
_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'qmp_capabilities' }" \
    'return'

_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'block-commit', \
       'arguments': { 'device': 'none0',
                      'top': '${TEST_IMG}.int' } }" \
    'return'

# Wait for block-commit to finish
sleep 0.5

_send_qemu_cmd $QEMU_HANDLE \
    "{ 'execute': 'human-monitor-command',
       'arguments': { 'command-line':
                      'qemu-io none0 \"reopen -o backing.detect-zeroes=on\"' } }" \
    "return"

_cleanup_qemu

# success, all done
echo "*** done"
rm -f $seq.full
status=0
