1, &error_abort);
qemu_opt_set(opts, "backend", "console", &error_abort);
- chr = qemu_chr_new_from_opts(opts, NULL);
+ chr = qemu_chr_new_from_opts(opts, NULL, NULL);
g_assert_nonnull(chr);
qemu_chr_write_all(chr, (const uint8_t *)"CONSOLE", 7);
CharBackend be;
int ret;
- chr = qemu_chr_new("label", "stdio");
+ chr = qemu_chr_new("label", "stdio", NULL);
g_assert_nonnull(chr);
qemu_chr_fe_init(&be, chr, &error_abort);
qemu_opt_set(opts, "backend", "ringbuf", &error_abort);
qemu_opt_set(opts, "size", "5", &error_abort);
- chr = qemu_chr_new_from_opts(opts, NULL);
+ chr = qemu_chr_new_from_opts(opts, NULL, NULL);
g_assert_null(chr);
qemu_opts_del(opts);
1, &error_abort);
qemu_opt_set(opts, "backend", "ringbuf", &error_abort);
qemu_opt_set(opts, "size", "2", &error_abort);
- chr = qemu_chr_new_from_opts(opts, &error_abort);
+ chr = qemu_chr_new_from_opts(opts, NULL, &error_abort);
g_assert_nonnull(chr);
qemu_opts_del(opts);
1, &error_abort);
qemu_opt_set(opts, "backend", "memory", &error_abort);
qemu_opt_set(opts, "size", "2", &error_abort);
- chr = qemu_chr_new_from_opts(opts, NULL);
+ chr = qemu_chr_new_from_opts(opts, NULL, NULL);
g_assert_nonnull(chr);
object_unparent(OBJECT(chr));
qemu_opts_del(opts);
qemu_opt_set(opts, "backend", "ringbuf", &error_abort);
qemu_opt_set(opts, "size", "128", &error_abort);
qemu_opt_set(opts, "mux", "on", &error_abort);
- chr = qemu_chr_new_from_opts(opts, &error_abort);
+ chr = qemu_chr_new_from_opts(opts, NULL, &error_abort);
g_assert_nonnull(chr);
qemu_opts_del(opts);
CharBackend client_be;
Chardev *chr_client;
Chardev *chr = qemu_chr_new("server",
- "websocket:127.0.0.1:0,server,nowait");
+ "websocket:127.0.0.1:0,server,nowait", NULL);
const char handshake[] = "GET / HTTP/1.1\r\n"
"Upgrade: websocket\r\n"
"Connection: Upgrade\r\n"
qemu_chr_fe_set_handlers(&be, websock_server_can_read, websock_server_read,
NULL, NULL, chr, NULL, true);
- chr_client = qemu_chr_new("client", tmp);
+ chr_client = qemu_chr_new("client", tmp, NULL);
qemu_chr_fe_init(&client_be, chr_client, &error_abort);
qemu_chr_fe_set_handlers(&client_be, websock_client_can_read,
websock_client_read,
}
tmp = g_strdup_printf("pipe:%s", pipe);
- chr = qemu_chr_new("pipe", tmp);
+ chr = qemu_chr_new("pipe", tmp, NULL);
g_assert_nonnull(chr);
g_free(tmp);
int port;
sock = make_udp_socket(&port);
tmp = g_strdup_printf("udp:127.0.0.1:%d", port);
- chr = qemu_chr_new("client", tmp);
+ chr = qemu_chr_new("client", tmp, NULL);
g_assert_nonnull(chr);
be = g_alloca(sizeof(CharBackend));
opts = qemu_opts_parse_noisily(qemu_find_opts("chardev"),
optstr, true);
g_assert_nonnull(opts);
- chr = qemu_chr_new_from_opts(opts, &error_abort);
+ chr = qemu_chr_new_from_opts(opts, NULL, &error_abort);
qemu_opts_del(opts);
g_assert_nonnull(chr);
g_assert(!object_property_get_bool(OBJECT(chr), "connected", &error_abort));
opts = qemu_opts_parse_noisily(qemu_find_opts("chardev"),
optstr, true);
g_assert_nonnull(opts);
- chr = qemu_chr_new_from_opts(opts, &error_abort);
+ chr = qemu_chr_new_from_opts(opts, NULL, &error_abort);
qemu_opts_del(opts);
g_assert_nonnull(chr);
qemu_opt_set(opts, "backend", "serial", &error_abort);
qemu_opt_set(opts, "path", "/dev/null", &error_abort);
- chr = qemu_chr_new_from_opts(opts, NULL);
+ chr = qemu_chr_new_from_opts(opts, NULL, NULL);
g_assert_nonnull(chr);
/* TODO: add more tests with a pty */
object_unparent(OBJECT(chr));
/* test tty alias */
qemu_opt_set(opts, "backend", "tty", &error_abort);
- chr = qemu_chr_new_from_opts(opts, NULL);
+ chr = qemu_chr_new_from_opts(opts, NULL, NULL);
g_assert_nonnull(chr);
object_unparent(OBJECT(chr));
g_assert_cmpint(ret, ==, 8);
chr = qemu_chardev_new("label-file", TYPE_CHARDEV_FILE, &backend,
- &error_abort);
+ NULL, &error_abort);
qemu_chr_fe_init(&be, chr, &error_abort);
qemu_chr_fe_set_handlers(&be,
out = g_build_filename(tmp_path, "out", NULL);
file.out = out;
chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend,
- &error_abort);
+ NULL, &error_abort);
}
ret = qemu_chr_write_all(chr, (uint8_t *)"hello!", 6);
g_assert_cmpint(ret, ==, 6);
chr = qemu_chr_find("label-null");
g_assert_null(chr);
- chr = qemu_chr_new("label-null", "null");
+ chr = qemu_chr_new("label-null", "null", NULL);
chr = qemu_chr_find("label-null");
g_assert_nonnull(chr);
{
Chardev *chr;
g_setenv("QTEST_SILENT_ERRORS", "1", 1);
- chr = qemu_chr_new("label-invalid", "invalid");
+ chr = qemu_chr_new("label-invalid", "invalid", NULL);
g_assert_null(chr);
g_unsetenv("QTEST_SILENT_ERRORS");
}
chr_args = g_strdup_printf("udp:127.0.0.1:%d", port);
- chr = qemu_chr_new("chardev", chr_args);
+ chr = qemu_chr_new("chardev", chr_args, NULL);
qemu_chr_fe_init(&be, chr, &error_abort);
/* check that chardev operates correctly */