Since query-blockstats provides full hierarchy of node names without any doubtful
matching algorithm, use it to make the node name detector reliable.
Unfortunately some of the changes are ugly when viewed as a diff since they
delete and rewrite chunks of code.
This series can be fetched at:
git fetch git://pipo.sk/pipo/libvirt.git node-name-detect-refactor-1
Peter Krempa (24):
qemu: monitor: Extract call of 'query-blockstats' and add new API for
it
tests: qemumonitorjson: Consolidate basic node name detection test
cases
tests: qemumonitor: Prepare for more test data in
testBlockNodeNameDetect
tests: qemumonitorjson: Drop redundant data from
testBlockNodeNameDetectFormat
tests: utils: Don't calculate file size in virTestLoadFile
util: buffer: Add virBufferStrcatVArgs
tests: utils: Add virTestLoadFilePath helper
tests: qemuhelp: convert to virTestLoadFilePath
tests: utils: Add virTestLoadFileJSON helper
tests: qemumonitorjson: simplify path handling in
testBlockNodeNameDetect
tests: qemumontitorjson: temporarily disable node name detection tests
qemu: block: Rename qemuBlockFillNodeData and move it to the top
util: storagefile: rename 'nodebacking' to 'nodestorage' in
virStorageSource
qemu: block: Refactor node name detection code
tests: Extract mock library for making hash table deterministic
tests: qemumonitorjson: Simplify node name detection test
qemu: block: store and test driver names for detected storage nodes
tests: qemumonitorjson: Add data and fix 'same-backing' node detection
case
tests: qemumonitorjson: Fix 'relative' node name detection test case
tests: qemumonitorjson: Fix 'gluster' node name detection test case
tests: qemumonitorjson: Add test case for node name detection with
blockjob
tests: qemumonitorjson: Old and empty test case for node name
detection
tests: qemumonitorjson: Test extraction of LUKS node names
tests: qemumonitorjson: Test extraction of iSCSI device node names
src/libvirt_private.syms | 1 +
src/qemu/qemu_block.c | 344 ++-
src/qemu/qemu_block.h | 12 +-
src/qemu/qemu_driver.c | 10 +-
src/qemu/qemu_monitor.c | 15 +
src/qemu/qemu_monitor.h | 2 +
src/qemu/qemu_monitor_json.c | 44 +-
src/qemu/qemu_monitor_json.h | 2 +
src/util/virbuffer.c | 27 +-
src/util/virbuffer.h | 2 +
src/util/virstoragefile.c | 6 +-
src/util/virstoragefile.h | 2 +-
tests/Makefile.am | 17 +-
tests/qemuhelptest.c | 14 +-
.../qemumonitorjson-nodename-1.result | 15 -
.../qemumonitorjson-nodename-2.json | 2270 --------------------
.../qemumonitorjson-nodename-2.result | 60 -
.../qemumonitorjson-nodename-basic-blockstats.json | 166 ++
...emumonitorjson-nodename-basic-named-nodes.json} | 18 +-
.../qemumonitorjson-nodename-basic.result | 16 +
...mumonitorjson-nodename-blockjob-blockstats.json | 301 +++
...umonitorjson-nodename-blockjob-named-nodes.json | 682 ++++++
.../qemumonitorjson-nodename-blockjob.result | 26 +
.../qemumonitorjson-nodename-empty-blockstats.json | 2 +
...qemumonitorjson-nodename-empty-named-nodes.json | 2 +
.../qemumonitorjson-nodename-empty.result | 1 +
...emumonitorjson-nodename-gluster-blockstats.json | 111 +
...umonitorjson-nodename-gluster-named-nodes.json} | 90 +-
.../qemumonitorjson-nodename-gluster.result | 19 +-
.../qemumonitorjson-nodename-iscsi-blockstats.json | 113 +
...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +
.../qemumonitorjson-nodename-iscsi.result | 13 +
.../qemumonitorjson-nodename-luks-blockstats.json | 58 +
.../qemumonitorjson-nodename-luks-named-nodes.json | 109 +
.../qemumonitorjson-nodename-luks.result | 6 +
.../qemumonitorjson-nodename-old-blockstats.json | 160 ++
.../qemumonitorjson-nodename-old-named-nodes.json | 2 +
.../qemumonitorjson-nodename-old.result | 1 +
...mumonitorjson-nodename-relative-blockstats.json | 329 +++
...monitorjson-nodename-relative-named-nodes.json} | 26 +-
.../qemumonitorjson-nodename-relative.result | 56 +-
...nitorjson-nodename-same-backing-blockstats.json | 221 ++
...torjson-nodename-same-backing-named-nodes.json} | 16 +-
.../qemumonitorjson-nodename-same-backing.result | 32 +-
tests/qemumonitorjsontest.c | 97 +-
tests/testutils.c | 101 +-
tests/testutils.h | 6 +
...{virmacmapmock.c => virdeterministichashmock.c} | 0
tests/virmacmaptest.c | 2 +-
49 files changed, 2961 insertions(+), 2778 deletions(-)
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.json
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.result
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-1.json =>
qemumonitorjson-nodename-basic-named-nodes.json} (96%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result
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
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-blockstats.json
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-gluster.json =>
qemumonitorjson-nodename-gluster-named-nodes.json} (89%)
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-blockstats.json
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks.result
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstats.json
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-relative.json =>
qemumonitorjson-nodename-relative-named-nodes.json} (97%)
create mode 100644
tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-same-backing.json =>
qemumonitorjson-nodename-same-backing-named-nodes.json} (96%)
rename tests/{virmacmapmock.c => virdeterministichashmock.c} (100%)
--
2.13.2