vagrant-libvirt/tools
castorsky a94ce0d7b6
Add support for qemu-img v8 to create_box.sh (#1790)
Since version 8 of qemu-img tool it produces more verbose JSON-output
with multiple `virtual-size` keys which leads to incorrect generation of
`metadata.json` file (all values of `virtual-size` are placed into file
and it becomes non-valid JSON).

This behavious was described in #1746 .

Example of old JSON output:
{
    "virtual-size": 34359738368,
    "filename": "vm-100-disk-0.qcow2",
    "cluster-size": 65536,
    "format": "qcow2",
    "actual-size": 2941440,
    "format-specific": {
        "type": "qcow2",
        "data": {
            "compat": "1.1",
            "compression-type": "zlib",
            "lazy-refcounts": false,
            "refcount-bits": 16,
            "corrupt": false,
            "extended-l2": false
        }
    },
    "dirty-flag": false
}

Example of new JSON output:
{
    "children": [
        {
            "name": "file",
            "info": {
                "children": [
                ],
                "virtual-size": 42956488704,
                "filename": "/var/lib/libvirt/images/proxmox_6.4.qcow2",
                "format": "file",
                "actual-size": 1305301504,
                "format-specific": {
                    "type": "file",
                    "data": {
                    }
                },
                "dirty-flag": false
            }
        }
    ],
    "virtual-size": 42949672960,
    "filename": "/var/lib/libvirt/images/proxmox_6.4.qcow2",
    "cluster-size": 65536,
    "format": "qcow2",
    "actual-size": 1305301504,
    "format-specific": {
        "type": "qcow2",
        "data": {
            "compat": "1.1",
            "compression-type": "zlib",
            "lazy-refcounts": true,
            "refcount-bits": 16,
            "corrupt": false,
            "extended-l2": false
        }
    },
    "dirty-flag": false
}

This change adds comatibility in a fast-fix-way: awk regex gets in account
only `virtual-size` key on the first level of `qemu-img info`
JSON-output.
2023-12-27 21:45:00 +00:00
..
create_box_with_two_disks.sh Corrections to two test testing tool (#1276) 2021-05-14 19:11:33 +01:00
create_box.sh Add support for qemu-img v8 to create_box.sh (#1790) 2023-12-27 21:45:00 +00:00
prepare_redhat_for_box.sh Replace remaining stray references with main (#1582) 2022-09-07 10:50:28 +00:00