Revision 78411c60

b/lib/constants.py
390 390
HV_USB_MOUSE = "usb_mouse"
391 391
HV_DEVICE_MODEL = "device_model"
392 392
HV_INIT_SCRIPT = "init_script"
393
HV_MIGRATION_PORT = "migration_port"
393 394

  
394 395
HVS_PARAMETER_TYPES = {
395 396
  HV_BOOT_ORDER: VTYPE_STRING,
......
414 415
  HV_USB_MOUSE: VTYPE_STRING,
415 416
  HV_DEVICE_MODEL: VTYPE_STRING,
416 417
  HV_INIT_SCRIPT: VTYPE_STRING,
418
  HV_MIGRATION_PORT: VTYPE_INT,
417 419
  }
418 420

  
419 421
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
......
607 609
    HV_INITRD_PATH: '',
608 610
    HV_ROOT_PATH: '/dev/sda1',
609 611
    HV_KERNEL_ARGS: 'ro',
612
    HV_MIGRATION_PORT: 8002,
610 613
    },
611 614
  HT_XEN_HVM: {
612 615
    HV_BOOT_ORDER: "cd",
......
619 622
    HV_PAE: True,
620 623
    HV_KERNEL_PATH: "/usr/lib/xen/boot/hvmloader",
621 624
    HV_DEVICE_MODEL: "/usr/lib/xen/bin/qemu-dm",
625
    HV_MIGRATION_PORT: 8002,
622 626
    },
623 627
  HT_KVM: {
624 628
    HV_KERNEL_PATH: "/boot/vmlinuz-2.6-kvmU",
......
637 641
    HV_NIC_TYPE: HT_NIC_PARAVIRTUAL,
638 642
    HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
639 643
    HV_USB_MOUSE: '',
644
    HV_MIGRATION_PORT: _autoconf.KVM_MIGRATION_PORT,
640 645
    },
641 646
  HT_FAKE: {
642 647
    },
b/lib/hypervisor/hv_base.py
62 62
OPT_FILE_CHECK = (False, ) + _FILE_CHECK
63 63
REQ_DIR_CHECK = (True, ) + _DIR_CHECK
64 64
OPT_DIR_CHECK = (False, ) + _DIR_CHECK
65
NET_PORT_CHECK = (True, lambda x: x > 0 and x < 65535, "invalid port number",
66
                  None, None)
65 67

  
66 68
# no checks at all
67 69
NO_CHECK = (False, None, None, None, None)
b/lib/hypervisor/hv_kvm.py
72 72
      hv_base.ParamInSet(True, constants.HT_KVM_VALID_DISK_TYPES),
73 73
    constants.HV_USB_MOUSE:
74 74
      hv_base.ParamInSet(False, constants.HT_KVM_VALID_MOUSE_TYPES),
75
    constants.HV_MIGRATION_PORT: hv_base.NET_PORT_CHECK,
75 76
    }
76 77

  
77 78
  _MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)',
......
556 557
    # to shutdown and restart.
557 558
    pidfile, pid, alive = self._InstancePidAlive(instance.name)
558 559
    if not alive:
559
      raise errors.HypervisorError("Failed to reboot instance %s: not running" %
560
                                             (instance.name))
560
      raise errors.HypervisorError("Failed to reboot instance %s:"
561
                                   " not running" % instance.name)
561 562
    # StopInstance will delete the saved KVM runtime so:
562 563
    # ...first load it...
563 564
    kvm_runtime = self._LoadKVMRuntime(instance)
b/lib/hypervisor/hv_xen.py
445 445
    constants.HV_INITRD_PATH: hv_base.OPT_FILE_CHECK,
446 446
    constants.HV_ROOT_PATH: hv_base.REQUIRED_CHECK,
447 447
    constants.HV_KERNEL_ARGS: hv_base.NO_CHECK,
448
    constants.HV_MIGRATION_PORT: hv_base.NET_PORT_CHECK,
448 449
    }
449 450

  
450 451
  @classmethod
......
542 543
    constants.HV_KERNEL_PATH: hv_base.REQ_FILE_CHECK,
543 544
    constants.HV_DEVICE_MODEL: hv_base.REQ_FILE_CHECK,
544 545
    constants.HV_VNC_PASSWORD_FILE: hv_base.REQ_FILE_CHECK,
546
    constants.HV_MIGRATION_PORT: hv_base.NET_PORT_CHECK,
545 547
    }
546 548

  
547 549
  @classmethod
b/man/gnt-instance.sgml
504 504
                emulate a serial console for the instance.</simpara>
505 505
              </listitem>
506 506
            </varlistentry>
507

  
508
            <varlistentry>
509
              <term>migration_port</term>
510
              <listitem>
511
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
512

  
513
                <para>
514
                  This options specifies the TCP port to use for
515
                  live-migration. Note that this shouldn't (usually)
516
                  be changed at the instance level, but only at
517
                  cluster-level.
518
                </para>
519
              </listitem>
520
            </varlistentry>
521

  
507 522
          </variablelist>
523

  
508 524
        </para>
509 525

  
510 526
        <para>

Also available in: Unified diff