3 # Test QAPI commands looking up protocol based images with relative
4 # filename backing strings
6 # Copyright (C) 2017 Red Hat, Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 owner
=jcody@redhat.com
25 echo "QA output created by $seq"
27 status
=1 # failure is the default!
32 _rm_test_img
"${TEST_DIR}/image.base"
33 _rm_test_img
"${TEST_DIR}/image.snp1"
36 trap "_cleanup; exit \$status" 0 1 2 3 15
38 # get standard environment, filters and checks
48 BASE_IMG
="${TEST_DIR}/image.base"
49 TOP_IMG
="${TEST_DIR}/image.snp1"
51 TEST_IMG_FILE
="${BASE_IMG}" _make_test_img
$size
53 TEST_IMG_FILE
="${TOP_IMG}" _make_test_img
$size
56 echo === Running QEMU
, using block-stream to
find backing image
===
59 qemu_comm_method
="qmp"
60 _launch_qemu
-drive file="${BASE_IMG}",if=virtio
,id
=disk2
63 _send_qemu_cmd
$h "{ 'execute': 'qmp_capabilities' }" "return"
65 _send_qemu_cmd
$h "{ 'arguments': {
67 'format': '${IMGFMT}',
69 'snapshot-file': '${TOP_IMG}',
70 'snapshot-node-name': 'snp1'
72 'execute': 'blockdev-snapshot-sync'
76 _send_qemu_cmd
$h "{ 'arguments': {
77 'backing-file': 'image.base',
79 'image-node-name': 'snp1'
81 'execute': 'change-backing-file'
84 _send_qemu_cmd
$h "{ 'arguments': {
85 'base': '${BASE_IMG}',
88 'execute': 'block-stream'
89 }" "BLOCK_JOB_COMPLETED"