qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

query-block command is missing device name. Deprecated?


From: Mike Lee
Subject: query-block command is missing device name. Deprecated?
Date: Thu, 30 Jan 2020 21:06:11 -0700
User-agent: Evolution 3.34.3

Hello All,

I've discovered that when I run the command "query-block" command, the
"device:" attribute's value is now blank.  I use this to help execute
incremental backups of my VMs. In previous versions this worked but now
that I'm on a rolling distro I no longer receive this info.  I'm
wondering if this is a bug or intended, and if so why.  Details of my
findings are below.


PREVIOUS SYSTEM:
Distro: Mint 19.1
Kernel: 4.15.0-74-generic #84-Ubuntu SMP
Virsh ver: 4.0
QEMU Version: 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.21)

In the old Mint distro I could run something like the below to create
the dirty bitmap and then kick-off a backup (I'm aware I can combine
the two into one trasaction but I am separating them out here for
readability):

CREATE BITMAP: (drive-virtio-disk0 was the "device" name that was
always returned by the qemu-monitor "query-block" command.)
--------------------------------------------------------------------
virsh qemu-monitor-command manjaro-xfce --pretty \
'{"execute": "transaction",' \
'    "arguments":' \
'    {' \
'        "actions":' \
'        [' \
'            {"type": "block-dirty-bitmap-add",' \
'             "data": {"node": "drive-virtio-disk0", "name":
"bitmap0"}' \
'            }' \
'        ]' \
'    }' \
'}'
--------------------------------------------------------------------

KICK-OFF BACKUP:
--------------------------------------------------------------------
virsh qemu-monitor-command manjaro-xfce --pretty \
'{"execute": "transaction",' \
'    "arguments":' \
'    {' \
'        "actions":' \
'        [' \
'            {"type": "drive-backup",' \
'             "data": {"device": "drive-virtio-disk0",' \
'                      "target": "/libvirt-backups/manjaro-xfce-full-
backup.qcow2",' \
'                      "sync": "full", "format": "qcow2"' \
'                     }' \
'            }' \
'        ]' \
'    }' \
'}'
--------------------------------------------------------------------


CURRENT SYSTEM:
Distro: Manjaro
Kernel: 5.4.15-2-MANJARO #1 SMP PREEMPT
Virsh ver: 5.10.0
QEMU Version: 4.2.0

Now when I run the above command to create the dirty bitmap I get:
------------------------------------------------------------------
virsh qemu-monitor-command manjaro-xfce --pretty \
> '{"execute": "transaction",' \
> '    "arguments":' \
> '    {' \
> '        "actions":' \
> '        [' \
> '            {"type": "block-dirty-bitmap-add",' \
> '             "data": {"node": "drive-virtio-disk0", "name":
"bitmap0"}' \
> '            }' \
> '        ]' \
> '    }' \
> '}'
{
  "id": "libvirt-389",
  "error": {
    "class": "GenericError",
    "desc": "Cannot find device=drive-virtio-disk0 nor node_name=drive-
virtio-disk0"
  }
}
------------------------------------------------------------------


Querying the manjaro-xfce VM for block info I get the below.  NOTE the
blank "device" entry.  Previously this was populated with "drive-
virtio-disk0"  .  So what do I use for the device now on the new
version of qemu?

