summary refs log tree commit diff stats
path: root/io/channel.c
diff options
context:
space:
mode:
authorFelipe Franciosi <felipe@nutanix.com>2016-09-29 08:52:37 -0700
committerDaniel P. Berrange <berrange@redhat.com>2016-10-26 18:19:53 +0200
commitd8d3c7cc672d89b26180a404d6f0b03494160cf5 (patch)
tree535d38ccf68e12031a5bda318753a145c264428b /io/channel.c
parente413ae0c0492c10d9277a1155ecc21fbbf0e2bc7 (diff)
downloadfocaccia-qemu-d8d3c7cc672d89b26180a404d6f0b03494160cf5.tar.gz
focaccia-qemu-d8d3c7cc672d89b26180a404d6f0b03494160cf5.zip
io: Introduce a qio_channel_set_feature() helper
Testing QIOChannel feature support can be done with a helper called
qio_channel_has_feature(). Setting feature support, however, was
done manually with a logical OR. This patch introduces a new helper
called qio_channel_set_feature() and makes use of it where applicable.

Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'io/channel.c')
-rw-r--r--io/channel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/io/channel.c b/io/channel.c
index e50325c3f7..d1f1ae5157 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -30,6 +30,13 @@ bool qio_channel_has_feature(QIOChannel *ioc,
 }
 
 
+void qio_channel_set_feature(QIOChannel *ioc,
+                             QIOChannelFeature feature)
+{
+    ioc->features |= (1 << feature);
+}
+
+
 ssize_t qio_channel_readv_full(QIOChannel *ioc,
                                const struct iovec *iov,
                                size_t niov,