@samitouri / QOSamiQemu / commits / 84525ece68

tests/9p: add virtio_9p_add_synth_driver_args() test client function

Add virtio_9p_add_synth_driver_args() to allow appending custom QEMU options for individual 9p synth tests. Link: https://lore.kernel.org/qemu-devel/7fe3eca5d17292464676b68d0513052564cd432a.1781361555.git.qemu_oss@crudebyte.com Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>

Christian Schoenebeck committed Jun 13, 2026 at 16:55 UTC 84525ece6817f4e9760a1d484cab01123a546e92
2 files changed +12
tests/qtest/libqos/virtio-9p.c
+6
@@ -228,6 +228,12 @@ static void regex_replace(GString *haystack, const char *pattern,
228 g_string_assign(haystack, s);
229 }
230
231 +void virtio_9p_add_synth_driver_args(GString *cmd_line, const char *args)
232 +{
233 + /* append passed args to '-fsdev ...' group */
234 + regex_replace(cmd_line, "(-fsdev \\w[^ ]*)", "\\1,%s", args);
235 +}
236 +
237 void virtio_9p_assign_local_driver(GString *cmd_line, const char *args)
238 {
239 g_assert_nonnull(local_test_path);
tests/qtest/libqos/virtio-9p.h
+6
@@ -44,6 +44,12 @@ struct QVirtio9PDevice {
44 QVirtio9P v9p;
45 };
46
47 +/**
48 + * Add required test specific args to the QEMU command line for the 9pfs
49 + * 'synth' fs driver.
50 + */
51 +void virtio_9p_add_synth_driver_args(GString *cmd_line, const char *args);
52 +
53 /**
54 * Creates the directory for the 9pfs 'local' filesystem driver to access.
55 */