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 1020102 - qmp don't give any message when specify balloon size more than memory via qmp
Summary: qmp don't give any message when specify balloon size more than memory via qmp
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Luiz Capitulino
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-17 02:27 UTC by Jun Li
Modified: 2013-10-17 18:43 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-17 18:43:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jun Li 2013-10-17 02:27:59 UTC
Description of problem:
When specify balloon size more than memory, qmp do not return any reasonable hint or the actual size of balloon.
But on Rhel6, qmp will return the actual size. Please ref https://bugzilla.redhat.com/show_bug.cgi?id=927336#c15 .
I also test specify balloon size smaller than memory, qmp will return the actual size. Please see "Additional info:".

Version-Release number of selected component (if applicable):
3.10.0-34.el7.x86_64
qemu-kvm-rhev-1.5.3-9.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot a guest.
# /usr/libexec/qemu-kvm -enable-kvm -m 5G -smp 2,sockets=2,cores=2,threads=1 -drive file=/mnt/rhel7base.qcow2_v3,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0b:38,bus=pci.0 -spice port=8000,disable-ticketing -k en-us -vga qxl -global qxl-vga.vram_size=67108864 -monitor stdio -device virtio-balloon-pci,id=ballooning -qmp tcp:0:4445,server,nowait

2.specify balloon size more than memory via qmp(boot with  5G goes down to 7G).
{"execute":"balloon","arguments":{"value":7516192768},"id":"libvirt-9"}

3.Check the return of qmp.

Actual results:
{"execute":"balloon","arguments":{"value":7516192768},"id":"libvirt-9"}
{"return": {}, "id": "libvirt-9"}

Expected results:
When specify balloon size more than memory, qmp will return a reasonable hint or the actual size of balloon.

Additional info:
I also test the followings scenarios.
Senario 1:boot with  5G goes down to 1G:
...
{"execute":"balloon","arguments":{"value":1073741824},"id":"libvirt-9"}
{"return": {}, "id": "libvirt-9"}
{"timestamp": {"seconds": 1381975120, "microseconds": 312924}, "event": "BALLOON_CHANGE", "data": {"actual": 5367660544}}
{"timestamp": {"seconds": 1381975121, "microseconds": 313064}, "event": "BALLOON_CHANGE", "data": {"actual": 1200619520}}
{"timestamp": {"seconds": 1381975121, "microseconds": 342414}, "event": "BALLOON_CHANGE", "data": {"actual": 1073741824}}

Senario 2:boot with  5G goes down to 0G
...
{"execute":"balloon","arguments":{"value":0},"id":"libvirt-9"}
{"id": "libvirt-9", "error": {"class": "GenericError", "desc": "Parameter 'target' expects a size"}}

Comment 2 Luiz Capitulino 2013-10-17 18:43:42 UTC
(In reply to Jun Li from comment #0)
> Description of problem:
> When specify balloon size more than memory, qmp do not return any reasonable
> hint or the actual size of balloon.

By "more than memory" do you mean specifying a balloon value which is greater than the memory assigned to the guest in the command-line? If this is what you meant, then we have two cases. Supposed you passed "-m 5G" to QEMU:

1. If the guest's balloon is empty (eg. QEMU just booted) and you ask the guest to grow to 7G, nothing will happen. This is so because QEMU will automatically limit the operation to 5G which is what the guest currently has. I agree an error message there would be better, but that's how the balloon command has always worked and changing that would break QMP clients

2. If the guest balloon is already inflated (say, the guest currently has 2G) and you ask the guest to grow to 7G, then the guest will grow only to 5G. Again, I agree a error message would be better but we'd need to add a new command for this, which is overkill

> But on Rhel6, qmp will return the actual size. Please ref
> https://bugzilla.redhat.com/show_bug.cgi?id=927336#c15 .

Are you referring to scenario 2? I believe there's a typo there, I think the reporter really wanted to say "7G goes down to 5G" (and not "5G goes down to 7G" as this doesn't even make sense) as we can see on the test results.

> I also test specify balloon size smaller than memory, qmp will return the
> actual size. Please see "Additional info:".

Yes, that's correct.

> Steps to Reproduce:
> 1.Boot a guest.
> # /usr/libexec/qemu-kvm -enable-kvm -m 5G -smp 2,sockets=2,cores=2,threads=1
> -drive
> file=/mnt/rhel7base.qcow2_v3,if=none,id=drive-virtio-disk0,format=qcow2,
> cache=none,werror=stop,rerror=stop,aio=native -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,
> id=virtio-disk0,bootindex=1 -netdev
> tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0b:38,bus=pci.0
> -spice port=8000,disable-ticketing -k en-us -vga qxl -global
> qxl-vga.vram_size=67108864 -monitor stdio -device
> virtio-balloon-pci,id=ballooning -qmp tcp:0:4445,server,nowait
> 
> 2.specify balloon size more than memory via qmp(boot with  5G goes down to
> 7G).
> {"execute":"balloon","arguments":{"value":7516192768},"id":"libvirt-9"}

Works as expected.

> 
> 3.Check the return of qmp.
> 
> Actual results:
> {"execute":"balloon","arguments":{"value":7516192768},"id":"libvirt-9"}
> {"return": {}, "id": "libvirt-9"}
> 
> Expected results:
> When specify balloon size more than memory, qmp will return a reasonable
> hint or the actual size of balloon.
> 
> Additional info:
> I also test the followings scenarios.
> Senario 1:boot with  5G goes down to 1G:
> ...
> {"execute":"balloon","arguments":{"value":1073741824},"id":"libvirt-9"}
> {"return": {}, "id": "libvirt-9"}
> {"timestamp": {"seconds": 1381975120, "microseconds": 312924}, "event":
> "BALLOON_CHANGE", "data": {"actual": 5367660544}}
> {"timestamp": {"seconds": 1381975121, "microseconds": 313064}, "event":
> "BALLOON_CHANGE", "data": {"actual": 1200619520}}
> {"timestamp": {"seconds": 1381975121, "microseconds": 342414}, "event":
> "BALLOON_CHANGE", "data": {"actual": 1073741824}}

Works as expected.

> Senario 2:boot with  5G goes down to 0G
> ...
> {"execute":"balloon","arguments":{"value":0},"id":"libvirt-9"}
> {"id": "libvirt-9", "error": {"class": "GenericError", "desc": "Parameter
> 'target' expects a size"}}

QEMU ignores value=0, but QMP and HMP return the error above, because it expects a size, which is defined as > 0. I think we should allow the guest to go to 0 (we allow 1MB, why a special test for 0?) but this is a very minor problem which doesn't seem to have any practical implications, so let's leave it alone.


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