Skip to content

Compatible with qemu 6.x #187

@ssikiki

Description

@ssikiki

virsh qemu-monitor-command DOMAIN --pretty '{ "execute": "query-block" }'

In Ubuntu20, QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.21)
"dirty-bitmaps" and "inserted" are at the same level of BlockInfo, match qmp/raw/autogen.go BlockInfo

{
  "return": [
    {
      "io-status": "ok",
      "device": "",
      "locked": false,
      "removable": false,
      "inserted": {
        "iops_rd": 0,
        "detect_zeroes": "off",
        "image": {
          "backing-image": {
            "virtual-size": 21474836480,
            "filename": "/opt/image/centos7.8-v2020052001.qcow2",
            "cluster-size": 65536,
            "format": "qcow2",
            "actual-size": 3677552640,
            "format-specific": {
              "type": "qcow2",
              "data": {
                "compat": "1.1",
                "lazy-refcounts": false,
                "refcount-bits": 16,
                "corrupt": false
              }
            },
            "dirty-flag": false
          },
          "backing-filename-format": "qcow2",
          "virtual-size": 21474836480,
          "filename": "/opt/vol/ssd/077a9e18-076f-49ab-a062-c937f7f5da3c",
          "cluster-size": 65536,
          "format": "qcow2",
          "actual-size": 277377024,
          "format-specific": {
            "type": "qcow2",
            "data": {
              "compat": "1.1",
              "lazy-refcounts": false,
              "refcount-bits": 16,
              "corrupt": false
            }
          },
          "full-backing-filename": "/opt/image/centos7.8-v2020052001.qcow2",
          "backing-filename": "/opt/image/centos7.8-v2020052001.qcow2",
          "dirty-flag": false
        },
        "iops_wr": 0,
        "ro": false,
        "node-name": "libvirt-1-format",
        "backing_file_depth": 1,
        "drv": "qcow2",
        "iops": 0,
        "bps_wr": 0,
        "write_threshold": 0,
        "backing_file": "/opt/image/centos7.8-v2020052001.qcow2",
        "dirty-bitmaps": [
          {
            "name": "bm_usr_tmp",
            "recording": true,
            "persistent": false,
            "busy": false,
            "status": "active",
            "granularity": 65536,
            "count": 917504
          }
        ],
        "encrypted": false,
        "bps": 0,
        "bps_rd": 0,
        "cache": {
          "no-flush": false,
          "direct": false,
          "writeback": true
        },
        "file": "/opt/vol/ssd/077a9e18-076f-49ab-a062-c937f7f5da3c",
        "encryption_key_missing": false
      },
      "qdev": "/machine/peripheral/virtio-disk0/virtio-backend",
      "dirty-bitmaps": [
        {
          "name": "bm_usr_tmp",
          "recording": true,
          "persistent": false,
          "busy": false,
          "status": "active",
          "granularity": 65536,
          "count": 917504
        }
      ],
      "type": "unknown"
    }
  ],
  "id": "libvirt-375"
}

But in Ubuntu22, QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.3)
"dirty-bitmaps" is a key in "inserted", so BlockInfo struct mismatch

{
  "return": [
    {
      "io-status": "ok",
      "device": "",
      "locked": false,
      "removable": false,
      "inserted": {
        "iops_rd": 0,
        "detect_zeroes": "off",
        "image": {
          "backing-image": {
            "virtual-size": 21474836480,
            "filename": "/opt/image/centos7.7-public-v2020030501.qcow2",
            "cluster-size": 65536,
            "format": "qcow2",
            "actual-size": 2468417536,
            "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
          },
          "backing-filename-format": "qcow2",
          "virtual-size": 21474836480,
          "filename": "/opt/vol/sas/e2946f38-bad5-49e1-9985-1e9f79d1f83f",
          "cluster-size": 65536,
          "format": "qcow2",
          "actual-size": 27865088,
          "format-specific": {
            "type": "qcow2",
            "data": {
              "compat": "1.1",
              "compression-type": "zlib",
              "lazy-refcounts": false,
              "refcount-bits": 16,
              "corrupt": false,
              "extended-l2": false
            }
          },
          "full-backing-filename": "/opt/image/centos7.7-public-v2020030501.qcow2",
          "backing-filename": "/opt/image/centos7.7-public-v2020030501.qcow2",
          "dirty-flag": false
        },
        "iops_wr": 0,
        "ro": false,
        "node-name": "libvirt-1-format",
        "backing_file_depth": 1,
        "drv": "qcow2",
        "iops": 0,
        "bps_wr": 0,
        "write_threshold": 0,
        "backing_file": "/opt/image/centos7.7-public-v2020030501.qcow2",
        "dirty-bitmaps": [
          {
            "name": "bm_usr_tmp",
            "recording": true,
            "persistent": false,
            "busy": false,
            "granularity": 65536,
            "count": 2686976
          }
        ],
        "encrypted": false,
        "bps": 0,
        "bps_rd": 0,
        "cache": {
          "no-flush": false,
          "direct": false,
          "writeback": true
        },
        "file": "/opt/vol/sas/e2946f38-bad5-49e1-9985-1e9f79d1f83f"
      },
      "qdev": "/machine/peripheral/virtio-disk0/virtio-backend",
      "type": "unknown"
    }
  ],
  "id": "libvirt-413"
}

According to https://wiki.qemu.org/ChangeLog/6.0

The dirty-bitmaps field has been removed from the BlockInfo struct

It looks like this module needs some changes to adapt to the new version of qemu?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions