minios: fix xenbus_rm() calls in frontend drivers
authorBen Cressey <bcressey@amazon.com>
Fri, 6 Sep 2013 19:52:07 +0000 (12:52 -0700)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 10 Sep 2013 09:55:17 +0000 (10:55 +0100)
commita320c05b828275c19ae5b816715be8453ea2f190
tree978a00f39b470faa72b3f9337e44684917579fdf
parent319e8ee03c88002cf7a3f4da49b3ecbc29eb698e
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 <bcressey@amazon.com>
Reviewed-by: Matt Wilson <msw@amazon.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[msw: adjusted commit message to include consequences, split out
 changes into separate patches]
Signed-off-by: Matt Wilson <msw@amazon.com>
extras/mini-os/blkfront.c
extras/mini-os/fbfront.c
extras/mini-os/netfront.c
extras/mini-os/pcifront.c