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

Re: [Xen-devel] [PATCH V3 2/4] Introduce xen-scsifront module



On 04/08/14 09:27, jgross@xxxxxxxx wrote:
> 
> +
> +static void scsifront_backend_changed(struct xenbus_device *dev,
> +                                   enum xenbus_state backend_state)
> +{
> +     struct vscsifrnt_info *info = dev_get_drvdata(&dev->dev);
> +
> +     DPRINTK("%p %u %u\n", dev, dev->state, backend_state);
> +
> +     switch (backend_state) {
> +     case XenbusStateUnknown:
> +     case XenbusStateInitialising:
> +     case XenbusStateInitWait:
> +     case XenbusStateInitialised:
> +             break;
> +
> +     case XenbusStateConnected:
> +             scsifront_read_backend_params(dev, info);
> +             if (xenbus_read_driver_state(dev->nodename) ==
> +                     XenbusStateInitialised) {
> +                     scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);
> +             }
> +
> +             if (dev->state != XenbusStateConnected)
> +                     xenbus_switch_state(dev, XenbusStateConnected);
> +             break;
> +
> +     case XenbusStateClosed:
> +             if (dev->state == XenbusStateClosed)
> +                     break;
> +             /* Missed the backend's Closing state -- fallthrough */
> +     case XenbusStateClosing:
> +             scsifront_disconnect(info);
> +             break;
> +
> +     case XenbusStateReconfiguring:
> +             scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_DEL_LUN);
> +             xenbus_switch_state(dev, XenbusStateReconfiguring);
> +             break;
> +
> +     case XenbusStateReconfigured:
> +             scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);
> +             xenbus_switch_state(dev, XenbusStateConnected);
> +             break;
> +     }
> +}

I would like to see this state machine in common code but I'm not going
to insist on it since this is a existing driver.

Xen related parts:

Acked-by: David Vrabel <david.vrabel@xxxxxxxxxx>

David

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.