On Fri, 05 Feb 2016 11:43:11 +0100 Greg Kurz <gk...@linux.vnet.ibm.com> wrote:
> +static bool virtio_net_set_vnet_endian(VirtIODevice *vdev, NetClientState > *ncs, > + int queues, bool enable) You might consider adding a comment like "returns whether endianness handling needs to fall back to the device" or so, as it's not immediately obvious what true/false is supposed to mean. But the patch is fine. > +{ > + int i; > + > + for (i = 0; i < queues; i++) { > + if (virtio_net_set_vnet_endian_one(vdev, ncs[i].peer, enable) < 0 && > + enable) { > + while (--i >= 0) { > + virtio_net_set_vnet_endian_one(vdev, ncs[i].peer, false); > + } > + > + return true; > + } > + } > + > + return false; > +}