diff options
Diffstat (limited to 'chardev')
-rw-r--r-- | chardev/char-socket.c | 34 | ||||
-rw-r--r-- | chardev/char-udp.c | 10 |
2 files changed, 22 insertions, 22 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 9d5f062c62..f872f48655 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -52,7 +52,7 @@ typedef struct { int *write_msgfds; size_t write_msgfds_num; - SocketAddress *addr; + SocketAddressLegacy *addr; bool is_listen; bool is_telnet; bool is_tn3270; @@ -356,27 +356,27 @@ static void tcp_chr_free_connection(Chardev *chr) s->connected = 0; } -static char *SocketAddress_to_str(const char *prefix, SocketAddress *addr, +static char *SocketAddress_to_str(const char *prefix, SocketAddressLegacy *addr, bool is_listen, bool is_telnet) { switch (addr->type) { - case SOCKET_ADDRESS_KIND_INET: + case SOCKET_ADDRESS_LEGACY_KIND_INET: return g_strdup_printf("%s%s:%s:%s%s", prefix, is_telnet ? "telnet" : "tcp", addr->u.inet.data->host, addr->u.inet.data->port, is_listen ? ",server" : ""); break; - case SOCKET_ADDRESS_KIND_UNIX: + case SOCKET_ADDRESS_LEGACY_KIND_UNIX: return g_strdup_printf("%sunix:%s%s", prefix, addr->u.q_unix.data->path, is_listen ? ",server" : ""); break; - case SOCKET_ADDRESS_KIND_FD: + case SOCKET_ADDRESS_LEGACY_KIND_FD: return g_strdup_printf("%sfd:%s%s", prefix, addr->u.fd.data->str, is_listen ? ",server" : ""); break; - case SOCKET_ADDRESS_KIND_VSOCK: + case SOCKET_ADDRESS_LEGACY_KIND_VSOCK: return g_strdup_printf("%svsock:%s:%s", prefix, addr->u.vsock.data->cid, addr->u.vsock.data->port); @@ -796,7 +796,7 @@ static void char_socket_finalize(Object *obj) g_source_remove(s->reconnect_timer); s->reconnect_timer = 0; } - qapi_free_SocketAddress(s->addr); + qapi_free_SocketAddressLegacy(s->addr); if (s->listen_tag) { g_source_remove(s->listen_tag); s->listen_tag = 0; @@ -859,7 +859,7 @@ static void qmp_chardev_open_socket(Chardev *chr, { SocketChardev *s = SOCKET_CHARDEV(chr); ChardevSocket *sock = backend->u.socket.data; - SocketAddress *addr = sock->addr; + SocketAddressLegacy *addr = sock->addr; bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; bool is_listen = sock->has_server ? sock->server : true; bool is_telnet = sock->has_telnet ? sock->telnet : false; @@ -905,11 +905,11 @@ static void qmp_chardev_open_socket(Chardev *chr, } } - s->addr = QAPI_CLONE(SocketAddress, sock->addr); + s->addr = QAPI_CLONE(SocketAddressLegacy, sock->addr); qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_RECONNECTABLE); /* TODO SOCKET_ADDRESS_FD where fd has AF_UNIX */ - if (addr->type == SOCKET_ADDRESS_KIND_UNIX) { + if (addr->type == SOCKET_ADDRESS_LEGACY_KIND_UNIX) { qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_FD_PASS); } @@ -945,7 +945,7 @@ static void qmp_chardev_open_socket(Chardev *chr, goto error; } - qapi_free_SocketAddress(s->addr); + qapi_free_SocketAddressLegacy(s->addr); s->addr = socket_local_address(sioc->fd, errp); update_disconnected_filename(s); @@ -985,7 +985,7 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, const char *host = qemu_opt_get(opts, "host"); const char *port = qemu_opt_get(opts, "port"); const char *tls_creds = qemu_opt_get(opts, "tls-creds"); - SocketAddress *addr; + SocketAddressLegacy *addr; ChardevSocket *sock; backend->type = CHARDEV_BACKEND_KIND_SOCKET; @@ -1022,14 +1022,14 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, sock->reconnect = reconnect; sock->tls_creds = g_strdup(tls_creds); - addr = g_new0(SocketAddress, 1); + addr = g_new0(SocketAddressLegacy, 1); if (path) { UnixSocketAddress *q_unix; - addr->type = SOCKET_ADDRESS_KIND_UNIX; + addr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX; q_unix = addr->u.q_unix.data = g_new0(UnixSocketAddress, 1); q_unix->path = g_strdup(path); } else { - addr->type = SOCKET_ADDRESS_KIND_INET; + addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; addr->u.inet.data = g_new(InetSocketAddress, 1); *addr->u.inet.data = (InetSocketAddress) { .host = g_strdup(host), @@ -1051,7 +1051,7 @@ char_socket_get_addr(Object *obj, Visitor *v, const char *name, { SocketChardev *s = SOCKET_CHARDEV(obj); - visit_type_SocketAddress(v, name, &s->addr, errp); + visit_type_SocketAddressLegacy(v, name, &s->addr, errp); } static bool @@ -1078,7 +1078,7 @@ static void char_socket_class_init(ObjectClass *oc, void *data) cc->chr_add_watch = tcp_chr_add_watch; cc->chr_update_read_handler = tcp_chr_update_read_handler; - object_class_property_add(oc, "addr", "SocketAddress", + object_class_property_add(oc, "addr", "SocketAddressLegacy", char_socket_get_addr, NULL, NULL, NULL, &error_abort); diff --git a/chardev/char-udp.c b/chardev/char-udp.c index 1958c36de4..d705c4f26b 100644 --- a/chardev/char-udp.c +++ b/chardev/char-udp.c @@ -134,7 +134,7 @@ static void qemu_chr_parse_udp(QemuOpts *opts, ChardevBackend *backend, const char *localaddr = qemu_opt_get(opts, "localaddr"); const char *localport = qemu_opt_get(opts, "localport"); bool has_local = false; - SocketAddress *addr; + SocketAddressLegacy *addr; ChardevUdp *udp; backend->type = CHARDEV_BACKEND_KIND_UDP; @@ -159,8 +159,8 @@ static void qemu_chr_parse_udp(QemuOpts *opts, ChardevBackend *backend, udp = backend->u.udp.data = g_new0(ChardevUdp, 1); qemu_chr_parse_common(opts, qapi_ChardevUdp_base(udp)); - addr = g_new0(SocketAddress, 1); - addr->type = SOCKET_ADDRESS_KIND_INET; + addr = g_new0(SocketAddressLegacy, 1); + addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; addr->u.inet.data = g_new(InetSocketAddress, 1); *addr->u.inet.data = (InetSocketAddress) { .host = g_strdup(host), @@ -174,8 +174,8 @@ static void qemu_chr_parse_udp(QemuOpts *opts, ChardevBackend *backend, if (has_local) { udp->has_local = true; - addr = g_new0(SocketAddress, 1); - addr->type = SOCKET_ADDRESS_KIND_INET; + addr = g_new0(SocketAddressLegacy, 1); + addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; addr->u.inet.data = g_new(InetSocketAddress, 1); *addr->u.inet.data = (InetSocketAddress) { .host = g_strdup(localaddr), |