summaryrefslogtreecommitdiffstats
path: root/plugins/xenserver/xenapi
diff options
context:
space:
mode:
authorRick Harris <rconradharris@gmail.com>2012-08-30 18:37:47 +0000
committerRick Harris <rconradharris@gmail.com>2012-09-26 15:47:25 +0000
commita36288351af519ef62ad4f52b3e3e38601ba3f58 (patch)
tree916f3516a9bdf49f622c69e23bf53d8c8df385a7 /plugins/xenserver/xenapi
parentc367fa5e4a5e4712bde9fc319ae6c2f4f2add606 (diff)
downloadnova-a36288351af519ef62ad4f52b3e3e38601ba3f58.tar.gz
nova-a36288351af519ef62ad4f52b3e3e38601ba3f58.tar.xz
nova-a36288351af519ef62ad4f52b3e3e38601ba3f58.zip
xenapi: Removing legacy swap-in-image.
This patch removes our legacy handling of swap in the image. Now that we're generating swap on-the-fly, this stop-gap solution can go away. Change-Id: Ied3198f77af8dabb6cfbf2ab9cfb3a4eb18e32ea
Diffstat (limited to 'plugins/xenserver/xenapi')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py21
1 files changed, 3 insertions, 18 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py
index 027d26a67..66f46a839 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py
@@ -221,6 +221,7 @@ def _validate_sequenced_vhds(staging_path):
if not filename.endswith('.vhd'):
continue
+ # Ignore legacy swap embedded in the image, generated on-the-fly now
if filename == "swap.vhd":
continue
@@ -242,13 +243,11 @@ def import_vhds(sr_path, staging_path, uuid_stack):
Returns: A dict of imported VHDs:
- {'root': {'uuid': 'ffff-aaaa'},
- 'swap': {'uuid': 'ffff-bbbb'}}
+ {'root': {'uuid': 'ffff-aaaa'}}
"""
_handle_old_style_images(staging_path)
_validate_sequenced_vhds(staging_path)
- imported_vhds = {}
files_to_move = []
# Collect sequenced VHDs and assign UUIDs to them
@@ -286,26 +285,12 @@ def import_vhds(sr_path, staging_path, uuid_stack):
_assert_vhd_not_hidden(leaf_vhd_path)
_validate_vdi_chain(leaf_vhd_path)
- imported_vhds["root"] = {"uuid": leaf_vhd_uuid}
-
- # Handle swap file if present
- orig_swap_path = os.path.join(staging_path, "swap.vhd")
- if os.path.exists(orig_swap_path):
- # Rename swap.vhd -> aaaa-bbbb-cccc-dddd.vhd
- vhd_uuid = uuid_stack.pop()
- swap_path = os.path.join(staging_path, "%s.vhd" % vhd_uuid)
- _rename(orig_swap_path, swap_path)
-
- _assert_vhd_not_hidden(swap_path)
-
- imported_vhds["swap"] = {"uuid": vhd_uuid}
- files_to_move.append(swap_path)
-
# Move files into SR
for orig_path in files_to_move:
new_path = os.path.join(sr_path, os.path.basename(orig_path))
_rename(orig_path, new_path)
+ imported_vhds = dict(root=dict(uuid=leaf_vhd_uuid))
return imported_vhds