From e051c482aa2d22cac78a33b846a3ddcb409e9fe4 Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Tue, 21 Aug 2012 17:18:43 +0800 Subject: [PATCH] new interface to control emulator_period/emulator_quota This patch adds two macros: VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD, VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA for controlling cpu bandwidth for emulator activities not tied to vcpus --- include/libvirt/libvirt.h.in | 24 +++++++++++++++++++++--- tools/virsh.pod | 11 ++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 43774eb332..cfe5047224 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -679,18 +679,36 @@ typedef virTypedParameter *virTypedParameterPtr; * VIR_DOMAIN_SCHEDULER_VCPU_PERIOD: * * Macro represents the enforcement period for a quota, in microseconds, - * when using the posix scheduler, as a ullong. + * for vcpus only, when using the posix scheduler, as a ullong. */ #define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD "vcpu_period" /** * VIR_DOMAIN_SCHEDULER_VCPU_QUOTA: * - * Macro represents the maximum bandwidth to be used within a period, - * when using the posix scheduler, as an llong. + * Macro represents the maximum bandwidth to be used within a period for + * vcpus only, when using the posix scheduler, as an llong. */ #define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA "vcpu_quota" +/** + * VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD: + * + * Macro represents the enforcement period for a quota in microseconds, + * when using the posix scheduler, for all emulator activity not tied to + * vcpus, as a ullong. + */ +#define VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD "emulator_period" + +/** + * VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA: + * + * Macro represents the maximum bandwidth to be used within a period for + * all emulator activity not tied to vcpus, when using the posix scheduler, + * as an llong. + */ +#define VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA "emulator_quota" + /** * VIR_DOMAIN_SCHEDULER_WEIGHT: * diff --git a/tools/virsh.pod b/tools/virsh.pod index ec3c33103b..e932d7c423 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1202,7 +1202,8 @@ available for each hypervisor are: LXC (posix scheduler) : cpu_shares -QEMU/KVM (posix scheduler): cpu_shares, vcpu_period, vcpu_quota +QEMU/KVM (posix scheduler): cpu_shares, vcpu_period, vcpu_quota, +emulator_period, emulator_quota Xen (credit scheduler): weight, cap @@ -1220,10 +1221,10 @@ values 0 and 1 are automatically converted to a minimal value of 2. B: The weight and cap parameters are defined only for the XEN_CREDIT scheduler and are now I. -B: The vcpu_period parameter has a valid value range of 1000-1000000 or -0, and the vcpu_quota parameter has a valid value range of -1000-18446744073709551 or less than 0. The value 0 for either parameter is -the same as not specifying that parameter. +B: The vcpu_period/emulator_period parameters have a valid value range +of 1000-1000000 or 0, and the vcpu_quota/emulator_quota parameters have a +valid value range of 1000-18446744073709551 or less than 0. The value 0 for +either parameter is the same as not specifying that parameter. =item B I [I] [I<--screen> B]