[PATCH net] vhost: correctly check the return value of translate_desc() in log_used()

2019-02-14 Thread Jason Wang
When fail, translate_desc() returns negative value, otherwise the number of iovs. So we should fail when the return value is negative instead of a blindly check against zero. Reported-by: Stephen Hemminger Fixes: cc5e71075947 ("vhost: log dirty page correctly") Signed-off-by: Jason Wang ---

Re: [PATCH RFC] virtio: hint if callbacks surprisingly might sleep

2019-02-14 Thread Michael S. Tsirkin
On Wed, Feb 13, 2019 at 02:44:14PM +0100, Cornelia Huck wrote: > On Thu, 31 Jan 2019 10:27:53 -0500 > "Michael S. Tsirkin" wrote: > > > On Thu, Jan 31, 2019 at 01:53:14PM +0100, Cornelia Huck wrote: > > > A virtio transport is free to implement some of the callbacks in > > > virtio_config_ops in

Re: [PATCH RFC] virtio: hint if callbacks surprisingly might sleep

2019-02-14 Thread Cornelia Huck
On Thu, 31 Jan 2019 10:27:53 -0500 "Michael S. Tsirkin" wrote: > On Thu, Jan 31, 2019 at 01:53:14PM +0100, Cornelia Huck wrote: > > A virtio transport is free to implement some of the callbacks in > > virtio_config_ops in a matter that they cannot be called from > > atomic context (e.g.