summaryrefslogtreecommitdiffstats
path: root/tests/libqos/qgraph.h
diff options
context:
space:
mode:
authorPaolo Bonzini2019-03-18 17:14:12 +0100
committerPaolo Bonzini2019-06-03 14:03:01 +0200
commit7d8ada6e4d20b47dcf42d22fc62599a9799eac7a (patch)
treefd3d6e5fb000706ccb067b35026986535ac4b387 /tests/libqos/qgraph.h
parentqgraph: allow extra_device_opts on contains nodes (diff)
downloadqemu-7d8ada6e4d20b47dcf42d22fc62599a9799eac7a.tar.gz
qemu-7d8ada6e4d20b47dcf42d22fc62599a9799eac7a.tar.xz
qemu-7d8ada6e4d20b47dcf42d22fc62599a9799eac7a.zip
qgraph: fix qos_node_contains with options
Currently, if qos_node_contains was passed options, it would still create an edge without any options. Instead, in that case NULL acts as a terminator. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos/qgraph.h')
-rw-r--r--tests/libqos/qgraph.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/libqos/qgraph.h b/tests/libqos/qgraph.h
index e799095b30..3a25dda4b2 100644
--- a/tests/libqos/qgraph.h
+++ b/tests/libqos/qgraph.h
@@ -453,14 +453,16 @@ void qos_node_create_machine_args(const char *name,
void qos_node_create_driver(const char *name, QOSCreateDriverFunc function);
/**
- * qos_node_contains(): creates an edge of type QEDGE_CONTAINS and
- * adds it to the edge list mapped to @container in the
+ * qos_node_contains(): creates one or more edges of type QEDGE_CONTAINS
+ * and adds them to the edge list mapped to @container in the
* edge hash table.
*
- * This edge will have @container as source and @contained as destination.
+ * The edges will have @container as source and @contained as destination.
*
- * It also has the possibility to add optional NULL-terminated
- * @opts parameters (see %QOSGraphEdgeOptions)
+ * If @opts is NULL, a single edge will be added with no options.
+ * If @opts is non-NULL, the arguments after @contained represent a
+ * NULL-terminated list of %QOSGraphEdgeOptions structs, and an
+ * edge will be added for each of them.
*
* This function can be useful when there are multiple devices
* with the same node name contained in a machine/other node
@@ -480,7 +482,8 @@ void qos_node_create_driver(const char *name, QOSCreateDriverFunc function);
* For contains, op1.arg and op1.size_arg represent the arg to pass
* to @contained constructor to properly initialize it.
*/
-void qos_node_contains(const char *container, const char *contained, ...);
+void qos_node_contains(const char *container, const char *contained,
+ QOSGraphEdgeOptions *opts, ...);
/**
* qos_node_produces(): creates an edge of type QEDGE_PRODUCES and