Bug 1612114 - Anonymous BlockBackends are missing in query-blockstats
Summary: Anonymous BlockBackends are missing in query-blockstats
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: CongLi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-03 13:43 UTC by Kevin Wolf
Modified: 2018-11-01 11:15 UTC (History)
14 users (show)

Fixed In Version: qemu-kvm-rhev-2.12.0-10.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-01 11:13:16 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3443 None None None 2018-11-01 11:15:34 UTC

Description Kevin Wolf 2018-08-03 13:43:44 UTC
If a block device is configured with -blockdev and -device rather than -drive (and therefore the associated BlockBackend doesn't have a -drive ID, but is anonymous), query-blockstats fails to list it.

Additionally, there is no way to unambiguously relate the stats without a BlockBackend name (which would be included as 'device'). Therefore, a new field 'qdev' is needed that contains the ID of the qdev device that the BlockBackend belongs to.

This is fixed in upstream commits 5a9cb5a97f and 567dcb31f2.

Comment 3 Miroslav Rezanina 2018-08-10 10:53:47 UTC
Fix included in qemu-kvm-rhev-2.12.0-10.el7

Comment 5 CongLi 2018-08-16 11:22:49 UTC
Verified this bug on: qemu-kvm-rhev-2.12.0-10.el7.x86_64


1. blockstats with -drive if=virtio  --> device is virtio, there is filed 'qdev' of virtio device: "qdev": "/machine/peripheral-anon/device[0]/virtio-backend" via 'query-blockstats', which same as 'query-block'.

QEMU CML: -drive driver=null-co,if=virtio
{ "execute": "query-blockstats"}
{
    "return": [
        {
            "device": "virtio0",
            "stats": {
                "flush_total_time_ns": 0,
                "wr_highest_offset": 0,
                "wr_total_time_ns": 0,
                "failed_wr_operations": 0,
                "failed_rd_operations": 0,
                "wr_merged": 0,
                "wr_bytes": 0,
                "timed_stats": [
                ],
                "failed_flush_operations": 0,
                "account_invalid": true,
                "rd_total_time_ns": 44141,
                "flush_operations": 0,
                "wr_operations": 0,
                "rd_merged": 0,
                "rd_bytes": 512,
                "invalid_flush_operations": 0,
                "account_failed": true,
                "idle_time_ns": 38804814834,
                "rd_operations": 1,
                "invalid_wr_operations": 0,
                "invalid_rd_operations": 0
            },
            "node-name": "#block022",
            "qdev": "/machine/peripheral-anon/device[0]/virtio-backend"
        },
...}

2. blockstats with -drive if=none  --> device is none, the output is same as 'query-block'.
QEMU CML: -drive driver=null-co,if=none
{ "execute": "query-blockstats"}
{
    "return": [
        {
            "device": "none0",
            "stats": {
                "flush_total_time_ns": 0,
                "wr_highest_offset": 0,
                "wr_total_time_ns": 0,
                "failed_wr_operations": 0,
                "failed_rd_operations": 0,
                "wr_merged": 0,
                "wr_bytes": 0,
                "timed_stats": [
                ],
                "failed_flush_operations": 0,
                "account_invalid": true,
                "rd_total_time_ns": 0,
                "flush_operations": 0,
                "wr_operations": 0,
                "rd_merged": 0,
                "rd_bytes": 0,
                "invalid_flush_operations": 0,
                "account_failed": true,
                "rd_operations": 0,
                "invalid_wr_operations": 0,
                "invalid_rd_operations": 0
            },
            "node-name": "#block099"
        },
...}

3. blockstats with -blockdev  --> no device info, which same as 'query-block'.
QEMU CML: -blockdev driver=null-co,node-name=null
{ "execute": "query-blockstats"}
{...}

4. blockstats with -blockdev and -device  --> device is null, there is filed 'qdev' of virtio device: "qdev": ""qdev": "/machine/peripheral/virtio0/virtio-backend"" via 'query-blockstats', which same as 'query-block'.
QEMU CML: -blockdev driver=null-co,node-name=null -device virtio-blk,drive=null,id=virtio0
{ "execute": "query-blockstats"}
{
    "return": [
        ...
        {
            "device": "",
            "stats": {
                "flush_total_time_ns": 0,
                "wr_highest_offset": 0,
                "wr_total_time_ns": 0,
                "failed_wr_operations": 0,
                "failed_rd_operations": 0,
                "wr_merged": 0,
                "wr_bytes": 0,
                "timed_stats": [
                ],
                "failed_flush_operations": 0,
                "account_invalid": false,
                "rd_total_time_ns": 42959,
                "flush_operations": 0,
                "wr_operations": 0,
                "rd_merged": 0,
                "rd_bytes": 512,
                "invalid_flush_operations": 0,
                "account_failed": false,
                "idle_time_ns": 40574708168,
                "rd_operations": 1,
                "invalid_wr_operations": 0,
                "invalid_rd_operations": 0
            },
            "node-name": "null",
            "qdev": "/machine/peripheral/virtio0/virtio-backend"
        }
    ]
}

qemu-iotests of 227 pass.
227        
Passed all 1 tests

Comment 6 errata-xmlrpc 2018-11-01 11:13:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3443


Note You need to log in before you can comment on or make changes to this bug.