Ian Campbell
2009-Dec-04 16:10 UTC
[Xen-devel] [GIT] Rename frontend functions to be unique
All Xen frontend drivers have a couple of identically named functions which makes figuring out which device went wrong from a stacktrace harder than it needs to be. Rename them to something specificto the device type. The following changes since commit 167bafd71a448f50dba5db362b813029838d04c9: Jeremy Fitzhardinge (1): Merge branch ''xen/dom0/apic'' into xen/master are available in the git repository at: git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/rollup or individually from git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/netfront git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/blkfront git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/netchannel2 Ian Campbell (3): xen: use less generic names in netfront driver. xen: use less generic names in blkfront driver. xen: use less generic names in netfront2 driver. drivers/block/xen-blkfront.c | 12 ++++++------ drivers/net/xen-netchannel2/netfront2.c | 4 ++-- drivers/net/xen-netfront.c | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2009-Dec-04 16:10 UTC
[Xen-devel] [PATCH] xen: use less generic names in netfront driver.
All Xen frontend drivers have a couple of identically named functions which makes figuring out which device went wrong from a stacktrace harder than it needs to be. Rename them to something specificto the device type. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> --- drivers/net/xen-netfront.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 9b1cd57..64cf31e 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1276,7 +1276,7 @@ static void xennet_disconnect_backend(struct netfront_info *info) static int netfront_resume(struct xenbus_device *dev) { struct netfront_info *info = dev_get_drvdata(&dev->dev); - + return 0; dev_dbg(&dev->dev, "%s\n", dev->nodename); xennet_disconnect_backend(info); @@ -1393,7 +1393,7 @@ static int setup_netfront(struct xenbus_device *dev, struct netfront_info *info) } /* Common code used when first setting up, and when resuming. */ -static int talk_to_backend(struct xenbus_device *dev, +static int talk_to_netback(struct xenbus_device *dev, struct netfront_info *info) { const char *message; @@ -1543,7 +1543,7 @@ static int xennet_connect(struct net_device *dev) return -ENODEV; } - err = talk_to_backend(np->xbdev, np); + err = talk_to_netback(np->xbdev, np); if (err) return err; @@ -1597,7 +1597,7 @@ static int xennet_connect(struct net_device *dev) /** * Callback received when the backend''s state changes. */ -static void backend_changed(struct xenbus_device *dev, +static void netback_changed(struct xenbus_device *dev, enum xenbus_state backend_state) { struct netfront_info *np = dev_get_drvdata(&dev->dev); @@ -1800,7 +1800,7 @@ static struct xenbus_driver netfront_driver = { .probe = netfront_probe, .remove = __devexit_p(xennet_remove), .resume = netfront_resume, - .otherend_changed = backend_changed, + .otherend_changed = netback_changed, }; static int __init netif_init(void) -- 1.5.6.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2009-Dec-04 16:10 UTC
[Xen-devel] [PATCH] xen: use less generic names in blkfront driver.
All Xen frontend drivers have a couple of identically named functions which makes figuring out which device went wrong from a stacktrace harder than it needs to be. Rename them to something specificto the device type. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> --- drivers/block/xen-blkfront.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 9aff0f5..837b992 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -650,7 +650,7 @@ fail: /* Common code used when first setting up, and when resuming. */ -static int talk_to_backend(struct xenbus_device *dev, +static int talk_to_blkback(struct xenbus_device *dev, struct blkfront_info *info) { const char *message = NULL; @@ -755,7 +755,7 @@ static int blkfront_probe(struct xenbus_device *dev, info->handle = simple_strtoul(strrchr(dev->nodename, ''/'')+1, NULL, 0); dev_set_drvdata(&dev->dev, info); - err = talk_to_backend(dev, info); + err = talk_to_blkback(dev, info); if (err) { kfree(info); dev_set_drvdata(&dev->dev, NULL); @@ -850,7 +850,7 @@ static int blkfront_resume(struct xenbus_device *dev) blkif_free(info, info->connected == BLKIF_STATE_CONNECTED); - err = talk_to_backend(dev, info); + err = talk_to_blkback(dev, info); if (info->connected == BLKIF_STATE_SUSPENDED && !err) err = blkif_recover(info); @@ -954,13 +954,13 @@ static void blkfront_closing(struct xenbus_device *dev) /** * Callback received when the backend''s state changes. */ -static void backend_changed(struct xenbus_device *dev, +static void blkback_changed(struct xenbus_device *dev, enum xenbus_state backend_state) { struct blkfront_info *info = dev_get_drvdata(&dev->dev); struct block_device *bd; - dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); + dev_dbg(&dev->dev, "blkfront:blkback_changed to state %d.\n", backend_state); switch (backend_state) { case XenbusStateInitialising: @@ -1063,7 +1063,7 @@ static struct xenbus_driver blkfront = { .probe = blkfront_probe, .remove = blkfront_remove, .resume = blkfront_resume, - .otherend_changed = backend_changed, + .otherend_changed = blkback_changed, .is_ready = blkfront_is_ready, }; -- 1.5.6.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2009-Dec-04 16:10 UTC
[Xen-devel] [PATCH] xen: use less generic names in netfront2 driver.
All Xen frontend drivers have a couple of identically named functions which makes figuring out which device went wrong from a stacktrace harder than it needs to be. Rename them to something specificto the device type. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> --- drivers/net/xen-netchannel2/netfront2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/xen-netchannel2/netfront2.c b/drivers/net/xen-netchannel2/netfront2.c index f360b43..d5e12c0 100644 --- a/drivers/net/xen-netchannel2/netfront2.c +++ b/drivers/net/xen-netchannel2/netfront2.c @@ -342,7 +342,7 @@ static int allocate_rings(struct netfront2 *nf, domid_t otherend) return 0; } -static void backend_changed(struct xenbus_device *xd, +static void netback2_changed(struct xenbus_device *xd, enum xenbus_state backend_state) { struct netfront2 *nf = xenbus_device_to_nf2(xd); @@ -498,7 +498,7 @@ static struct xenbus_driver netfront2 = { .ids = netfront_ids, .probe = netfront_probe, .remove = __devexit_p(netfront_remove), - .otherend_changed = backend_changed, + .otherend_changed = netback2_changed, .resume = netfront_resume, .suspend = netfront_suspend, }; -- 1.5.6.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2009-Dec-04 16:14 UTC
[Xen-devel] Re: [PATCH] xen: use less generic names in netfront driver.
On Fri, 2009-12-04 at 16:10 +0000, Ian Campbell wrote:> @@ -1276,7 +1276,7 @@ static void xennet_disconnect_backend(struct > netfront_info *info) > static int netfront_resume(struct xenbus_device *dev) > { > struct netfront_info *info = dev_get_drvdata(&dev->dev); > - > + return 0; > dev_dbg(&dev->dev, "%s\n", dev->nodename); > > xennet_disconnect_backend(info);Doh, this hunk was obviously accidental. I''ve updated the git branch. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Dec-04 16:34 UTC
[Xen-devel] Re: [PATCH] xen: use less generic names in netfront driver.
On 12/04/09 08:14, Ian Campbell wrote:> On Fri, 2009-12-04 at 16:10 +0000, Ian Campbell wrote: > >> @@ -1276,7 +1276,7 @@ static void xennet_disconnect_backend(struct >> netfront_info *info) >> static int netfront_resume(struct xenbus_device *dev) >> { >> struct netfront_info *info = dev_get_drvdata(&dev->dev); >> - >> + return 0; >> dev_dbg(&dev->dev, "%s\n", dev->nodename); >> >> xennet_disconnect_backend(info); >> > Doh, this hunk was obviously accidental. I''ve updated the git branch.Thanks, I''d picked up the updated one anyway. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Dec-04 16:41 UTC
[Xen-devel] Re: [GIT] Rename frontend functions to be unique
On 12/04/09 08:10, Ian Campbell wrote:> or individually from > git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/netfront > git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/blkfront > git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/netchannel2 >BTW, I have a single xen/frontend branch for netfront and blkfront, on the assumption that changes to them are going to be minor bugfix type stuff. I cherry-picked your patches over to it. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel