#!/usr/bin/env python
#
# Copyright (C) 2018 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: Stefan Hajnoczi <stefanha@redhat.com>
#
# Check that the runtime NBD server does not crash when stopped after
# blockdev-snapshot-sync.

import iotests

with iotests.FilePath('disk.img') as disk_img_path, \
     iotests.FilePath('disk-snapshot.img') as disk_snapshot_img_path, \
     iotests.FilePath('nbd.sock') as nbd_sock_path, \
     iotests.VM() as vm:

    img_size = '10M'
    iotests.qemu_img_create('-f', iotests.imgfmt, disk_img_path, img_size)

    iotests.log('Launching VM...')
    (vm.add_drive(disk_img_path, 'node-name=drive0-node', interface='none')
       .launch())

    iotests.log('Starting NBD server...')
    iotests.log(vm.qmp('nbd-server-start', addr={
            "type": "unix",
            "data": {
                "path": nbd_sock_path,
            }
        }))

    iotests.log('Adding NBD export...')
    iotests.log(vm.qmp('nbd-server-add', device='drive0-node', writable=True))

    iotests.log('Creating external snapshot...')
    iotests.log(vm.qmp('blockdev-snapshot-sync',
        node_name='drive0-node',
        snapshot_node_name='drive0-snapshot-node',
        snapshot_file=disk_snapshot_img_path))

    iotests.log('Stopping NBD server...')
    iotests.log(vm.qmp('nbd-server-stop'))
