#!/usr/bin/env bash
#
# Test exiting qemu while jobs are still running
#
# Copyright (C) 2017 Red Hat, Inc.
#
# 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=kwolf@redhat.com

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

status=1 # failure is the default!

_cleanup()
{
    rm -f "${TEST_IMG}.mid"
    rm -f "${TEST_IMG}.copy"
    _cleanup_test_img
    _cleanup_qemu
}
trap "_cleanup; exit \$status" 0 1 2 3 15

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

_supported_fmt qcow2
_supported_proto file
_supported_os Linux

size=64M
TEST_IMG="${TEST_IMG}.base" _make_test_img $size

echo
echo === Starting VM ===
echo

qemu_comm_method="qmp"

_launch_qemu \
    -drive file="${TEST_IMG}.base",cache=$CACHEMODE,driver=$IMGFMT,id=disk
h=$QEMU_HANDLE
_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return'

echo
echo === Creating backing chain ===
echo

_send_qemu_cmd $h \
    "{ 'execute': 'blockdev-snapshot-sync',
       'arguments': { 'device': 'disk',
                      'snapshot-file': '$TEST_IMG.mid',
                      'format': '$IMGFMT',
                      'mode': 'absolute-paths' } }" \
    "return"

_send_qemu_cmd $h \
    "{ 'execute': 'human-monitor-command',
       'arguments': { 'command-line':
                      'qemu-io disk \"write 0 4M\"' } }" \
    "return"

_send_qemu_cmd $h \
    "{ 'execute': 'blockdev-snapshot-sync',
       'arguments': { 'device': 'disk',
                      'snapshot-file': '$TEST_IMG',
                      'format': '$IMGFMT',
                      'mode': 'absolute-paths' } }" \
    "return"

echo
echo === Start commit job and exit qemu ===
echo

# Note that the reference output intentionally includes the 'offset' field in
# BLOCK_JOB_* events for all of the following block jobs. They are predictable
# and any change in the offsets would hint at a bug in the job throttling code.
#
# In order to achieve these predictable offsets, all of the following tests
# use speed=65536. Each job will perform exactly one iteration before it has
# to sleep at least for a second, which is plenty of time for the 'quit' QMP
# command to be received (after receiving the command, the rest runs
# synchronously, so jobs can arbitrarily continue or complete).
#
# The buffer size for commit and streaming is 512k (waiting for 8 seconds after
# the first request), for active commit and mirror it's large enough to cover
# the full 4M, and for backup it's the qcow2 cluster size, which we know is
# 64k. As all of these are at least as large as the speed, we are sure that the
# offset advances exactly once before qemu exits.

_send_qemu_cmd $h \
    "{ 'execute': 'block-commit',
       'arguments': { 'device': 'disk',
                      'base':'$TEST_IMG.base',
                      'top': '$TEST_IMG.mid',
                      'speed': 65536 } }" \
    "return"

# If we don't sleep here 'quit' command races with disk I/O
sleep 0.5

# Ignore the JOB_STATUS_CHANGE events while shutting down the VM. Depending on
# the timing, jobs may or may not transition through a paused state.
_send_qemu_cmd $h "{ 'execute': 'quit' }" "return"
wait=1 _cleanup_qemu | grep -v 'JOB_STATUS_CHANGE'

echo
echo === Start active commit job and exit qemu ===
echo

_launch_qemu \
    -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk
h=$QEMU_HANDLE
_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return'

_send_qemu_cmd $h \
    "{ 'execute': 'block-commit',
       'arguments': { 'device': 'disk',
                      'base':'$TEST_IMG.base',
                      'speed': 65536 } }" \
    "return"

# If we don't sleep here 'quit' command races with disk I/O
sleep 0.5

_send_qemu_cmd $h "{ 'execute': 'quit' }" "return"
wait=1 _cleanup_qemu | grep -v 'JOB_STATUS_CHANGE'

echo
echo === Start mirror job and exit qemu ===
echo

_launch_qemu \
    -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk
h=$QEMU_HANDLE
_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return'

_send_qemu_cmd $h \
    "{ 'execute': 'drive-mirror',
       'arguments': { 'device': 'disk',
                      'target': '$TEST_IMG.copy',
                      'format': '$IMGFMT',
                      'sync': 'full',
                      'speed': 65536 } }" \
    "return"

# If we don't sleep here 'quit' command may be handled before
# the first mirror iteration is done
sleep 0.5

_send_qemu_cmd $h "{ 'execute': 'quit' }" "return"
wait=1 _cleanup_qemu | grep -v 'JOB_STATUS_CHANGE'

echo
echo === Start backup job and exit qemu ===
echo

_launch_qemu \
    -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk
h=$QEMU_HANDLE
_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return'

_send_qemu_cmd $h \
    "{ 'execute': 'drive-backup',
       'arguments': { 'device': 'disk',
                      'target': '$TEST_IMG.copy',
                      'format': '$IMGFMT',
                      'sync': 'full',
                      'speed': 65536 } }" \
    "return"

# If we don't sleep here 'quit' command races with disk I/O
sleep 0.5

_send_qemu_cmd $h "{ 'execute': 'quit' }" "return"
wait=1 _cleanup_qemu | grep -v 'JOB_STATUS_CHANGE'

echo
echo === Start streaming job and exit qemu ===
echo

_launch_qemu \
    -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk
h=$QEMU_HANDLE
_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return'

_send_qemu_cmd $h \
    "{ 'execute': 'block-stream',
       'arguments': { 'device': 'disk',
                      'speed': 65536 } }" \
    "return"

# If we don't sleep here 'quit' command races with disk I/O
sleep 0.5

_send_qemu_cmd $h "{ 'execute': 'quit' }" "return"
wait=1 _cleanup_qemu | grep -v 'JOB_STATUS_CHANGE'

_check_test_img

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