From 26defe81f6a878f33e0aaeb1df4d0d7022c929ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 4 Oct 2013 13:10:46 +0200 Subject: 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 --- ui/spice-core.c | 15 +++++++-------- ui/spice-display.c | 10 +++++----- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'ui') 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); diff --git a/ui/spice-display.c b/ui/spice-display.c index 82d8b9f9a5..0297373e0d 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -83,14 +83,14 @@ void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot, (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, QXL_IO_MEMSLOT_ADD_ASYNC)); } else { - ssd->worker->add_memslot(ssd->worker, memslot); + spice_qxl_add_memslot(&ssd->qxl, memslot); } } void qemu_spice_del_memslot(SimpleSpiceDisplay *ssd, uint32_t gid, uint32_t sid) { trace_qemu_spice_del_memslot(ssd->qxl.id, gid, sid); - ssd->worker->del_memslot(ssd->worker, gid, sid); + spice_qxl_del_memslot(&ssd->qxl, gid, sid); } void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id, @@ -103,7 +103,7 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id, (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, QXL_IO_CREATE_PRIMARY_ASYNC)); } else { - ssd->worker->create_primary_surface(ssd->worker, id, surface); + spice_qxl_create_primary_surface(&ssd->qxl, id, surface); } } @@ -116,14 +116,14 @@ void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd, (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, QXL_IO_DESTROY_PRIMARY_ASYNC)); } else { - ssd->worker->destroy_primary_surface(ssd->worker, id); + spice_qxl_destroy_primary_surface(&ssd->qxl, id); } } void qemu_spice_wakeup(SimpleSpiceDisplay *ssd) { trace_qemu_spice_wakeup(ssd->qxl.id); - ssd->worker->wakeup(ssd->worker); + spice_qxl_wakeup(&ssd->qxl); } static int spice_display_is_running; -- cgit v1.2.1