qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] VhostUserRequest # 20


From: Marc-André Lureau
Subject: Re: [Qemu-devel] VhostUserRequest # 20
Date: Wed, 24 May 2017 11:10:21 -0400 (EDT)

Hi

----- Original Message -----
> * Marc-André Lureau (address@hidden) wrote:
> > HI
> > 
> > ----- Original Message -----
> > > Hi,
> > >   libvhost-user.h defines:
> > >    VHOST_USER_INPUT_GET_CONFIG = 20,
> > 
> > That slipped by mistake from my vhost-user-input series WIP, please send a
> > fix.
> > (luckily, this is only internal header for now)
> 
> OK, just posted.
> 
> However, I just spotted, or should I say gcc just spotted another issue:
> 
>   CC      tests/vhost-user-bridge.o
> /home/dgilbert/git/qemu-world3/tests/vhost-user-bridge.c:228:23: warning:
> variables 'front' and 'iov' used in loop condition not modified in loop body
> [-Wfor-loop-analysis]
>     for (cur = front; front != iov; cur++) {
>                       ^~~~~    ~~~
> 1 warning generated.
> 
> 
> static void
> iov_restore_front(struct iovec *front, struct iovec *iov, size_t bytes)
> {
>     struct iovec *cur;
> 
>     for (cur = front; front != iov; cur++) {
>         bytes -= cur->iov_len;
>     }
> 
>     cur->iov_base -= bytes;
>     cur->iov_len += bytes;
> }
> 
> What's that actually intending to do?

It was meant to revert the effect of iov_discard_front()

The code should read:

for (cur = front; cur != iov; cur++) {

In practice, it doesn't reach the loop since the front sg buffer is big enough 
to discard the header..

Does that looks correct to you?


thanks

> 
> Dave
> 
> > thanks
> > 
> > > while
> > >   vhost-user.c defines:
> > >    VHOST_USER_NET_SET_MTU = 20,
> > > 
> > > who wins?
> > > 
> > > Dave
> > > --
> > > Dr. David Alan Gilbert / address@hidden / Manchester, UK
> > > 
> --
> Dr. David Alan Gilbert / address@hidden / Manchester, UK
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]