libxl: unify libxl__device_destroy and device_hotplug_done
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 3 Aug 2012 08:54:07 +0000 (09:54 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 3 Aug 2012 08:54:07 +0000 (09:54 +0100)
commit2dc6e6ef994ca63c7f9fb49981c1b044a69f2ac1
treee7d7d33aaa75b141a300f7125ffe05b18dfa9a87
parent672480c885d135e2f0cc53b6c0c89bedebb9a54a
libxl: unify libxl__device_destroy and device_hotplug_done

device_hotplug_done contains an open-coded but improved version of
libxl__device_destroy.  So move the contents of device_hotplug_done
into libxl__device_destroy, deleting the old code, and replace it at
its old location with a function call.

Add the missing call to libxl__xs_transaction_abort (which was present
in neither version and technically speaking is always a no-op with
this code as it stands at the moment because no-one does "goto out"
other than after libxl__xs_transaction_start or _commit).

Also fix the error handling: the rc from the destroy should be
propagated into the aodev.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_device.c