dom0: block-snapshot: retrieve domain name from frontend-id only when no "domain" entry in xenstore

This enables compatibility with libxl AND xend.
This commit is contained in:
Marek Marczykowski 2011-06-10 18:32:34 +02:00
parent 6192e35419
commit 20fe69db75

View File

@ -131,8 +131,11 @@ case "$command" in
write_dev /dev/mapper/$dm_devname
fi
# Save domain name for template commit on device remove
domid=$(xenstore_read "$XENBUS_PATH/frontend-id")
domain=$(xl domname $domid)
domain=$(xenstore_read_default "$XENBUS_PATH/domain" '')
if [ -z "$domain" ]; then
domid=$(xenstore_read "$XENBUS_PATH/frontend-id")
domain=$(xl domname $domid)
fi
echo $domain > "$HOTPLUG_STORE-domain"
release_lock "block"