libqos/qgraph: add qos_node_create_driver_named()
authorChristian Schoenebeck <qemu_oss@crudebyte.com>
Tue, 26 Jan 2021 23:00:34 +0000 (00:00 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Feb 2021 16:15:39 +0000 (17:15 +0100)
commitf6a2c6eee77458a1f2cf6632b2d9f2fd97bf595e
tree39d554b578f6ad405adfcbc3515481d9e6be7742
parent027b524d6a427d7c89f4e8af44c49d96796adab5
libqos/qgraph: add qos_node_create_driver_named()

So far the qos subsystem of the qtest framework had the limitation
that only one instance of the same official QEMU (QMP) driver name
could be created for qtests. That's because a) the created qos
node names must always be unique, b) the node name must match the
official QEMU driver name being instantiated and c) all nodes are
in a global space shared by all tests.

This patch removes this limitation by introducing a new function
qos_node_create_driver_named() which allows test case authors to
specify a node name being different from the actual associated
QEMU driver name. It fills the new 'qemu_name' field of
QOSGraphNode for that purpose.

Adjust build_driver_cmd_line() and qos_graph_node_set_availability()
to correctly deal with either accessing node name vs. node's
qemu_name correctly.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <3be962ff38f3396f8040deaa5ffdab525c4e0b16.1611704181.git.qemu_oss@crudebyte.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/libqos/qgraph.c
tests/qtest/libqos/qgraph.h
tests/qtest/libqos/qgraph_internal.h