From 40a03283a837fd7ec9f60142e620433e82421347 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 14 Feb 2008 15:54:05 +0000 Subject: [PATCH] Alter the device activation code This tiny patch fixes the breakage that the previous patch about activation did by removing the Close() call after activation. The initial reason for that call was that if the device is already active and open, but we need it closed, we close it automatically. This however conflicts with the 2-step open in the case the instance is already open. It makes sense to remove the call since in the current Ganeti setup, just doing Close() is not enough to change the device from (e.g.) primary to secondary, as some devices (e.g. md) might need Shutdown not Close. It also gets rid of a Close() in the CreateBlockDevice function, due to the same reasoning (although in Create the child should not have a different status anyway). Reviewed-by: imsnah --- lib/backend.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/backend.py b/lib/backend.py index df376c5c3..406a7f9aa 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -665,8 +665,6 @@ def CreateBlockDevice(disk, size, owner, on_primary, info): # we need the children open in case the device itself has to # be assembled crdev.Open() - else: - crdev.Close() clist.append(crdev) try: device = bdev.FindDevice(disk.dev_type, disk.physical_id, clist) @@ -766,8 +764,6 @@ def _RecursiveAssembleBD(disk, owner, as_primary): result = r_dev if as_primary or disk.OpenOnSecondary(): r_dev.Open() - else: - r_dev.Close() DevCacheManager.UpdateCache(r_dev.dev_path, owner, as_primary, disk.iv_name) -- GitLab