qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/24] vhost-user: return a read error


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH 08/24] vhost-user: return a read error
Date: Thu, 23 Jun 2016 05:14:04 -0400 (EDT)

Hi

----- Original Message -----
> On Tue, Jun 21, 2016 at 12:02:36PM +0200, address@hidden wrote:
> > From: Marc-André Lureau <address@hidden>
> > 
> > Return read errors (not sure why those were ignored)
> > 
> > Signed-off-by: Marc-André Lureau <address@hidden>
> 
> why bother?  So callers can just ignore them in turn?

The callers do not always ignore errors, fortunately (see vhost_user_init() for 
ex). That at least prevents flooding terminal/monitor with multiple errors and 
helps finding out the origin of the error.

> 
> > ---
> >  hw/virtio/vhost-user.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> > index e51df27..819481d 100644
> > --- a/hw/virtio/vhost-user.c
> > +++ b/hw/virtio/vhost-user.c
> > @@ -221,7 +221,7 @@ static int vhost_user_set_log_base(struct vhost_dev
> > *dev, uint64_t base,
> >      if (shmfd) {
> >          msg.size = 0;
> >          if (vhost_user_read(dev, &msg) < 0) {
> > -            return 0;
> > +            return -1;
> >          }
> >  
> >          if (msg.request != VHOST_USER_SET_LOG_BASE) {
> > @@ -373,7 +373,7 @@ static int vhost_user_get_vring_base(struct vhost_dev
> > *dev,
> >      }
> >  
> >      if (vhost_user_read(dev, &msg) < 0) {
> > -        return 0;
> > +        return -1;
> >      }
> >  
> >      if (msg.request != VHOST_USER_GET_VRING_BASE) {
> > @@ -474,7 +474,7 @@ static int vhost_user_get_u64(struct vhost_dev *dev,
> > int request, uint64_t *u64)
> >      }
> >  
> >      if (vhost_user_read(dev, &msg) < 0) {
> > -        return 0;
> > +        return -1;
> >      }
> >  
> >      if (msg.request != request) {
> > --
> > 2.7.4
> 



reply via email to

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