Bug 947400

Summary: libvirt isn't checking values emulator_period and emulator_quota in XML
Product: Red Hat Enterprise Linux 7 Reporter: Luwen Su <lsu>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, ajia, cwei, dallan, dyuan, honzhang, mzhan, pkrempa
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: libvirt-1.0.5-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 854537 Environment:
Last Closed: 2014-06-13 09:34:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 854537    
Bug Blocks:    

Description Luwen Su 2013-04-02 10:44:41 UTC
+++ This bug was initially created as a clone of Bug #854537 +++

Clone to RHEL7 for tracking.

Description of problem:
libvirt ignores cpu tuning values set in XML if they are out of range and uses defaults

Refer to the http://libvirt.org/formatdomain.html#elementsCPUTuning
emulator_period - The value should be in range [1000, 1000000]. A period with value 0 means no value.
emulator_quota -The value should be in range [1000, 18446744073709551] or less than 0. A quota with value 0 means no value.

Version-Release number of selected component (if applicable):
libvirt-1.0.3-1.el7.x86_64
qemu-kvm-1.4.0-1.el7.x86_64


How reproducible:
100% 

Steps to Reproduce:
# virsh dumpxml test
<domain type='kvm' id='37'>
 .....
  <cputune>
    <emulator_period>500</emulator_period>
    <emulator_quota>500</emulator_quota>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='2'/>

  </cputune>
.....
</domain>

# virsh schedinfo test
Scheduler      : posix
cpu_shares     : 0
vcpu_period    : 0
vcpu_quota     : 0
emulator_period: 500
emulator_quota : 500

Comment 2 Peter Krempa 2013-04-02 12:50:57 UTC
Fixed upstream:

commit f8e3221f9905972cf6d9aa78fd683f99e3bb13f3
Author: Peter Krempa <pkrempa>
Date:   Mon Mar 11 14:20:58 2013 +0100

    conf: Enforce ranges on cputune variables
    
    The limits are documented at
    http://libvirt.org/formatdomain.html#elementsCPUTuning . Enforce them
    when going through XML parsing in addition to being enforced by the API.

Moving to POST.

Comment 3 Peter Krempa 2013-04-02 14:36:01 UTC
git desc: v1.0.4-6-gf8e3221

Comment 4 Luwen Su 2013-05-08 03:53:50 UTC
Test with
libvirt-1.0.5-1.el7.x86_64

1.
<cputune>
    <emulator_period>500</emulator_period>
    <emulator_quota>1000</emulator_quota>
</cputune>

error: unsupported configuration: Value of cputune emulator_period must be in range [1000, 1000000]
Failed. Try again? [y,n,f,?]:

2.
<cputune>
    <emulator_period>1000</emulator_period>
    <emulator_quota>500</emulator_quota>
</cputune>

error: unsupported configuration: Value of cputune emulator_quota must be in range [1000, 18446744073709551]
Failed. Try again? [y,n,f,?]:


So set it Verify

Comment 5 Ludek Smid 2014-06-13 09:34:37 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.