[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: |
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
- Re: [Qemu-devel] [PATCHv4 06/12] virtio: add set_status callback, (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