This variable can be used by other tools to determine in a generic way
whether a given hypervisor supports migration or not.
---
 lib/hypervisor/hv_base.py |    4 ++++
 lib/hypervisor/hv_fake.py |    2 ++
 lib/hypervisor/hv_kvm.py  |    1 +
 lib/hypervisor/hv_xen.py  |    1 +
 4 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/hypervisor/hv_base.py b/lib/hypervisor/hv_base.py
index af7aa95..96e688f 100644
--- a/lib/hypervisor/hv_base.py
+++ b/lib/hypervisor/hv_base.py
@@ -101,10 +101,14 @@ class BaseHypervisor(object):
           - a function to check for parameter validity on the remote node,
             in the L{ValidateParameters} function
           - an error message for the above function
+  @type CAN_MIGRATE: boolean
+  @cvar CAN_MIGRATE: whether this hypervisor can do migration (either
+      live or non-live)
 
   """
   PARAMETERS = {}
   ANCILLARY_FILES = []
+  CAN_MIGRATE = False
 
   def __init__(self):
     pass
diff --git a/lib/hypervisor/hv_fake.py b/lib/hypervisor/hv_fake.py
index cea05d6..a97bebe 100644
--- a/lib/hypervisor/hv_fake.py
+++ b/lib/hypervisor/hv_fake.py
@@ -40,6 +40,8 @@ class FakeHypervisor(hv_base.BaseHypervisor):
   a real virtualisation software installed.
 
   """
+  CAN_MIGRATE = True
+
   _ROOT_DIR = constants.RUN_DIR + "/ganeti-fake-hypervisor"
 
   def __init__(self):
diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
index fd36efe..5e666e8 100644
--- a/lib/hypervisor/hv_kvm.py
+++ b/lib/hypervisor/hv_kvm.py
@@ -42,6 +42,7 @@ from ganeti.hypervisor import hv_base
 
 class KVMHypervisor(hv_base.BaseHypervisor):
   """KVM hypervisor interface"""
+  CAN_MIGRATE = True
 
   _ROOT_DIR = constants.RUN_GANETI_DIR + "/kvm-hypervisor"
   _PIDS_DIR = _ROOT_DIR + "/pid" # contains live instances pids
diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py
index 575e3b9..a281e6a 100644
--- a/lib/hypervisor/hv_xen.py
+++ b/lib/hypervisor/hv_xen.py
@@ -39,6 +39,7 @@ class XenHypervisor(hv_base.BaseHypervisor):
   all the functionality that is identical for both.
 
   """
+  CAN_MIGRATE = True
   REBOOT_RETRY_COUNT = 60
   REBOOT_RETRY_INTERVAL = 10
 
-- 
1.7.0.4



-- 
Subscription settings: 
http://groups.google.com/group/ganeti-devel/subscribe?hl=en

Reply via email to