Commit 40a03283 authored by Iustin Pop's avatar Iustin Pop
Browse files

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

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
parent d7b47a77
......@@ -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
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():
DevCacheManager.UpdateCache(r_dev.dev_path, owner,
as_primary, disk.iv_name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment