diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-10-04 13:10:46 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-10-17 12:25:25 +0200 |
commit | 26defe81f6a878f33e0aaeb1df4d0d7022c929ca (patch) | |
tree | 0258b4fdae1ebae9c4051440ecf12547b54fe30c /ui/spice-core.c | |
parent | 1680d485777ecf436d724631ea8722cc0c66990e (diff) |
spice: replace use of deprecated API
hose API are deprecated since 0.11, and qemu depends on 0.12 already.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/spice-core.c')
-rw-r--r-- | ui/spice-core.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c index 33ef83731a..79020a105f 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -383,17 +383,16 @@ static SpiceChannelList *qmp_query_spice_channels(void) struct sockaddr *paddr; socklen_t plen; + if (!(item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT)) { + error_report("invalid channel event"); + return NULL; + } + chan = g_malloc0(sizeof(*chan)); chan->value = g_malloc0(sizeof(*chan->value)); - if (item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT) { - paddr = (struct sockaddr *)&item->info->paddr_ext; - plen = item->info->plen_ext; - } else { - paddr = &item->info->paddr; - plen = item->info->plen; - } - + paddr = (struct sockaddr *)&item->info->paddr_ext; + plen = item->info->plen_ext; getnameinfo(paddr, plen, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); |