qemu 2.9 returns an extra layer in the backing data if a block job is
active. Add a test case to see whether our code properly detects and
ignores such layer.
---
...mumonitorjson-nodename-blockjob-blockstats.json | 301 +++++++++
...umonitorjson-nodename-blockjob-named-nodes.json | 682 +++++++++++++++++++++
.../qemumonitorjson-nodename-blockjob.result | 26 +
tests/qemumonitorjsontest.c | 1 +
4 files changed, 1010 insertions(+)
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
new file mode 100644
index 000000000..51cd664c2
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
@@ -0,0 +1,301 @@
+[
+ {
+ "device": "drive-ide0-0-0",
+ "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": 99763,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 512,
+ "invalid_flush_operations": 0,
+ "account_failed": true,
+ "idle_time_ns": 1142142388760097,
+ "rd_operations": 1,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "backing": {
+ "parent": {
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "node-name": "#block042"
+ },
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "backing": {
+ "parent": {
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "node-name": "#block259"
+ },
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "backing": {
+ "parent": {
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "node-name": "#block449"
+ },
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "backing": {
+ "parent": {
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "node-name": "#block618"
+ },
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "backing": {
+ "parent": {
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "node-name": "#block846"
+ },
+ "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": 0,
+ "flush_operations": 0,
+ "wr_operations": 0,
+ "rd_merged": 0,
+ "rd_bytes": 0,
+ "invalid_flush_operations": 0,
+ "account_failed": false,
+ "rd_operations": 0,
+ "invalid_wr_operations": 0,
+ "invalid_rd_operations": 0
+ },
+ "node-name": "#block901"
+ },
+ "node-name": "#block717"
+ },
+ "node-name": "#block551"
+ },
+ "node-name": "#block312"
+ },
+ "node-name": "#block179"
+ },
+ "node-name": "#block3343"
+ }
+]
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
new file mode 100644
index 000000000..3cebb23a9
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
@@ -0,0 +1,682 @@
+[
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "backing-image": {
+ "backing-image": {
+ "backing-image": {
+ "backing-image": {
+ "backing-image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "raw",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "backing-filename-format": "raw",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/c",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename":
"/var/lib/libvirt/images/a",
+ "backing-filename": "/var/lib/libvirt/images/a",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/c",
+ "backing-filename": "/var/lib/libvirt/images/c",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d.1499152668",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/d",
+ "backing-filename": "/var/lib/libvirt/images/d",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d.1499152698",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename":
"/var/lib/libvirt/images/d.1499152668",
+ "backing-filename":
"/var/lib/libvirt/images/d.1499152668",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d.1499152698",
+ "format": "mirror_top",
+ "full-backing-filename":
"/var/lib/libvirt/images/d.1499152698",
+ "backing-filename": "/var/lib/libvirt/images/d.1499152698"
+ },
+ "iops_wr": 0,
+ "ro": false,
+ "node-name": "#block3343",
+ "backing_file_depth": 5,
+ "drv": "mirror_top",
+ "iops": 0,
+ "bps_wr": 0,
+ "write_threshold": 0,
+ "backing_file": "/var/lib/libvirt/images/d.1499152698",
+ "encrypted": false,
+ "bps": 0,
+ "bps_rd": 0,
+ "cache": {
+ "no-flush": false,
+ "direct": false,
+ "writeback": true
+ },
+ "file": "/var/lib/libvirt/images/d.1499152698",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 10485760,
+ "filename": "/tmp/kkt",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 266240,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": false,
+ "node-name": "#block3243",
+ "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": "/tmp/kkt",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 327680,
+ "filename": "/tmp/kkt",
+ "format": "file",
+ "actual-size": 266240,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": false,
+ "node-name": "#block3144",
+ "backing_file_depth": 0,
+ "drv": "file",
+ "iops": 0,
+ "bps_wr": 0,
+ "write_threshold": 0,
+ "encrypted": false,
+ "bps": 0,
+ "bps_rd": 0,
+ "cache": {
+ "no-flush": false,
+ "direct": false,
+ "writeback": true
+ },
+ "file": "/tmp/kkt",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "raw",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block901",
+ "backing_file_depth": 0,
+ "drv": "raw",
+ "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/a",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "file",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block846",
+ "backing_file_depth": 0,
+ "drv": "file",
+ "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/a",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "backing-image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "raw",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "backing-filename-format": "raw",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/c",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/a",
+ "backing-filename": "/var/lib/libvirt/images/a",
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block717",
+ "backing_file_depth": 1,
+ "drv": "qcow2",
+ "iops": 0,
+ "bps_wr": 0,
+ "write_threshold": 0,
+ "backing_file": "/var/lib/libvirt/images/a",
+ "encrypted": false,
+ "bps": 0,
+ "bps_rd": 0,
+ "cache": {
+ "no-flush": false,
+ "direct": false,
+ "writeback": true
+ },
+ "file": "/var/lib/libvirt/images/c",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 197120,
+ "filename": "/var/lib/libvirt/images/c",
+ "format": "file",
+ "actual-size": 200704,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block618",
+ "backing_file_depth": 0,
+ "drv": "file",
+ "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/c",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "backing-image": {
+ "backing-image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "raw",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "backing-filename-format": "raw",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/c",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/a",
+ "backing-filename": "/var/lib/libvirt/images/a",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/c",
+ "backing-filename": "/var/lib/libvirt/images/c",
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block551",
+ "backing_file_depth": 2,
+ "drv": "qcow2",
+ "iops": 0,
+ "bps_wr": 0,
+ "write_threshold": 0,
+ "backing_file": "/var/lib/libvirt/images/c",
+ "encrypted": false,
+ "bps": 0,
+ "bps_rd": 0,
+ "cache": {
+ "no-flush": false,
+ "direct": false,
+ "writeback": true
+ },
+ "file": "/var/lib/libvirt/images/d",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 197120,
+ "filename": "/var/lib/libvirt/images/d",
+ "format": "file",
+ "actual-size": 200704,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block449",
+ "backing_file_depth": 0,
+ "drv": "file",
+ "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/d",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "backing-image": {
+ "backing-image": {
+ "backing-image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "raw",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "backing-filename-format": "raw",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/c",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/a",
+ "backing-filename": "/var/lib/libvirt/images/a",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/c",
+ "backing-filename": "/var/lib/libvirt/images/c",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d.1499152668",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/d",
+ "backing-filename": "/var/lib/libvirt/images/d",
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block312",
+ "backing_file_depth": 3,
+ "drv": "qcow2",
+ "iops": 0,
+ "bps_wr": 0,
+ "write_threshold": 0,
+ "backing_file": "/var/lib/libvirt/images/d",
+ "encrypted": false,
+ "bps": 0,
+ "bps_rd": 0,
+ "cache": {
+ "no-flush": false,
+ "direct": false,
+ "writeback": true
+ },
+ "file": "/var/lib/libvirt/images/d.1499152668",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 197120,
+ "filename": "/var/lib/libvirt/images/d.1499152668",
+ "format": "file",
+ "actual-size": 200704,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": true,
+ "node-name": "#block259",
+ "backing_file_depth": 0,
+ "drv": "file",
+ "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/d.1499152668",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "backing-image": {
+ "backing-image": {
+ "backing-image": {
+ "backing-image": {
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/a",
+ "format": "raw",
+ "actual-size": 0,
+ "dirty-flag": false
+ },
+ "backing-filename-format": "raw",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/c",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/a",
+ "backing-filename": "/var/lib/libvirt/images/a",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/c",
+ "backing-filename": "/var/lib/libvirt/images/c",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d.1499152668",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename": "/var/lib/libvirt/images/d",
+ "backing-filename": "/var/lib/libvirt/images/d",
+ "dirty-flag": false
+ },
+ "backing-filename-format": "qcow2",
+ "virtual-size": 10485760,
+ "filename": "/var/lib/libvirt/images/d.1499152698",
+ "cluster-size": 65536,
+ "format": "qcow2",
+ "actual-size": 200704,
+ "format-specific": {
+ "type": "qcow2",
+ "data": {
+ "compat": "1.1",
+ "lazy-refcounts": false,
+ "refcount-bits": 16,
+ "corrupt": false
+ }
+ },
+ "full-backing-filename":
"/var/lib/libvirt/images/d.1499152668",
+ "backing-filename": "/var/lib/libvirt/images/d.1499152668",
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": false,
+ "node-name": "#block179",
+ "backing_file_depth": 4,
+ "drv": "qcow2",
+ "iops": 0,
+ "bps_wr": 0,
+ "write_threshold": 0,
+ "backing_file": "/var/lib/libvirt/images/d.1499152668",
+ "encrypted": false,
+ "bps": 0,
+ "bps_rd": 0,
+ "cache": {
+ "no-flush": false,
+ "direct": false,
+ "writeback": true
+ },
+ "file": "/var/lib/libvirt/images/d.1499152698",
+ "encryption_key_missing": false
+ },
+ {
+ "iops_rd": 0,
+ "detect_zeroes": "off",
+ "image": {
+ "virtual-size": 197120,
+ "filename": "/var/lib/libvirt/images/d.1499152698",
+ "format": "file",
+ "actual-size": 200704,
+ "dirty-flag": false
+ },
+ "iops_wr": 0,
+ "ro": false,
+ "node-name": "#block042",
+ "backing_file_depth": 0,
+ "drv": "file",
+ "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/d.1499152698",
+ "encryption_key_missing": false
+ }
+]
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
new file mode 100644
index 000000000..4abe6f934
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
@@ -0,0 +1,26 @@
+drive-ide0-0-0
+filename : '/var/lib/libvirt/images/d.1499152698'
+format node : '#block179'
+format drv : 'qcow2'
+storage node: '#block042'
+storage drv : 'file'
+ filename : '/var/lib/libvirt/images/d.1499152668'
+ format node : '#block312'
+ format drv : 'qcow2'
+ storage node: '#block259'
+ storage drv : 'file'
+ filename : '/var/lib/libvirt/images/d'
+ format node : '#block551'
+ format drv : 'qcow2'
+ storage node: '#block449'
+ storage drv : 'file'
+ filename : '/var/lib/libvirt/images/c'
+ format node : '#block717'
+ format drv : 'qcow2'
+ storage node: '#block618'
+ storage drv : 'file'
+ filename : '/var/lib/libvirt/images/a'
+ format node : '#block901'
+ format drv : 'raw'
+ storage node: '#block846'
+ storage drv : 'file'
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 8edb3f121..0601c1188 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2930,6 +2930,7 @@ mymain(void)
DO_TEST_BLOCK_NODE_DETECT("same-backing");
DO_TEST_BLOCK_NODE_DETECT("relative");
DO_TEST_BLOCK_NODE_DETECT("gluster");
+ DO_TEST_BLOCK_NODE_DETECT("blockjob");
#undef DO_TEST_BLOCK_NODE_DETECT
--
2.13.2