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 1282335 - The default size unit of memory-backend-ram is different from "-m"
Summary: The default size unit of memory-backend-ram is different from "-m"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-16 07:28 UTC by Yumei Huang
Modified: 2016-03-28 09:51 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-20 15:30:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yumei Huang 2015-11-16 07:28:43 UTC
Description of problem:
The default size unit of memory-backend-ram is Bytes, while the default size unit of "-m" is MB.


Version-Release number of selected component (if applicable):
kernel: 3.10.0-327.2.1.el7.x86_64
qemu-kvm:  qemu-kvm-rhev-2.3.0-31.el7_2.1

How reproducible:
always

Steps to Reproduce:
1. start a qemu-kvm process:
/usr/libexec/qemu-kvm  -smp 1 -m 1024,slots=4,maxmem=8G \
-object memory-backend-ram,id=mem1,size=1024  -numa node,nodeid=0,memdev=mem1 


Actual results:
Qemu-kvm process start failed, print:
qemu-kvm: total memory for NUMA nodes (0x400) should equal RAM size (0x40000000)

Expected results:
The default size unit of memory-backend-ram should be same as '-m'. Qemu process start succeed.

Additional info:

Comment 2 Markus Armbruster 2015-11-20 15:30:16 UTC
We accept sizes in many places, but the interpretation of an
unsuffixed number varies.  HMP commands commonly interpret as
Mebibytes.  qemu-img interprets as bytes.  Command line commonly
interprets as bytes, but there are exceptions, and -m is one: it
interprets as Mebibytes for backward compatibility, see
set_memory_options().

The inconsistency is unfortunate, but it's clearly intentional, and it
cannot be fixed now, because it's ABI.  Closing NOTABUG.

I recommend to always use a suffix, like

$ /usr/libexec/qemu-kvm  -smp 1 -m 1024M,slots=4,maxmem=8G \
-object memory-backend-ram,id=mem1,size=1024M -numa node,nodeid=0,memdev=mem1


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