qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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: Thu, 24 Mar 2011 11:12:04 +0100	[thread overview]
Message-ID: <1300961524-6205-4-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1300961524-6205-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 6134fe9..605c241 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -130,6 +130,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;
@@ -182,6 +194,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

  parent reply	other threads:[~2011-03-24 10:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/3] chardev: Allow frontends to notify backends of guest open / close Hans de Goede
2011-03-24 10:12 ` [Qemu-devel] [PATCH 2/3] virtio-console: notify backend " Hans de Goede
2011-03-24 10:12 ` Hans de Goede [this message]
2011-03-24 10:44 ` [Qemu-devel] [PATCH 0/3] spicevmc -> chardev: restore guest open / close (v2) Alon Levy
2011-04-25 10:25 ` Amit Shah
  -- strict thread matches above, loose matches on Subject: below --
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 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=1300961524-6205-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).