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/pcifront.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'extras/mini-os/pcifront.c') diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c index df300b5a4e..cdf9c9b0b1 100644 --- a/extras/mini-os/pcifront.c +++ b/extras/mini-os/pcifront.c @@ -363,10 +363,10 @@ close_pcifront: if (err) free(err); xenbus_unwatch_path_token(XBT_NIL, path, path); - snprintf(path, sizeof(path), "%s/info-ref", nodename); - xenbus_rm(XBT_NIL, path); - snprintf(path, sizeof(path), "%s/event-channel", nodename); - xenbus_rm(XBT_NIL, path); + snprintf(nodename, sizeof(nodename), "%s/info-ref", dev->nodename); + xenbus_rm(XBT_NIL, nodename); + snprintf(nodename, sizeof(nodename), "%s/event-channel", dev->nodename); + xenbus_rm(XBT_NIL, nodename); if (!err) free_pcifront(dev); -- cgit v1.2.3