Revision 8bd977e9 lib/hypervisor/hv_xen.py

b/lib/hypervisor/hv_xen.py
630 630
    constants.HV_REBOOT_BEHAVIOR:
631 631
      hv_base.ParamInSet(True, constants.REBOOT_BEHAVIORS),
632 632
    constants.HV_CPU_MASK: hv_base.OPT_MULTI_CPU_MASK_CHECK,
633
    constants.HV_CPU_CAP: hv_base.NO_CHECK,
634
    constants.HV_CPU_WEIGHT:
635
      (False, lambda x: 0 < x < 65536, "invalid weight", None, None),
633 636
    }
634 637

  
635 638
  @classmethod
......
672 675
    cpu_pinning = cls._CreateConfigCpus(hvp[constants.HV_CPU_MASK])
673 676
    if cpu_pinning:
674 677
      config.write("%s\n" % cpu_pinning)
678
    cpu_cap = hvp[constants.HV_CPU_CAP]
679
    if cpu_cap:
680
      config.write("cpu_cap=%d\n" % cpu_cap)
681
    cpu_weight = hvp[constants.HV_CPU_WEIGHT]
682
    if cpu_weight:
683
      config.write("cpu_weight=%d\n" % cpu_weight)
675 684

  
676 685
    config.write("name = '%s'\n" % instance.name)
677 686

  
......
743 752
    constants.HV_REBOOT_BEHAVIOR:
744 753
      hv_base.ParamInSet(True, constants.REBOOT_BEHAVIORS),
745 754
    constants.HV_CPU_MASK: hv_base.OPT_MULTI_CPU_MASK_CHECK,
755
    constants.HV_CPU_CAP: hv_base.NO_CHECK,
756
    constants.HV_CPU_WEIGHT:
757
      (False, lambda x: 0 < x < 65535, "invalid weight", None, None),
746 758
    }
747 759

  
748 760
  @classmethod
......
766 778
    cpu_pinning = cls._CreateConfigCpus(hvp[constants.HV_CPU_MASK])
767 779
    if cpu_pinning:
768 780
      config.write("%s\n" % cpu_pinning)
781
    cpu_cap = hvp[constants.HV_CPU_CAP]
782
    if cpu_cap:
783
      config.write("cpu_cap=%d\n" % cpu_cap)
784
    cpu_weight = hvp[constants.HV_CPU_WEIGHT]
785
    if cpu_weight:
786
      config.write("cpu_weight=%d\n" % cpu_weight)
769 787

  
770 788
    config.write("name = '%s'\n" % instance.name)
771 789
    if hvp[constants.HV_PAE]:

Also available in: Unified diff