From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWl5y-0007Ob-6m for qemu-devel@nongnu.org; Thu, 17 Oct 2013 06:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWl5q-000619-4U for qemu-devel@nongnu.org; Thu, 17 Oct 2013 06:46:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWl5p-000615-SI for qemu-devel@nongnu.org; Thu, 17 Oct 2013 06:46:14 -0400 From: Gerd Hoffmann Date: Thu, 17 Oct 2013 12:45:56 +0200 Message-Id: <1382006760-19388-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1382006760-19388-1-git-send-email-kraxel@redhat.com> References: <1382006760-19388-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/4] spice: replace use of deprecated API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Anthony Liguori From: Marc-Andr=C3=A9 Lureau hose API are deprecated since 0.11, and qemu depends on 0.12 already. Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 16 ++++++++-------- ui/spice-core.c | 15 +++++++-------- ui/spice-display.c | 10 +++++----- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index ee2db0d..074ed43 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -162,7 +162,7 @@ void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_= t surface_id, trace_qxl_spice_update_area_rest(qxl->id, num_dirty_rects, clear_dirty_region); if (async =3D=3D QXL_SYNC) { - qxl->ssd.worker->update_area(qxl->ssd.worker, surface_id, area, + spice_qxl_update_area(&qxl->ssd.qxl, surface_id, area, dirty_rects, num_dirty_rects, clear_dirty_region= ); } else { assert(cookie !=3D NULL); @@ -193,7 +193,7 @@ static void qxl_spice_destroy_surface_wait(PCIQXLDevi= ce *qxl, uint32_t id, cookie->u.surface_id =3D id; spice_qxl_destroy_surface_async(&qxl->ssd.qxl, id, (uintptr_t)co= okie); } else { - qxl->ssd.worker->destroy_surface_wait(qxl->ssd.worker, id); + spice_qxl_destroy_surface_wait(&qxl->ssd.qxl, id); qxl_spice_destroy_surface_wait_complete(qxl, id); } } @@ -211,19 +211,19 @@ void qxl_spice_loadvm_commands(PCIQXLDevice *qxl, s= truct QXLCommandExt *ext, uint32_t count) { trace_qxl_spice_loadvm_commands(qxl->id, ext, count); - qxl->ssd.worker->loadvm_commands(qxl->ssd.worker, ext, count); + spice_qxl_loadvm_commands(&qxl->ssd.qxl, ext, count); } =20 void qxl_spice_oom(PCIQXLDevice *qxl) { trace_qxl_spice_oom(qxl->id); - qxl->ssd.worker->oom(qxl->ssd.worker); + spice_qxl_oom(&qxl->ssd.qxl); } =20 void qxl_spice_reset_memslots(PCIQXLDevice *qxl) { trace_qxl_spice_reset_memslots(qxl->id); - qxl->ssd.worker->reset_memslots(qxl->ssd.worker); + spice_qxl_reset_memslots(&qxl->ssd.qxl); } =20 static void qxl_spice_destroy_surfaces_complete(PCIQXLDevice *qxl) @@ -244,7 +244,7 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *= qxl, qxl_async_io async) (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, QXL_IO_DESTROY_ALL_SURFACES_AS= YNC)); } else { - qxl->ssd.worker->destroy_surfaces(qxl->ssd.worker); + spice_qxl_destroy_surfaces(&qxl->ssd.qxl); qxl_spice_destroy_surfaces_complete(qxl); } } @@ -278,13 +278,13 @@ static void qxl_spice_monitors_config_async(PCIQXLD= evice *qxl, int replay) void qxl_spice_reset_image_cache(PCIQXLDevice *qxl) { trace_qxl_spice_reset_image_cache(qxl->id); - qxl->ssd.worker->reset_image_cache(qxl->ssd.worker); + spice_qxl_reset_image_cache(&qxl->ssd.qxl); } =20 void qxl_spice_reset_cursor(PCIQXLDevice *qxl) { trace_qxl_spice_reset_cursor(qxl->id); - qxl->ssd.worker->reset_cursor(qxl->ssd.worker); + spice_qxl_reset_cursor(&qxl->ssd.qxl); qemu_mutex_lock(&qxl->track_lock); qxl->guest_cursor =3D 0; qemu_mutex_unlock(&qxl->track_lock); diff --git a/ui/spice-core.c b/ui/spice-core.c index 33ef837..79020a1 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -383,17 +383,16 @@ static SpiceChannelList *qmp_query_spice_channels(v= oid) struct sockaddr *paddr; socklen_t plen; =20 + if (!(item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT)) { + error_report("invalid channel event"); + return NULL; + } + chan =3D g_malloc0(sizeof(*chan)); chan->value =3D g_malloc0(sizeof(*chan->value)); =20 - if (item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT) { - paddr =3D (struct sockaddr *)&item->info->paddr_ext; - plen =3D item->info->plen_ext; - } else { - paddr =3D &item->info->paddr; - plen =3D item->info->plen; - } - + paddr =3D (struct sockaddr *)&item->info->paddr_ext; + plen =3D 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 82d8b9f..0297373 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); } } =20 void qemu_spice_del_memslot(SimpleSpiceDisplay *ssd, uint32_t gid, uint3= 2_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); } =20 void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t= id, @@ -103,7 +103,7 @@ void qemu_spice_create_primary_surface(SimpleSpiceDis= play *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); } } =20 @@ -116,14 +116,14 @@ void qemu_spice_destroy_primary_surface(SimpleSpice= Display *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); } } =20 void qemu_spice_wakeup(SimpleSpiceDisplay *ssd) { trace_qemu_spice_wakeup(ssd->qxl.id); - ssd->worker->wakeup(ssd->worker); + spice_qxl_wakeup(&ssd->qxl); } =20 static int spice_display_is_running; --=20 1.8.3.1