Re: [Qemu-devel] [PATCH RFC v6 04/20] virtio: add feature checking helpers

2015-01-21 Thread David Gibson
On Thu, Dec 11, 2014 at 02:25:06PM +0100, Cornelia Huck wrote: Add a helper function for checking whether a bit is set in the guest features for a vdev as well as one that works on a feature bit set. Convert code that open-coded this: It cleans up the code and makes it easier to extend the

Re: [PATCH RFC v6 04/20] virtio: add feature checking helpers

2014-12-12 Thread Cornelia Huck
On Thu, 11 Dec 2014 19:05:26 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 11, 2014 at 03:46:23PM +0100, Thomas Huth wrote: On Thu, 11 Dec 2014 14:25:06 +0100 Cornelia Huck cornelia.h...@de.ibm.com wrote: Add a helper function for checking whether a bit is set in the

Re: [PATCH RFC v6 04/20] virtio: add feature checking helpers

2014-12-12 Thread Cornelia Huck
On Thu, 11 Dec 2014 15:46:23 +0100 Thomas Huth th...@linux.vnet.ibm.com wrote: +static inline bool __virtio_has_feature(uint32_t features, unsigned int fbit) +{ +assert(fbit 32); +return !!(features (1 fbit)); +} + +static inline bool virtio_has_feature(VirtIODevice

[PATCH RFC v6 04/20] virtio: add feature checking helpers

2014-12-11 Thread Cornelia Huck
Add a helper function for checking whether a bit is set in the guest features for a vdev as well as one that works on a feature bit set. Convert code that open-coded this: It cleans up the code and makes it easier to extend the guest feature bits. Signed-off-by: Cornelia Huck

Re: [PATCH RFC v6 04/20] virtio: add feature checking helpers

2014-12-11 Thread Thomas Huth
On Thu, 11 Dec 2014 14:25:06 +0100 Cornelia Huck cornelia.h...@de.ibm.com wrote: Add a helper function for checking whether a bit is set in the guest features for a vdev as well as one that works on a feature bit set. Convert code that open-coded this: It cleans up the code and makes it

Re: [PATCH RFC v6 04/20] virtio: add feature checking helpers

2014-12-11 Thread Michael S. Tsirkin
On Thu, Dec 11, 2014 at 03:46:23PM +0100, Thomas Huth wrote: On Thu, 11 Dec 2014 14:25:06 +0100 Cornelia Huck cornelia.h...@de.ibm.com wrote: Add a helper function for checking whether a bit is set in the guest features for a vdev as well as one that works on a feature bit set.