------------------------------------------------------------------
virsh qemu-monitor-command manjaro-xfce --pretty '{"execute":"query-
block"}'
{
  "return": [
    {
      "io-status": "ok",
 --->> "device": "", <<-----
      "locked": false,
      "removable": false,
      "inserted": {
        "iops_rd": 0,
        "detect_zeroes": "off",
        "image": {
          "virtual-size": 8589934592,
          "filename": "/var/lib/libvirt/images/manjaro-xfce.qcow2",
          "cluster-size": 65536,
          "format": "qcow2",
          "actual-size": 8591200256,
          "format-specific": {
            "type": "qcow2",
            "data": {
              "compat": "1.1",
              "lazy-refcounts": true,
              "refcount-bits": 16,
              "corrupt": false
            }
          },
          "dirty-flag": false
        },
        "iops_wr": 0,
        "ro": false,
        "node-name": "libvirt-3-format",
        "backing_file_depth": 0,
        "drv": "qcow2",
        "iops": 0,
        "bps_wr": 0,
        "write_threshold": 0,
        "encrypted": false,
        "bps": 0,
        "bps_rd": 0,
        "cache": {
          "no-flush": false,
          "direct": false,
          "writeback": true
        },
        "file": "/var/lib/libvirt/images/manjaro-xfce.qcow2",
        "encryption_key_missing": false
      },
      "qdev": "/machine/peripheral/virtio-disk0/virtio-backend",
      "type": "unknown"
    },
    {
      "io-status": "ok",
      "device": "",
      "locked": false,
      "removable": false,
      "inserted": {
        "iops_rd": 0,
        "detect_zeroes": "off",
        "image": {
          "virtual-size": 2147483648,
          "filename": "/var/lib/libvirt/images/manjaro-xfce-1.qcow2",
          "cluster-size": 65536,
          "format": "qcow2",
          "actual-size": 2148020224,
          "format-specific": {
            "type": "qcow2",
            "data": {
              "compat": "1.1",
              "lazy-refcounts": true,
              "refcount-bits": 16,
              "corrupt": false
            }
          },
          "dirty-flag": false
        },
        "iops_wr": 0,
        "ro": false,
        "node-name": "libvirt-2-format",
        "backing_file_depth": 0,
        "drv": "qcow2",
        "iops": 0,
        "bps_wr": 0,
        "write_threshold": 0,
        "encrypted": false,
        "bps": 0,
        "bps_rd": 0,
        "cache": {
          "no-flush": false,
          "direct": false,
          "writeback": true
        },
        "file": "/var/lib/libvirt/images/manjaro-xfce-1.qcow2",
        "encryption_key_missing": false
      },
      "qdev": "/machine/peripheral/virtio-disk1/virtio-backend",
      "type": "unknown"
    },
    {
      "io-status": "ok",
      "device": "",
      "locked": false,
      "removable": true,
      "qdev": "sata0-0-0",
      "tray_open": false,
      "type": "unknown"
    }
  ],
  "id": "libvirt-390"
}
------------------------------------------------------------------

After talking with others on the QEMU irc channel, they mentioned
trying the "node-name" value for the node.  Makes sense.  This worked
for creating the dirty bitmap, but I still receive an error when trying
to kick-off the actual backup:

CREATE DIRTY BITMAP WITH NODE-NAME:
------------------------------------------------------------------
virsh qemu-monitor-command manjaro-xfce --pretty \
> '{"execute": "transaction",' \
> '    "arguments":' \
> '    {' \
> '        "actions":' \
> '        [' \
> '            {"type": "block-dirty-bitmap-add",' \
> '             "data": {"node": "libvirt-2-format", "name":
"bitmap0"}' \
> '            }' \
> '        ]' \
> '    }' \
> '}'
{
  "return": {

  },
  "id": "libvirt-391"
}
------------------------------------------------------------------


KICK-OFF THE BACKUP (see error):
------------------------------------------------------------------
virsh qemu-monitor-command manjaro-xfce --pretty \
> '{"execute": "transaction",' \
> '    "arguments":' \
> '    {' \
> '        "actions":' \
> '        [' \
> '            {"type": "drive-backup",' \
> '             "data": {"device": "libvirt-2-format",' \
> '                      "target": "/libvirt-
backups/manjaro_xfce_backup_full_01.qcow2",' \
> '                      "sync": "full", "format": "qcow2"' \
> '                     }' \
> '            }' \
> '        ]' \
> '    }' \
> '}'
{
  "id": "libvirt-392",
  "error": {
    "class": "GenericError",
    "desc": "Invalid job ID ''"
  }
}
------------------------------------------------------------------

The above backup command actually starts the backup although an error
is thrown:
------------------------------------------------------------------
ls -lh /libvirt-backups/
total 196K
-rw-r--r-- 1 nobody kvm 193K Jan 30 20:49
manjaro_xfce_backup_full_01.qcow2
------------------------------------------------------------------


IN CLOSING:
1.) I suspect the error I get when starting the backup is simply a bug.
Am I correct in assuming this, since the backup actually starts?  If
I'm wrong what do I need to change to not get the error?
2.) Has the "device" attribute in the "query-block" command been
deprecated and is that why that attribute's value is now blank?  I've
gone back through all of the QEMU release notes and see no mention of
this.  
3.) What's with the "libvirt-X-format" node name?  The "drive-virtio-
diskX" seemed more logical.  Is this naming change a libvirt thing and
not qemu?

Keep up the great work and thanks for such a great piece of software!

Mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]