Revision a744b676 lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
41 41
from ganeti import uidpool
42 42
from ganeti import ssconf
43 43
from ganeti.hypervisor import hv_base
44
from ganeti import netutils
44 45

  
45 46

  
46 47
class KVMHypervisor(hv_base.BaseHypervisor):
......
71 72
    constants.HV_ACPI: hv_base.NO_CHECK,
72 73
    constants.HV_SERIAL_CONSOLE: hv_base.NO_CHECK,
73 74
    constants.HV_VNC_BIND_ADDRESS:
74
      (False, lambda x: (utils.IsValidIP4(x) or utils.IsNormAbsPath(x)),
75
      (False, lambda x: (netutils.IsValidIP4(x) or utils.IsNormAbsPath(x)),
75 76
       "the VNC bind address must be either a valid IP address or an absolute"
76 77
       " pathname", None, None),
77 78
    constants.HV_VNC_TLS: hv_base.NO_CHECK,
......
514 515

  
515 516
    vnc_bind_address = hvp[constants.HV_VNC_BIND_ADDRESS]
516 517
    if vnc_bind_address:
517
      if utils.IsValidIP4(vnc_bind_address):
518
      if netutils.IsValidIP4(vnc_bind_address):
518 519
        if instance.network_port > constants.VNC_BASE_PORT:
519 520
          display = instance.network_port - constants.VNC_BASE_PORT
520 521
          if vnc_bind_address == constants.IP4_ADDRESS_ANY:
......
866 867
    if not alive:
867 868
      raise errors.HypervisorError("Instance not running, cannot migrate")
868 869

  
869
    if not utils.TcpPing(target, port, live_port_needed=True):
870
    if not netutils.TcpPing(target, port, live_port_needed=True):
870 871
      raise errors.HypervisorError("Remote host %s not listening on port"
871 872
                                   " %s, cannot migrate" % (target, port))
872 873

  

Also available in: Unified diff