qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCHv4 09/12] vhost: vhost net support


From: Amit Shah
Subject: [Qemu-devel] Re: [PATCHv4 09/12] vhost: vhost net support
Date: Mon, 8 Mar 2010 11:50:23 +0530
User-agent: Mutt/1.5.19 (2009-01-05)

On (Sat) Mar 06 2010 [21:06:35], Michael S. Tsirkin wrote:
> 
> > > +    r = vhost_virtqueue_set_addr(dev, vq, idx, dev->log_enabled);
> > > +    if (r < 0) {
> > > +        r = -errno;
> > > +        goto fail_alloc;
> > > +    }
> > > +    if (!vdev->binding->guest_notifier || !vdev->binding->host_notifier) 
> > > {
> > > +        fprintf(stderr, "binding does not support irqfd/queuefd\n");
> > > +        r = -ENOSYS;
> > > +        goto fail_alloc;
> > > +    }
> > 
> > This could be checked much earlier on in the function; so that we avoid
> > doing all that stuff above and the cleanup.
> 
> Whatever order we put checks in, we'll have to undo stuff
> done beforehand on error.

Not if you do this check before any ioctls or allocations.
!vdev->binding->guest_notifier is not dependent on anything you do above
it in this function, so just checking for this first thing in the
function will not need any cleanup.


                Amit




reply via email to

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