[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/13] qgraph: allow extra_device_opts on bus nodes
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 01/13] qgraph: allow extra_device_opts on bus nodes |
Date: |
Mon, 18 Mar 2019 18:15:09 +0100 |
Allow choosing the bus that the device will be placed on, in case
the machine has more than one. Otherwise, the bus may not match
the base address of the controller we attach it to.
Signed-off-by: Paolo Bonzini <address@hidden>
---
tests/qos-test.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/tests/qos-test.c b/tests/qos-test.c
index 6b1145eccc..c3b76d277d 100644
--- a/tests/qos-test.c
+++ b/tests/qos-test.c
@@ -340,7 +340,8 @@ static void walk_path(QOSGraphNode *orig_path, int len)
char **path_vec = g_new0(char *, (QOS_PATH_MAX_ELEMENT_SIZE * 2));
int path_vec_size = 0;
- char *after_cmd = NULL, *before_cmd = NULL, *after_device = NULL;
+ char *after_cmd, *before_cmd, *after_device;
+ GString *after_device_str = g_string_new("");
char *node_name = orig_path->name, *path_str;
GString *cmd_line = g_string_new("");
@@ -363,9 +364,8 @@ static void walk_path(QOSGraphNode *orig_path, int len)
/* append node command line + previous edge command line */
if (path->command_line && etype == QEDGE_CONSUMED_BY) {
g_string_append(cmd_line, path->command_line);
- if (after_device) {
- g_string_append(cmd_line, after_device);
- }
+ g_string_append(cmd_line, after_device_str->str);
+ g_string_truncate(after_device_str, 0);
}
path_vec[path_vec_size++] = qos_graph_edge_get_name(path->path_edge);
@@ -382,12 +382,15 @@ static void walk_path(QOSGraphNode *orig_path, int len)
if (after_cmd) {
g_string_append(cmd_line2, after_cmd);
}
+ if (after_device) {
+ g_string_append(after_device_str, after_device);
+ }
}
path_vec[path_vec_size++] = NULL;
- if (after_device) {
- g_string_append(cmd_line, after_device);
- }
+ g_string_append(cmd_line, after_device_str->str);
+ g_string_free(after_device_str, true);
+
g_string_append(cmd_line, cmd_line2->str);
g_string_free(cmd_line2, true);
--
2.20.1
- [Qemu-devel] [PATCH preliminary for 4.1 00/13] Convert I2C tests to qgraph, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 08/13] libqos: convert I2C to qgraph, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 09/13] libqos: add ARM n800 machine object, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 01/13] qgraph: allow extra_device_opts on bus nodes,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 03/13] libqos: move common i2c code to libqos, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 13/13] libqos: i2c: move address into QI2CDevice, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 11/13] tests: convert OMAP i2c tests to qgraph, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 10/13] libqos: add ARM imx25-pdk machine object, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 05/13] pca9552-test: do not rely on state across tests, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 04/13] libqos: fix omap-i2c receiving more than 4 bytes, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 02/13] qgraph: fix qos_node_contains with options, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 12/13] tests: convert ds1338-test to qtest, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 06/13] imx25-pdk: create ds1338 for qtest inside the test, Paolo Bonzini, 2019/03/18
- [Qemu-devel] [PATCH 07/13] libqos: split I2CAdapter initialization and allocation, Paolo Bonzini, 2019/03/18