From d8d3c7cc672d89b26180a404d6f0b03494160cf5 Mon Sep 17 00:00:00 2001 From: Felipe Franciosi Date: Thu, 29 Sep 2016 08:52:37 -0700 Subject: 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 Signed-off-by: Daniel P. Berrange --- io/channel.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'io/channel.c') 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, -- cgit v1.2.3