From patchwork Fri Nov 30 13:25:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 202958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 87F4C2C0092 for ; Sat, 1 Dec 2012 00:28:01 +1100 (EST) Received: from localhost ([::1]:55623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TeQdL-0005zn-Jt for incoming@patchwork.ozlabs.org; Fri, 30 Nov 2012 08:27:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TeQd9-0005rs-Ub for qemu-devel@nongnu.org; Fri, 30 Nov 2012 08:27:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TeQd4-0002Yv-DU for qemu-devel@nongnu.org; Fri, 30 Nov 2012 08:27:47 -0500 Received: from mail-da0-f45.google.com ([209.85.210.45]:52430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TeQd4-0002OT-63 for qemu-devel@nongnu.org; Fri, 30 Nov 2012 08:27:42 -0500 Received: by mail-da0-f45.google.com with SMTP id w4so214233dam.4 for ; Fri, 30 Nov 2012 05:27:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=pHlszrjdwYvMmIkm6vai+wrOefI9Hwnw02B8VYrJi2g=; b=RcfjFssYZheTdpddb1V1f1hWupZa8zDExwOvRGEHlB1pzWBJV4TvtwAQ8bI5riee9e p/3NGR6bh3FRqGpJmW8+4NlfQ2liILBKVcx2CxxFl/XoK4J16XdCRtt5rH5j9GrEmZeb eN49KFuXc5o3FeUxtdMAeMPCQy8PfXkv4fxzFIjfvjSkOatNrSaXmXCHW2/BFJM9qq17 wLtMZPFbxOKEjsOTCUE2ttr5nnh1vAlONZS84O17K6mQJ4nApXx64FanfgFyFls4fUsa NVJ4RFIioaF2URdML5+kIjg/rZdPqIJ1E7Qg4iXPop19dIkPtu6dX3d9CJEqKvGQb9kc Z9pQ== Received: by 10.68.189.70 with SMTP id gg6mr5529596pbc.97.1354282061755; Fri, 30 Nov 2012 05:27:41 -0800 (PST) Received: from localhost (54.Red-88-0-20.dynamicIP.rima-tde.net. [88.0.20.54]) by mx.google.com with ESMTPS id ni3sm3060134pbc.2.2012.11.30.05.27.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Nov 2012 05:27:41 -0800 (PST) From: "=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=" To: qemu-devel@nongnu.org Date: Fri, 30 Nov 2012 14:25:47 +0100 Message-Id: <1354281947-20227-7-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1354281947-20227-1-git-send-email-marcandre.lureau@redhat.com> References: <1354281947-20227-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.45 Cc: spice-devel@lists.freedesktop.org, alevy@redhat.com, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [Qemu-devel] [PATCH 6/6] spice-qemu-char: register spicevmc ports during qemu_spice_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Do the delayed registration of spicevmc ports after Spice server is initialized. Signed-off-by: Marc-André Lureau --- spice-qemu-char.c | 13 +++++++++++++ ui/qemu-spice.h | 1 + ui/spice-core.c | 2 ++ 3 files changed, 16 insertions(+) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 13de037..8577664 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -275,6 +275,7 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts) return chr; } + static int port_can_read(void *opaque) { CharDriverState *chr = opaque; @@ -388,3 +389,15 @@ CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts) return chr; } + +void qemu_spice_register_ports(void) +{ + SpiceCharDriver *s; + + QLIST_FOREACH(s, &spice_chars, next) { + if (s->sin.portname == NULL) { + continue; + } + vmc_register_interface(s); + } +} diff --git a/ui/qemu-spice.h b/ui/qemu-spice.h index ab1943a..5d60e99 100644 --- a/ui/qemu-spice.h +++ b/ui/qemu-spice.h @@ -47,6 +47,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data); CharDriverState *qemu_chr_open_spice(QemuOpts *opts); CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts); +void qemu_spice_register_ports(void); #else /* CONFIG_SPICE */ #include "monitor.h" diff --git a/ui/spice-core.c b/ui/spice-core.c index 261c6f2..979c689 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -714,6 +714,8 @@ void qemu_spice_init(void) g_free(x509_key_file); g_free(x509_cert_file); g_free(x509_cacert_file); + + qemu_spice_register_ports(); } int qemu_spice_add_interface(SpiceBaseInstance *sin)