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 1244567 - Guest agent should report proper error while guest agent was unreachable and restart libvirtd service
Summary: Guest agent should report proper error while guest agent was unreachable and ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1293351
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-20 02:47 UTC by zhenfeng wang
Modified: 2016-11-03 18:19 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.3.2-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:19:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description zhenfeng wang 2015-07-20 02:47:31 UTC
Description of problem:
Guest agent should report proper error while guest agent was unreachable and restart libvirtd service

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

How reproducible:
100%

Steps to Reproduce:
1.Start a guest with agent configured
2.stop the guest agent service inside the guest, then excute some commands depends on qemu-guest-agent, the command will report error right away.

guest#systemctl stop qemu-guest-agent

# time virsh domtime virt-tests-vm1
error: Guest agent is not responding: QEMU guest agent is not connected


real	0m0.016s
user	0m0.007s
sys	0m0.005s


3.Restart the libvirtd service, found libvirt won't report the error right away, but still wait for the timeout of the command, this should be implemented
#systemctl restart libvirtd

# time virsh domtime virt-tests-vm1
error: Guest agent is not responding: Guest agent not available for now


real	0m5.018s
user	0m0.009s
sys	0m0.002s

Actual results:
libvirt won't report the error right away, but still wait for the timeout of the command while guest agent was unreachable and restart libvirtd service

Expected results:
Guest agent should report proper error while guest agent was unreachable and restart libvirtd service

Additional info:

Comment 4 Michal Privoznik 2016-02-11 06:04:44 UTC
Moving to POST:

commit 88ed9d771e1e2ce26cfe1a3d0238ac5977f48208
Author:     Michal Privoznik <mprivozn>
AuthorDate: Fri Jan 8 17:03:48 2016 +0100
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu Feb 11 06:52:50 2016 +0100

    qemu: Connect to guest agent iff needed
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1293351
    
    Since we already have virtio channel events, we know when guest
    agent within guest has (dis-)connected. Instead of us blindly
    connecting to a socket that no one is listening to, we can just
    follow what qemu-ga does. This has a nice benefit that we don't
    need to 'guest-ping' the agent just to timeout and find out
    nobody is listening.
    
    The way that this commit is implemented:
    - don't connect in qemuProcessLaunch directly, defer that to event
      callback (which already follows the agent) -
      processSerialChangedEvent
    - after migration is settled, before we resume vCPUs, ask qemu
      whether somebody is listening on the socket and if so, connect
      to it.
    
    Signed-off-by: Michal Privoznik <mprivozn>

v1.3.1-202-g88ed9d7

Comment 6 yalzhang@redhat.com 2016-03-04 03:35:37 UTC
verified on libvirt-1.3.2-1.el7.x86_64, the results is expected.

1. Start a guest, the qemu-guest-agent will loaded and start automatically.

2. On the host,
# time virsh domtime R7.2
Time: 1457062317

real	0m0.020s
user	0m0.008s
sys	0m0.007s

3. On the guest, stop the qemu-guest-agent
# systemctl stop qemu-guest-agent

4. On the host, restart the libvirtd service.
# systemctl restart libvirtd
# time virsh domtime R7.2
error: Guest agent is not responding: QEMU guest agent is not connected


real	0m0.020s
user	0m0.008s
sys	0m0.009s

Comment 9 errata-xmlrpc 2016-11-03 18:19:59 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/RHSA-2016-2577.html


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