| Summary: | qemu-attach should not hang when execute the 2nd time | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | yalzhang <yalzhang> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| Status: | CLOSED ERRATA | QA Contact: | Jing Qi <jinqi> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.3 | CC: | dyuan, fjin, jdenemar, pkrempa, rbalakri, xuzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-2.5.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-01 17:16:43 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
yalzhang@redhat.com
2016-09-22 10:54:58 UTC
"JSON monitor is required" originates from my recent VCPU patches, which incorrectly require the JSON monitor in case of attaching to a qemu process. Libvirt then doesn't properly clean up. commit 2c739866df5a820b2db280b36cd8b6fe00cfba58
Author: Peter Krempa <pkrempa>
Date: Mon Oct 3 13:11:47 2016 +0200
qemu: attach: Close monitor socket on connection failure
If attaching to a qemu process fails after opening the monitor socket
libvirt does not clean up the monitor. As the monitor also holds a
reference to the domain object the qemu attach API basically leaks it.
QEMU also does not interact on a second monitor connection and thus a
further attempt to attach to it would lock up.
Prevent libvirt from leaking the monitor by explicitly closing it.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1378401
commit 62135ff692044a0a7cac5ee91f2cb42463550052
Author: Peter Krempa <pkrempa>
Date: Fri Sep 30 12:45:59 2016 +0200
qemu: Don't strictly require JSON monitor for vCPU detection
Attaching to a existing qemu process allows to get us into a situation
when qemu is new enough to have JSON monitor and new vCPU hotplug but
the json monitor is not used. The vCPU detection code would require it
though. This broke attaching to qemu processes.
Make the condition less strict and just skip the vCPU hotplug detection
if JSON monitor is not available.
Resolves one of the symptoms in:
https://bugzilla.redhat.com/show_bug.cgi?id=1378401
Test passed with version libvirt-2.5.0-1.el7.x86_64 & qemu-kvm-rhev-2.6.0-28.el7.x86-64. 1. # qemu-img create /var/lib/libvirt/images/foo.img 1G 2. # /usr/libexec/qemu-kvm -cdrom /var/lib/libvirt/images/foo.img -monitor unix:/tmp/demo,server,nowait -name foo VNC server running on '::1;5900' 3.qemu-attach succeeded. # virsh qemu-attach 5975 Domain foo attached to pid 5975 4. virsh list Id Name State ---------------------------- 1 foo running 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://access.redhat.com/errata/RHEA-2017:1846 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://access.redhat.com/errata/RHEA-2017:1846 |