4 # Test NBD export with -incoming (non-shared storage migration use case from
7 # Copyright (C) 2017 Red Hat, Inc.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 echo "QA output created by $seq"
29 status
=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
39 # get standard environment, filters and checks
44 _supported_fmt generic
47 if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then
48 _notrun
"Requires a PC machine"
54 if test "$IMGOPTSSYNTAX" = "true"
56 DRIVE_ARG
=if=ide
,id
=drive0
,$TEST_IMG
58 DRIVE_ARG
=if=ide
,id
=drive0
,format
=$IMGFMT,file=$TEST_IMG
61 qemu_comm_method
="monitor"
62 _launch_qemu
-drive $DRIVE_ARG -incoming defer
64 if [ "${VALGRIND_QEMU}" == "y" ]; then
70 _send_qemu_cmd
$h "nbd_server_start unix:$SOCK_DIR/nbd" "(qemu)"
71 _send_qemu_cmd
$h "nbd_server_add -w drive0" "(qemu)"
72 _send_qemu_cmd
$h "q" "(qemu)"