From: Amit Shah <amit.shah@redhat.com>
To: qemu list <qemu-devel@nongnu.org>
Cc: slash@ac.auone-net.jp, Juan Quintela <quintela@redhat.com>,
Hans de Goede <hdegoede@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Amit Shah <amit.shah@redhat.com>,
david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH 3/6] spice-chardev: listen to frontend guest open / close
Date: Thu, 28 Apr 2011 13:00:50 +0530 [thread overview]
Message-ID: <cd8f7df2891891c3a6c346892545c4407be6699f.1303975203.git.amit.shah@redhat.com> (raw)
In-Reply-To: <cover.1303975203.git.amit.shah@redhat.com>
In-Reply-To: <cover.1303975203.git.amit.shah@redhat.com>
From: Hans de Goede <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>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Amit Shah <amit.shah@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.4.4
next prev parent reply other threads:[~2011-04-28 7:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 7:30 [Qemu-devel] [PULL] char, virtio-serial, spice Amit Shah
2011-04-28 7:30 ` [Qemu-devel] [PATCH 1/6] chardev: Allow frontends to notify backends of guest open / close Amit Shah
2011-04-28 7:30 ` [Qemu-devel] [PATCH 2/6] virtio-console: notify backend " Amit Shah
2011-04-28 7:30 ` Amit Shah [this message]
2011-04-28 7:30 ` [Qemu-devel] [PATCH 4/6] char: Allow devices to use a single multiplexed chardev Amit Shah
2011-04-28 7:30 ` [Qemu-devel] [PATCH 5/6] char: Detect chardev release by NULL handlers as well as NULL opaque Amit Shah
2011-04-28 7:30 ` [Qemu-devel] [PATCH 6/6] virtio-serial: Fix endianness bug in the config space Amit Shah
2011-04-28 13:56 ` [Qemu-devel] [PULL] char, virtio-serial, spice Anthony Liguori
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=cd8f7df2891891c3a6c346892545c4407be6699f.1303975203.git.amit.shah@redhat.com \
--to=amit.shah@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=hdegoede@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=slash@ac.auone-net.jp \
/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).