diff options
author | Chris Laplante <chris@laplante.io> | 2023-08-22 17:31:00 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-08-22 17:31:00 +0100 |
commit | a8610f8bd7465a9c30c206074d47dd3f387b5b9a (patch) | |
tree | c218d47b7b29ca0099972b3c76400452a644f971 /tests/qtest | |
parent | 7458dcf4e64249af961243cb1619858a242ec15e (diff) | |
download | qemu-a8610f8bd7465a9c30c206074d47dd3f387b5b9a.zip qemu-a8610f8bd7465a9c30c206074d47dd3f387b5b9a.tar.gz qemu-a8610f8bd7465a9c30c206074d47dd3f387b5b9a.tar.bz2 |
qtest: implement named interception of out-GPIO
Adds qtest_irq_intercept_out_named method, which utilizes a new optional
name parameter to the irq_intercept_out qtest command.
Signed-off-by: Chris Laplante <chris@laplante.io>
Message-id: 20230728160324.1159090-4-chris@laplante.io
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/qtest')
-rw-r--r-- | tests/qtest/libqtest.c | 6 | ||||
-rw-r--r-- | tests/qtest/libqtest.h | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index c22dfc3..471529e 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -993,6 +993,12 @@ void qtest_irq_intercept_out(QTestState *s, const char *qom_path) qtest_rsp(s); } +void qtest_irq_intercept_out_named(QTestState *s, const char *qom_path, const char *name) +{ + qtest_sendf(s, "irq_intercept_out %s %s\n", qom_path, name); + qtest_rsp(s); +} + void qtest_irq_intercept_in(QTestState *s, const char *qom_path) { qtest_sendf(s, "irq_intercept_in %s\n", qom_path); diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index 3a71bc4..e53e350 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -372,6 +372,17 @@ void qtest_irq_intercept_in(QTestState *s, const char *string); void qtest_irq_intercept_out(QTestState *s, const char *string); /** + * qtest_irq_intercept_out_named: + * @s: #QTestState instance to operate on. + * @qom_path: QOM path of a device. + * @name: Name of the GPIO out pin + * + * Associate a qtest irq with the named GPIO-out pin of the device + * whose path is specified by @string and whose name is @name. + */ +void qtest_irq_intercept_out_named(QTestState *s, const char *qom_path, const char *name); + +/** * qtest_set_irq_in: * @s: QTestState instance to operate on. * @string: QOM path of a device |