From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: qemu-devel@nongnu.org
Cc: spice-devel@lists.freedesktop.org, alevy@redhat.com,
kraxel@redhat.com,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 6/6] spice-qemu-char: register spicevmc ports during qemu_spice_init()
Date: Fri, 30 Nov 2012 14:25:47 +0100 [thread overview]
Message-ID: <1354281947-20227-7-git-send-email-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <1354281947-20227-1-git-send-email-marcandre.lureau@redhat.com>
Do the delayed registration of spicevmc ports after Spice server is
initialized.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
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)
--
1.7.11.7
next prev parent reply other threads:[~2012-11-30 13:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 13:25 [Qemu-devel] [PATCH 0/6] RFC: add "spiceport" chardev Marc-André Lureau
2012-11-30 13:25 ` [Qemu-devel] [PATCH 1/6] qemu-char: add qemu_chr_remove_clients() Marc-André Lureau
2012-11-30 13:25 ` [Qemu-devel] [PATCH 2/6] spice-qemu-char: write to chardev whatever amount it can read Marc-André Lureau
2012-12-02 10:00 ` Alon Levy
2012-11-30 13:25 ` [Qemu-devel] [PATCH 3/6] spice-qemu-char: factor out CharDriverState creation Marc-André Lureau
2012-11-30 13:25 ` [Qemu-devel] [PATCH 4/6] spice-qemu-char: add spiceport chardev Marc-André Lureau
2012-11-30 13:25 ` [Qemu-devel] [PATCH 5/6] spice-qemu-char: keep a list of spice chardev Marc-André Lureau
2012-11-30 13:25 ` Marc-André Lureau [this message]
2012-11-30 13:58 ` [Qemu-devel] [PATCH 0/6] RFC: add "spiceport" chardev Gerd Hoffmann
2012-11-30 14:42 ` Marc-André Lureau
2012-11-30 15:51 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354281947-20227-7-git-send-email-marcandre.lureau@redhat.com \
--to=marcandre.lureau@gmail.com \
--cc=alevy@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=spice-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).