aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-21 22:38:41 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:59 +0100
commitad5c679c7f4c10cc1bf4899ee2dfba08cc383f13 (patch)
tree7ff650b5ae1842470469f45e6da7b3902336aca7 /include
parentacbfbe4a060442122ca099122e60a191d0715d41 (diff)
downloadqemu-ad5c679c7f4c10cc1bf4899ee2dfba08cc383f13.zip
qemu-ad5c679c7f4c10cc1bf4899ee2dfba08cc383f13.tar.gz
qemu-ad5c679c7f4c10cc1bf4899ee2dfba08cc383f13.tar.bz2
char: introduce generic qemu_chr_get_kind()
This allows to remove the "is_mux" field from CharDriverState. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sysemu/char.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index 2dd0564..7d841ad 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -96,7 +96,6 @@ struct CharDriverState {
char *filename;
int logfd;
int be_open;
- int is_mux;
guint fd_in_tag;
bool replay;
DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST);
@@ -455,7 +454,19 @@ void qemu_chr_be_generic_open(CharDriverState *s);
void qemu_chr_fe_accept_input(CharBackend *be);
int qemu_chr_add_client(CharDriverState *s, int fd);
CharDriverState *qemu_chr_find(const char *name);
-bool chr_is_ringbuf(const CharDriverState *chr);
+
+/**
+ * @qemu_chr_get_kind:
+ *
+ * Returns the kind of char backend, or -1 if unspecified.
+ */
+ChardevBackendKind qemu_chr_get_kind(const CharDriverState *chr);
+
+static inline bool qemu_chr_is_ringbuf(const CharDriverState *chr)
+{
+ return qemu_chr_get_kind(chr) == CHARDEV_BACKEND_KIND_RINGBUF ||
+ qemu_chr_get_kind(chr) == CHARDEV_BACKEND_KIND_MEMORY;
+}
bool qemu_chr_has_feature(CharDriverState *chr,
CharDriverFeature feature);