From 20fe69db75470f21bc69f285bb466e45cbfbcc66 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 10 Jun 2011 18:32:34 +0200 Subject: [PATCH] dom0: block-snapshot: retrieve domain name from frontend-id only when no "domain" entry in xenstore This enables compatibility with libxl AND xend. --- common/block-snapshot | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/block-snapshot b/common/block-snapshot index bba8ee5..ad71eeb 100755 --- a/common/block-snapshot +++ b/common/block-snapshot @@ -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"