diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-03-24 11:12:02 +0100 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2011-04-28 11:02:21 +0530 |
commit | 7c32c4feebd962960fb160291a426b983e0ae668 (patch) | |
tree | 1757d459bbb1202e0e2a377862805e49fb9c0437 /qemu-char.h | |
parent | a7d3970d0635ebce1412736e7aaf11d387919dc8 (diff) | |
download | hqemu-7c32c4feebd962960fb160291a426b983e0ae668.zip hqemu-7c32c4feebd962960fb160291a426b983e0ae668.tar.gz |
chardev: Allow frontends to notify backends of guest open / close
Some frontends know when the guest has opened the "channel" and is actively
listening to it, for example virtio-serial. This patch adds 2 new qemu-chardev
functions which can be used by frontends to signal guest open / close, and
allows interested backends to listen to this.
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>
Diffstat (limited to 'qemu-char.h')
-rw-r--r-- | qemu-char.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qemu-char.h b/qemu-char.h index fb96eef..2f8512e 100644 --- a/qemu-char.h +++ b/qemu-char.h @@ -65,6 +65,8 @@ struct CharDriverState { void (*chr_close)(struct CharDriverState *chr); void (*chr_accept_input)(struct CharDriverState *chr); void (*chr_set_echo)(struct CharDriverState *chr, bool echo); + void (*chr_guest_open)(struct CharDriverState *chr); + void (*chr_guest_close)(struct CharDriverState *chr); void *opaque; QEMUBH *bh; char *label; @@ -79,6 +81,8 @@ CharDriverState *qemu_chr_open_opts(QemuOpts *opts, void (*init)(struct CharDriverState *s)); CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s)); void qemu_chr_set_echo(struct CharDriverState *chr, bool echo); +void qemu_chr_guest_open(struct CharDriverState *chr); +void qemu_chr_guest_close(struct CharDriverState *chr); void qemu_chr_close(CharDriverState *chr); void qemu_chr_printf(CharDriverState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3); |