summaryrefslogtreecommitdiff
path: root/spice-qemu-char.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-03-26 11:07:58 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-03-27 10:26:49 -0500
commit574b711a92db094a2d4e7ca707f3b34437a64246 (patch)
tree8591fba70cbfceaf375ee22727e65cf71cd5eb5e /spice-qemu-char.c
parent8e25daa87ac98c9070365b42dcfc070e47fca934 (diff)
downloadqemu-574b711a92db094a2d4e7ca707f3b34437a64246.tar.gz
qemu-574b711a92db094a2d4e7ca707f3b34437a64246.tar.bz2
qemu-574b711a92db094a2d4e7ca707f3b34437a64246.zip
qemu-char: Consolidate guest_close/guest_open into a set_fe_open callback
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364292483-16564-7-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'spice-qemu-char.c')
-rw-r--r--spice-qemu-char.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index c39095b438..d249829624 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -176,16 +176,14 @@ static void spice_chr_close(struct CharDriverState *chr)
g_free(s);
}
-static void spice_chr_guest_open(struct CharDriverState *chr)
+static void spice_chr_set_fe_open(struct CharDriverState *chr, int fe_open)
{
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);
+ if (fe_open) {
+ vmc_register_interface(s);
+ } else {
+ vmc_unregister_interface(s);
+ }
}
static void print_allowed_subtypes(void)
@@ -218,8 +216,7 @@ static CharDriverState *chr_open(const char *subtype)
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;
+ chr->chr_set_fe_open = spice_chr_set_fe_open;
QLIST_INSERT_HEAD(&spice_chars, s, next);