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>
This commit is contained in:
Felipe Franciosi 2016-09-29 08:52:37 -07:00 committed by Daniel P. Berrange
parent e413ae0c04
commit d8d3c7cc67
5 changed files with 24 additions and 6 deletions

View file

@ -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,