Bug 1293241 - libvirt should forbid set 0,^0 in cpuset instead of generate a xml which have broken settings
libvirt should forbid set 0,^0 in cpuset instead of generate a xml which have...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-21 03:03 EST by Luyao Huang
Modified: 2016-11-03 14:49 EDT (History)
4 users (show)

See Also:
Fixed In Version: libvirt-1.3.2-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:49:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description Luyao Huang 2015-12-21 03:03:38 EST
Description of problem:
libvirt should forbid set 0,^0 in cpuset instead of generate a xml which have broken settings

Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7_2.2.x86_64

How reproducible:
100%

Steps to Reproduce:
1.prepare a inactive guest:

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     RHEL71-lhuang                  shut off


2. edit xml and add vcpupin/emulatorpin like this:

  <cputune>
    <vcpupin vcpu='0' cpuset='0,^0'/>
  </cputune>

# virsh edit RHEL71-lhuang
Domain RHEL71-lhuang XML configuration edited.


3. recheck the xml:

# virsh dumpxml RHEL71-lhuang
...
  <cputune>
    <vcpupin vcpu='0' cpuset=''/>
  </cputune>
...

4. restart libvirtd guest will disappear since xml have broken setting:

# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

# virsh dumpxml RHEL71-lhuang
error: failed to get domain 'RHEL71-lhuang'
error: Domain not found: no domain with matching name 'RHEL71-lhuang'


Actual results:
when set 0,^0 in cpuset in emulatorpin/vcpupin element, libvirt generate a xml which have broken settings

Expected results:

like iothread, output error:

# virsh edit RHEL71-lhuang
error: unsupported configuration: Invalid value of 'cpuset': 0,^0
Failed. Try again? [y,n,i,f,?]: 


Additional info:
Comment 1 Peter Krempa 2016-01-27 11:31:46 EST
Fixed upstream:

commit 31b782a147b9b4a9aa758d8eba9fba5b72a6abb1
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Wed Jan 6 15:34:13 2016 +0100

    conf: disallow empty cpusets for vcpu pinning when parsing XML
    
    They are disallowed in the pinning API and as default cpuset.

v1.3.1-66-g7639417
Comment 3 Luyao Huang 2016-06-02 03:34:19 EDT
Verify this bug with libvirt-1.3.4-1.el7.x86_64:

1. prepare a guest:

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel72-test                    shut off

2. add empty cpuset in guest xml

# virsh edit rhel72-test

  <cputune>
    <vcpupin vcpu='0' cpuset='0,^0'/>
  </cputune>

error: unsupported configuration: Invalid value of 'cpuset': 0,^0
Failed. Try again? [y,n,i,f,?]:
Comment 5 errata-xmlrpc 2016-11-03 14:49:51 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2577.html

Note You need to log in before you can comment on or make changes to this bug.