On (Fri) 29 Jul 2011 [07:13:35], Michael S. Tsirkin wrote:
> > +static int virtnet_restore(struct virtio_device *vdev)
> > +{
> > +   struct virtnet_info *vi = vdev->priv;
> > +   struct virtqueue *vqs[3];
> > +   vq_callback_t *callbacks[] = { skb_recv_done, skb_xmit_done, NULL};
> > +   const char *names[] = { "input", "output", "control" };
> > +   int nvqs, err;
> > +
> > +   /* We expect two virtqueues, receive then send,
> > +    * and optionally control. */
> > +   nvqs = virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ) ? 3 : 2;
> > +
> > +   err = vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names);
> > +   if (err)
> > +           return err;
> > +
> > +   vi->rvq = vqs[0];
> > +   vi->svq = vqs[1];
> > +
> > +   if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) {
> > +           vi->cvq = vqs[2];
> > +   }
> > +
> > +   /* Last of all, set up some receive buffers. */
> > +   try_fill_recv(vi, GFP_KERNEL);
> 
> should probably update carrier status too.

Will add that.

I think most of these restore routines are incomplete; I just pulled
in the most important things from the probe routines, but before the
final submission I'll do a thorough walk-through and ensure I get all
the bits necessary.

                Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/virtualization

Reply via email to