Fix indentation in VM.remove

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Ensure that VM_remove destroys the internal task when done

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Ensure that the Device_common.get_private_path does not raise an exception

Also add some extra logging in Xenstore_watch.

Returning a random string on error is not very neat, but we must avoid exceptions here.
This patch must be followed soon by a patch that changes the callers of
get_private_path{_of_device} to call by UUID, so that this code can go away.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #104 from robhoes/bvt

Ensure that the Device_common.get_private_path does not raise an exception
CP-9229: Use new path for convert-legacy-stream

The previous path (.../legacy.py) was a symlink for backwards compatibility
with development and we would like to remove it before release.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #105 from simonjbeaumont/cp-9229

CP-9229: Use new path for convert-legacy-stream
vif script: look for bridge in backend/vif/<domid>/<devid>/bridge first

This is where libxl puts it. We fall back to the "private" location if not
there.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xl: merge in device_common and hotplug changes from xc

This includes changes to support blktap3 (note that blktap3 would still need
changes in libxl if we want to use it).

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xl: write bridge-MAC

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
vif-real: log UUID

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xc: move no-physical-device xs key to private (as in xl)

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xl: use classic hotplug scripts

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Cleanup shutdown cancel path after use

Since private xenstore paths are now UUID-based, a shutdown cancel path persist
across a localhost migration. This causes a following localhost migration to
fail: the cancel path that still exists causes the cancellable watch that waits
for the domain to ack the shutdown request to fire immediately, and cancel the
migration.

We solve this by moving all cancel-related xenstore keys out of the
"/xapi/<uuid>" tree and into its own domid-based xenstore tree. We then zap
this tree on domain destroy.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #108 from robhoes/bvt

Cleanup shutdown cancel path after use
CA-142107: Enable verbose logging for convert-legacy-stream

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-142107: Log arguments before spawning convert-legacy-stream

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #107 from robhoes/vif-xl

Merge hotplug scripts for xenopsd classic and libxl
xenlight: replace hardcoded paths

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: add some additional debug lines

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: use an asynchronous way to report the outcome of asynchronous libxl calls

Sometimes an asynchronous libxl call may return and call back before the
initiating function returns. When this happens, the callback occurs on the same
thread as the initiating function and must not block.

We used to use the synchronous Event module to pass the result from the
callback back to the initiator, which does not work in this case. We replace it
by a custom event module with blocking reads and non-blocking writes.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>