From a320c05b828275c19ae5b816715be8453ea2f190 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Fri, 6 Sep 2013 12:52:07 -0700 Subject: minios: fix xenbus_rm() calls in frontend drivers The commit "minios: refactor xenbus state machine" caused "/state" to be appended to the local value of nodename. Previously the nodename variable pointed to dev->nodename. The xenbus_rm() calls were not updated to reflect this change, and refer to paths that do not exist. For example, shutdown_blkfront() for vbd 2049 would issue these calls: xenbus_rm(XBT_NIL, "device/vbd/2049/state/ring-ref"); xenbus_rm(XBT_NIL, "device/vbd/2049/state/event-channel"); This patch restores the previous behavior, issuing these calls instead: xenbus_rm(XBT_NIL, "device/vbd/2049/ring-ref"); xenbus_rm(XBT_NIL, "device/vbd/2049/event-channel"); This causes frontend drivers to not be properly reset when PV-GRUB exists. Some PV Linux drivers fail to re-initialize frontend devices if PV-GRUB leaves them in this state. Signed-off-by: Ben Cressey Reviewed-by: Matt Wilson Cc: Stefano Stabellini Acked-by: Samuel Thibault [msw: adjusted commit message to include consequences, split out changes into separate patches] Signed-off-by: Matt Wilson --- extras/mini-os/netfront.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'extras/mini-os/netfront.c') diff --git a/extras/mini-os/netfront.c b/extras/mini-os/netfront.c index dc29f14075..4e087a56ed 100644 --- a/extras/mini-os/netfront.c +++ b/extras/mini-os/netfront.c @@ -549,14 +549,14 @@ close: if (err) free(err); xenbus_unwatch_path_token(XBT_NIL, path, path); - snprintf(path, sizeof(path), "%s/tx-ring-ref", nodename); - xenbus_rm(XBT_NIL, path); - snprintf(path, sizeof(path), "%s/rx-ring-ref", nodename); - xenbus_rm(XBT_NIL, path); - snprintf(path, sizeof(path), "%s/event-channel", nodename); - xenbus_rm(XBT_NIL, path); - snprintf(path, sizeof(path), "%s/request-rx-copy", nodename); - xenbus_rm(XBT_NIL, path); + snprintf(nodename, sizeof(nodename), "%s/tx-ring-ref", dev->nodename); + xenbus_rm(XBT_NIL, nodename); + snprintf(nodename, sizeof(nodename), "%s/rx-ring-ref", dev->nodename); + xenbus_rm(XBT_NIL, nodename); + snprintf(nodename, sizeof(nodename), "%s/event-channel", dev->nodename); + xenbus_rm(XBT_NIL, nodename); + snprintf(nodename, sizeof(nodename), "%s/request-rx-copy", dev->nodename); + xenbus_rm(XBT_NIL, nodename); if (!err) free_netfront(dev); -- cgit v1.2.3