aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-04-26 09:36:41 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:14:40 +0200
commitbd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 (patch)
tree82ef0cd9da0812afc7021d5690c14f72e8e13177 /qga
parent62cf396b5d397948c5ac4d04d09596ca14f6c173 (diff)
sockets: Limit SocketAddressLegacy to external interfaces
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces. See also commit fce5d53..9445673 and 85a82e8..c5f1ae3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qga')
-rw-r--r--qga/channel-posix.c4
-rw-r--r--qga/main.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 65ab8eb634..3f34465159 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -203,7 +203,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path,
case GA_CHANNEL_VSOCK_LISTEN: {
if (fd < 0) {
Error *local_err = NULL;
- SocketAddressLegacy *addr;
+ SocketAddress *addr;
char *addr_str;
addr_str = g_strdup_printf("vsock:%s", path);
@@ -216,7 +216,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path,
}
fd = socket_listen(addr, &local_err);
- qapi_free_SocketAddressLegacy(addr);
+ qapi_free_SocketAddress(addr);
if (local_err != NULL) {
g_critical("%s", error_get_pretty(local_err));
error_free(local_err);
diff --git a/qga/main.c b/qga/main.c
index cae4d7b36f..cc58d2b53d 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1379,7 +1379,7 @@ int main(int argc, char **argv)
goto end;
}
if (socket_activation) {
- SocketAddressLegacy *addr;
+ SocketAddress *addr;
g_free(config->method);
g_free(config->channel_path);
@@ -1388,13 +1388,13 @@ int main(int argc, char **argv)
addr = socket_local_address(FIRST_SOCKET_ACTIVATION_FD, NULL);
if (addr) {
- if (addr->type == SOCKET_ADDRESS_LEGACY_KIND_UNIX) {
+ if (addr->type == SOCKET_ADDRESS_TYPE_UNIX) {
config->method = g_strdup("unix-listen");
- } else if (addr->type == SOCKET_ADDRESS_LEGACY_KIND_VSOCK) {
+ } else if (addr->type == SOCKET_ADDRESS_TYPE_VSOCK) {
config->method = g_strdup("vsock-listen");
}
- qapi_free_SocketAddressLegacy(addr);
+ qapi_free_SocketAddress(addr);
}
if (!config->method) {