From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [PATCH] cleanup "struct xenbus_driver" Date: Tue, 11 Jul 2006 17:54:53 +0200 Message-ID: <44B3C9CD.4070805@suse.de> References: <44B3542A.20301@suse.de> <44B38E85.2070902@suse.de> <8cf0fb2d74fc4ac3bac78670de4e1476@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <8cf0fb2d74fc4ac3bac78670de4e1476@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen devel list List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > > On 11 Jul 2006, at 12:41, Gerd Hoffmann wrote: > >>> "struct xenbus_driver" has alot of elements duplicated >>> with "struct device_driver". This patch removes them >>> all and does the related code changes. >> >> Oops, wrong direction, ignore that one, sorry. > > The patch looked to be in the correct direction to me? Well, parts of it are fine, but not everything. I got "Driver 'vbd' needs updating - please use bus_type methods" messages in the log; seems using both xenbus_frontend->bus->probe() and xenbus_device->driver->probe() (which the patch does) is the reason for that. I've checked what others (pci for example) are doing, they have pci_driver->probe() and friends too, so that probably is just fine. The .name and .owner elements of xenbus_driver can be dropped in favor of the device_driver ones. And xenbus_dev_{probe,remove} also can be hooked directly into xenbus_{frontend,backend}->bus->{probe,remove} instead of overwriting the device_driver hooks in the driver register functions. I'll post an updated version soon. Right now I'm fighting with another xenbus issue: kexec'ing a new kernel requires a workflow which can't be handled nicely by the current xenbus state engine. Old kernel must do a clean shutdown so it doesn't leak grant table entries and stuff like that. But without making the device disappear, which happens if you just do "xenbus_state_switch(Closing)", after some chit-chat between frontend and backend. Additionally it must also bring xenbus and backend device into the state the new kernel expects ... cheers, Gerd -- Gerd Hoffmann http://www.suse.de/~kraxel/julika-dora.jpeg