RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1047234 - virsh command numatune accept integer as mode type.
Summary: virsh command numatune accept integer as mode type.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 7.0
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-30 02:19 UTC by Hao Liu
Modified: 2014-06-18 01:01 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.1.1-18.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:49:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hao Liu 2013-12-30 02:19:29 UTC
Description of problem:
virsh command numatune accept integer as mode type.

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

How reproducible:
100%

Steps to Reproduce:
With a shut-off vm test-vm,

1. Change NUMA mode using numatune and an integer <N> as mode type.
# virsh numatune test-vm --mode <N>

2. Check NUMA mode <mode>
# virsh numatune test-vm
numa_mode      : <mode>
numa_nodeset   : 

Actual Result:
<N> = 0: <mode> = strict
<N> = 1: <mode> = preferred
<N> = 2: <mode> = interleave
else: <mode> = (null)

Expected Result:
error: Invalid mode: <N>

Comment 2 Peter Krempa 2014-01-06 15:21:56 UTC
Fixed upstream with:

commit 6e7490c734a538983f9c5ae680cdb36edbaffe65
Author: Peter Krempa <pkrempa>
Date:   Mon Jan 6 14:26:14 2014 +0100

    qemu: range check numa memory placement mode
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1047234
    
    Add a range check for supported numa memory placement modes provided by
    the user before setting them in the domain definition. Without the check
    the user is able to provide a (yet) unknown mode which is then stored in
    the domain definition. This potentially causes a NULL dereference when
    the defintion is formatted into the XML.
    
    To reproduce run:
     virsh numatune DOMNAME --mode 6 --nodeset 0
    
    The XML will then contain:
      <numatune>
          <memory mode='(null)' nodeset='0'/>
      </numatune>
    
    With this fix, the command fails:
     error: Unable to change numa parameters
     error: invalid argument: unsupported numa_mode: '6'

commit 8b573a6b0d1ee9d99862104f28fee8bc7f949a9d
Author: Peter Krempa <pkrempa>
Date:   Mon Jan 6 14:11:42 2014 +0100

    qemu: Clean up qemuDomainSetNumaParameters
    
    Add whitespace to separate logical code blocks, reformat error messages
    and clean up code flow.
    
    This patch changes error handling in some cases where the the loop would
    be continued to jump to cleanup instead and error out rather than modify
    the domain any further.

Comment 5 Hao Liu 2014-01-13 02:08:01 UTC
This fix is VERIFIED on libvirt-1.1.1-18.el7.x86_64:

Verifying steps:
# virsh numatune test-vm
numa_mode      : strict
numa_nodeset   :


# virsh numatune test-vm --mode 0


# virsh numatune test-vm
numa_mode      : strict
numa_nodeset   : 


# virsh numatune test-vm --mode 1


# virsh numatune test-vm
numa_mode      : preferred
numa_nodeset   : 


# virsh numatune test-vm --mode 2


# virsh numatune test-vm
numa_mode      : interleave
numa_nodeset   : 


# virsh numatune test-vm --mode 3
error: Unable to change numa parameters
error: invalid argument: unsupported numa_mode: '3'


# virsh numatune test-vm
numa_mode      : interleave
numa_nodeset   : 


# virsh numatune test-vm --mode -1
error: Unable to change numa parameters
error: invalid argument: unsupported numa_mode: '-1'


# virsh numatune test-vm
numa_mode      : interleave
numa_nodeset   : 

numatune on longer permit unsupported numa modes. so it's VERIFIED.

Comment 6 zhengqin 2014-02-20 06:22:15 UTC
Could reproduce it with above steps for libvirt-1.1.1-16.el7.x86_64.

Have fixed and verified libvirt-1.1.1-23.el7.x86_64:
# virsh numatune test-vm
numa_mode      : strict
numa_nodeset   :


# virsh numatune test-vm --mode 0


# virsh numatune test-vm
numa_mode      : strict
numa_nodeset   : 


# virsh numatune test-vm --mode 1


# virsh numatune test-vm
numa_mode      : preferred
numa_nodeset   : 


# virsh numatune test-vm --mode 2


# virsh numatune test-vm
numa_mode      : interleave
numa_nodeset   : 


# virsh numatune test-vm --mode 3
error: Unable to change numa parameters
error: invalid argument: unsupported numa_mode: '3'


# virsh numatune test-vm
numa_mode      : interleave
numa_nodeset   : 


# virsh numatune test-vm --mode -1
error: Unable to change numa parameters
error: invalid argument: unsupported numa_mode: '-1'


# virsh numatune test-vm
numa_mode      : interleave
numa_nodeset   :

Comment 7 Ludek Smid 2014-06-13 12:49:25 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.


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