Bug 1146334 - report error for invalid memAccess when parsing cpu
Summary: report error for invalid memAccess when parsing cpu
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-25 03:25 UTC by Jincheng Miao
Modified: 2015-11-19 05:53 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:53:12 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Jincheng Miao 2014-09-25 03:25:26 UTC
description of problem:
libvirtd should report error for invalid memAccess when parsing cpu.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. configure guest like this:
# virsh edit r7b
...
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='0'/>
    </hugepages>
  </memoryBacking>
...
  <vcpu placement='static'>4</vcpu>
  <cpu>
    <numa>
      <cell id='1' cpus='2-3' memory='524288'/>
      <cell id='0' cpus='0-1' memory='524288' memAccess='invalid'/>
    </numa>
  </cpu>
...

2. dumpxml guest
# virsh dumpxml r7b | grep memAccess
      <cell id='1' cpus='0-1' memory='524288' memAccess='(null)'/>

Expect result:
in step 1:
# virsh edit r7b
error: unsupported configuration: Invalid 'memAccess' attribute value 'invalid'

Comment 1 Ján Tomko 2015-01-26 16:51:56 UTC
Fixed upstream by:
commit e02908880259c2587c7ec42d5ab5d967a7daa0a1
Author:     Jincheng Miao <jmiao@redhat.com>
AuthorDate: 2014-09-25 19:28:33 +0800
Commit:     Martin Kletzander <mkletzan@redhat.com>
CommitDate: 2014-09-26 16:03:14 +0200

    conf: report error in virCPUDefParseXML
    
    When detected invalid 'memAccess', virCPUDefParseXML should report error.
    
    Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1146334
    
    Signed-off-by: Jincheng Miao <jmiao@redhat.com>

git describe: v1.2.9-rc1-17-ge029088 contains: v1.2.9-rc2~4

Comment 2 lcheng 2015-04-21 10:39:59 UTC
Reproduced this bug with libvirt-1.2.8-16.el7.x86_64.

# rpm -q libvirt
libvirt-1.2.8-16.el7.x86_64

# virsh edit 7
...
  <memory unit='KiB'>1024000</memory>
  <currentMemory unit='KiB'>1024000</currentMemory>
  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='0'/>
    </hugepages>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
...
  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='512000' unit='KiB' memAccess='invalid'/>
      <cell id='1' cpus='2-3' memory='512000' unit='KiB'/>
    </numa>
  </cpu>
...

# virsh dumpxml 7 | grep memAccess
      <cell id='0' cpus='0-1' memory='524288' memAccess='(null)'/>



Verified with libvirt-1.2.14-1.el7.x86_64. The bug is resolved. Move to VERIFIED.


1. Set memAccess='invalid'.

# cat 7.xml 
...
  <memory unit='KiB'>1024000</memory>
  <currentMemory unit='KiB'>1024000</currentMemory>
  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='0'/>
    </hugepages>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
...
  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='512000' unit='KiB' memAccess='invalid'/>
      <cell id='1' cpus='2-3' memory='512000' unit='KiB'/>
    </numa>
  </cpu>
...


# virsh define 7.xml 
error: Failed to define domain from 7.xml
error: unsupported configuration: Invalid 'memAccess' attribute value 'invalid'

2. Change memAccess from 'invalid' to 'shared'.
# cat 7.xml 
...
  <memory unit='KiB'>1024000</memory>
  <currentMemory unit='KiB'>1024000</currentMemory>
  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='0'/>
    </hugepages>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
...
  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='512000' unit='KiB' memAccess='shared'/>
      <cell id='1' cpus='2-3' memory='512000' unit='KiB'/>
    </numa>
  </cpu>
...


# virsh define 7.xml 
Domain 7 defined from 7.xml


3. Change memAccess from 'shared' to 'invalid'.
# virsh edit 7
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element cpu in interleave
Element domain failed to validate content

Failed. Try again? [y,n,i,f,?]:

Comment 5 errata-xmlrpc 2015-11-19 05:53:12 UTC
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/RHBA-2015-2202.html


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