#!/usr/bin/env python3
#
# Test parallels load bitmap
#
# Copyright (c) 2021 Virtuozzo International GmbH.
#
# 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/>.
#

import iotests
from iotests import qemu_nbd_popen, qemu_img_map, log, file_path

iotests.script_initialize(supported_fmts=['parallels'])

nbd_sock = file_path('nbd-sock', base_dir=iotests.sock_dir)
disk = iotests.file_path('disk')
bitmap = 'e4f2eed0-37fe-4539-b50b-85d2e7fd235f'
nbd_opts = f'driver=nbd,server.type=unix,server.path={nbd_sock}' \
        f',x-dirty-bitmap=qemu:dirty-bitmap:{bitmap}'


iotests.unarchive_sample_image('parallels-with-bitmap', disk)


with qemu_nbd_popen('--read-only', f'--socket={nbd_sock}',
                    f'--bitmap={bitmap}', '-f', iotests.imgfmt, disk):
    chunks = qemu_img_map('--image-opts', nbd_opts)
    cluster = 64 * 1024

    log('dirty clusters (cluster size is 64K):')
    for c in chunks:
        assert c['start'] % cluster == 0
        assert c['length'] % cluster == 0
        if c['data']:
            continue

        a = c['start'] // cluster
        b = (c['start'] + c['length']) // cluster
        if b - a > 1:
            log(f'{a}-{b-1}')
        else:
            log(a)
