summaryrefslogtreecommitdiff
path: root/include/io
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 /include/io
parente413ae0c0492c10d9277a1155ecc21fbbf0e2bc7 (diff)
downloadqemu-d8d3c7cc672d89b26180a404d6f0b03494160cf5.tar.gz
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 'include/io')
-rw-r--r--include/io/channel.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/io/channel.h b/include/io/channel.h
index 5368604c8e..cf1c6223fa 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -149,6 +149,16 @@ bool qio_channel_has_feature(QIOChannel *ioc,
QIOChannelFeature feature);
/**
+ * qio_channel_set_feature:
+ * @ioc: the channel object
+ * @feature: the feature to set support for
+ *
+ * Add channel support for the feature named in @feature.
+ */
+void qio_channel_set_feature(QIOChannel *ioc,
+ QIOChannelFeature feature);
+
+/**
* qio_channel_readv_full:
* @ioc: the channel object
* @iov: the array of memory regions to read data into