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 822094 - RFE: Avoid calling 'query-balloon' monitor API in virDomainGetXMLDesc and virDomainGetInfo
Summary: RFE: Avoid calling 'query-balloon' monitor API in virDomainGetXMLDesc and vir...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Gunannan Ren
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 822092
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-16 10:22 UTC by Daniel Berrangé
Modified: 2014-06-18 00:40 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.10.2-3.el7
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:25:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2012-05-16 10:22:21 UTC
Description of problem:
In the QEMU impl of virDomainGetXMLDesc and virDomainGetInfo we currently invoke the 'query-balloon' QMP command to update our view of the balloon driver. This has caused no end of trouble for RHEV, virt-manager & GNOME Boxes because it makes these APIs significantly slower and means libvirt is susceptible to a "hung" QEMU process.

With QEMU able to provide an event notification we must disable these API calls from libvirt, once we see a BALLOON_CHANGE event emitted and rely on the async event notifications instead.

Comment 1 Daniel Berrangé 2012-05-16 14:42:00 UTC
Proof of concept impl

https://www.redhat.com/archives/libvir-list/2012-May/msg00868.html

Comment 2 Gunannan Ren 2012-07-14 08:11:55 UTC
These two patches have been pushed upstream afte a little modification. set to POST.

commit 1d9d5103b4558e5bc2310b25b486847f50e66d3b
Author: Daniel P. Berrange <berrange>
Date:   Thu Jul 12 23:45:57 2012 +0800

    Wire up handling for QMP's BALLOON_EVENT
    
    If QEMU supports the BALLOON_EVENT QMP event, then we can
    avoid invoking 'query-balloon' when returning XML or the
    domain info.

commit 7ed6d7dda78b48ee02af285f6edfbe6dd719c2bc
Author: Daniel P. Berrange <berrange>
Date:   Fri Jul 13 17:05:17 2012 +0800

    Define public API for receiving guest memory balloon events
    
    When the guest changes its memory balloon applications may want
    to know what the new value is, without having to periodically
    poll on XML / domain info. Introduce a "balloon change" event
    to let apps see this

Comment 3 Min Zhan 2012-12-24 08:00:46 UTC
Verified on the following pkgs:
libvirt-1.0.1-1.el7.x86_64
qemu-kvm-1.2.0-21.el7.x86_64

Steps:
1. Start the guest
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6u3                        shut off
# virsh dumpxml rhel6u3
<domain type='kvm'>
  <name>rhel6u3</name>
  <uuid>79aaa2c7-08c4-11d6-8610-b8dd52dcc26d</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
...
# virsh start rhel6u3
Domain rhel6u3 started

# python /usr/share/doc/libvirt-python-1.0.1/events-python/event-test.py 
Using uri:qemu:///system
myDomainEventCallback1 EVENT: Domain rhel6u3(71) Started Booted
myDomainEventCallback2 EVENT: Domain rhel6u3(71) Started Booted

2. change the memory
# virsh setmem rhel6u3 800M

# python /usr/share/doc/libvirt-python-1.0.1/events-python/event-test.py 
Using uri:qemu:///system
myDomainEventCallback1 EVENT: Domain rhel6u3(71) Started Booted
myDomainEventCallback2 EVENT: Domain rhel6u3(71) Started Booted
myDomainEventBalloonChangeCallback: Domain rhel6u3(71) 1047552
myDomainEventBalloonChangeCallback: Domain rhel6u3(71) 819200

3. # pidof qemu-kvm
9859
# kill -STOP 9859

4. # virsh dumpxml rhel6u3
<domain type='kvm' id='71'>
  <name>rhel6u3</name>
  <uuid>79aaa2c7-08c4-11d6-8610-b8dd52dcc26d</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>819200</currentMemory>
  <vcpu placement='static'>1</vcpu>
...

# virsh dominfo rhel6u3
Id:             71
Name:           rhel6u3
UUID:           79aaa2c7-08c4-11d6-8610-b8dd52dcc26d
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       23.3s
Max memory:     1048576 KiB
Used memory:    819200 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0
Security label: system_u:system_r:svirt_t:s0:c97,c639 (enforcing)


virsh dumpxml or dominfo can return immediately even if the qemu process is stopped and not responding. 

------------
Reproduced with 
libvirt-0.9.11.3-1.el7.x86_64
qemu-kvm-1.0-17.1.el7.x86_64

Steps:

# virsh start rhel63
Domain rhel63 started

# python /usr/share/doc/libvirt-python-0.9.11.3/events-python/event-test.py 
Using uri:qemu:///system
myDomainEventCallback1 EVENT: Domain rhel63(2) Started Booted
myDomainEventCallback2 EVENT: Domain rhel63(2) Started Booted


# virsh setmem rhel63 800M

# python /usr/share/doc/libvirt-python-0.9.11.3/events-python/event-test.py 
Using uri:qemu:///system

no more other events.

# pidof qemu-kvm
6246
# kill -STOP 6246
# virsh dumpxml rhel63

it will block until execute 'kill -CONT 6246', then result will be returned.

# kill -STOP 6246
# virsh dominfo rhel63
Id:             3
Name:           rhel63
UUID:           26a08941-e4b2-6cad-33f9-ae55505892ac
OS Type:        hvm

It will block here until execute 'kill -CONT 6246', then the whole result will be returned.

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