From: Hans de Goede <hdegoede@redhat.com>
To: qemu-devel@nongnu.org
Cc: Hans de Goede <hdegoede@redhat.com>
Subject: [Qemu-devel] [PATCH 3/3] spice-chardev: listen to frontend guest open / close
Date: Tue, 22 Mar 2011 14:15:23 +0100 [thread overview]
Message-ID: <1300799723-664-4-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1300799723-664-1-git-send-email-hdegoede@redhat.com>
Note the vmc_register_interface() in spice_chr_write is left in place
in case someone uses spice-chardev with a frontend which does not have
guest open / close notification.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
spice-qemu-char.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 517f337..fa15a71 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -131,6 +131,18 @@ static void spice_chr_close(struct CharDriverState *chr)
qemu_free(s);
}
+static void spice_chr_guest_open(struct CharDriverState *chr)
+{
+ SpiceCharDriver *s = chr->opaque;
+ vmc_register_interface(s);
+}
+
+static void spice_chr_guest_close(struct CharDriverState *chr)
+{
+ SpiceCharDriver *s = chr->opaque;
+ vmc_unregister_interface(s);
+}
+
static void print_allowed_subtypes(void)
{
const char** psubtype;
@@ -183,6 +195,8 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
chr->opaque = s;
chr->chr_write = spice_chr_write;
chr->chr_close = spice_chr_close;
+ chr->chr_guest_open = spice_chr_guest_open;
+ chr->chr_guest_close = spice_chr_guest_close;
qemu_chr_generic_open(chr);
--
1.7.3.2
next prev parent reply other threads:[~2011-03-22 13:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 13:15 [Qemu-devel] [PATCH 0/3] spicevmc -> chardev: restore guest open / close notifcation Hans de Goede
2011-03-22 13:15 ` [Qemu-devel] [PATCH 1/3] chardev: Allow frontends to notify backends of guest open / close Hans de Goede
2011-03-22 13:15 ` [Qemu-devel] [PATCH 2/3] virtio-console: notify backend " Hans de Goede
2011-03-22 13:15 ` Hans de Goede [this message]
2011-03-22 14:05 ` [Qemu-devel] [PATCH 0/3] spicevmc -> chardev: restore guest open / close notifcation Amit Shah
-- strict thread matches above, loose matches on Subject: below --
2011-03-24 10:12 [Qemu-devel] [PATCH 0/3] spicevmc -> chardev: restore guest open / close (v2) Hans de Goede
2011-03-24 10:12 ` [Qemu-devel] [PATCH 3/3] spice-chardev: listen to frontend guest open / close Hans de Goede
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=1300799723-664-4-git-send-email-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=qemu-devel@nongnu.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).