[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCHv4 09/12] vhost: vhost net support
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] Re: [PATCHv4 09/12] vhost: vhost net support |
Date: |
Tue, 16 Mar 2010 17:37:39 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Mon, Mar 08, 2010 at 11:50:23AM +0530, Amit Shah wrote:
> 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
Yes, but I think it's clearer to do check function just before
calling it. No?
- [Qemu-devel] [PATCHv4 07/12] virtio: move typedef to qemu-common, (continued)
[Qemu-devel] [PATCHv4 08/12] virtio-pci: fill in notifier support, Michael S. Tsirkin, 2010/03/03
[Qemu-devel] [PATCHv4 09/12] vhost: vhost net support, Michael S. Tsirkin, 2010/03/03
[Qemu-devel] [PATCHv4 10/12] tap: add vhost/vhostfd options, Michael S. Tsirkin, 2010/03/03
[Qemu-devel] [PATCHv4 11/12] tap: add API to retrieve vhost net header, Michael S. Tsirkin, 2010/03/03
[Qemu-devel] [PATCHv4 12/12] virtio-net: vhost net support, Michael S. Tsirkin, 2010/03/03