nic parameters: constants
[ganeti-local] / lib / hypervisor / hv_kvm.py
index 2394683..e211475 100644 (file)
@@ -56,7 +56,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
     constants.HV_ACPI: hv_base.NO_CHECK,
     constants.HV_SERIAL_CONSOLE: hv_base.NO_CHECK,
     constants.HV_VNC_BIND_ADDRESS: \
-    (False, lambda x: (utils.IsValidIP(x) or os.path.isabs(x)),
+    (False, lambda x: (utils.IsValidIP(x) or utils.IsAbsNormPath(x)),
      "the VNC bind address must be either a valid IP address or an absolute"
      " pathname", None, None),
     constants.HV_VNC_TLS: hv_base.NO_CHECK,
@@ -78,6 +78,10 @@ class KVMHypervisor(hv_base.BaseHypervisor):
 
   _KVM_NETWORK_SCRIPT = constants.SYSCONFDIR + "/ganeti/kvm-vif-bridge"
 
+  ANCILLARY_FILES = [
+    _KVM_NETWORK_SCRIPT,
+    ]
+
   def __init__(self):
     hv_base.BaseHypervisor.__init__(self)
     # Let's make sure the directories we need exist, even if the RUN_DIR lives
@@ -717,3 +721,10 @@ class KVMHypervisor(hv_base.BaseHypervisor):
         hvparams[constants.HV_NIC_TYPE] == constants.HT_NIC_PARAVIRTUAL):
       raise errors.HypervisorError("Cannot boot from a paravirtual NIC. Please"
                                    " change the NIC type.")
+
+  @classmethod
+  def PowercycleNode(cls):
+    """KVM powercycle, just a wrapper over Linux powercycle.
+
+    """
+    cls.LinuxPowercycle()