Bug 704836

Summary: Serial console is not disconnected automatically when a guest OS is shut down.
Product: Red Hat Enterprise Linux 6 Reporter: Sadique Puthen <sputhenp>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dallan, dyuan, jwest, myamazak, mzhan, rwu, vbian, whuang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.4-rc1-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:09:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 658636    

Description Sadique Puthen 2011-05-15 12:21:10 UTC
Description of Problem:

This is a regression problem since RHEL6.0.

When a guest OS connected to a serial console by "virsh console" is shut down,
the serial console is not disconnected automatically. After a message "Power down." appears in the serial console, it is disconnected by pressing any key (e.g. space key), but then the following error message appears there.

--------------------------------
<snip>
Power down.

error: Failed to disconnect from the hypervisor, 1 leaked reference(s)
#
--------------------------------

Version-Release number of selected component:
Red Hat Enterprise Linux Version Number: Red Hat Enterprise Linux 6.1
Release Number: Beta
Architecture: x86_64
Kernel Version: kernel-2.6.32-122.el6.x86_64
Related Package Version: libvirt-0.8.7-11.el6.x86_64 and libvirt-client-0.8.7-11.el6.x86_64

How reproducible:
always.

Step to Reproduce:
1. Start a guest OS.
# virsh start <domain-name>
2. Append "console=tty0 console=ttyS0,115200" into the "kernel" directive in
/boot/grub/grub.conf so as to configure a serial console.
# cat /boot/grub/grub.conf
3. Stop the guest OS.
# virsh shutdown <domain-name>
4. Start the guest OS.
# virsh start <domain-name>
5. Connect the serial console with the guest OS.
# virsh connect <domain-name>
6. Login to the guest OS with the serial console.
<snip>
Escape character is ^]
<snip>
test01 login:
Password:
7. Stop the guest OS with the serial console.
guest # shutdown -h now
8. Confirm that a message "Power down" appears in the serial console.
9. Press any key to continue.

Actual Results:
The serial console is not disconnected automatically then, but is done by
pressing any key.

Expected Results:
The serial console is disconnected automatically.

Comment 2 Dave Allan 2011-05-16 21:08:13 UTC
I see this behavior as well.

Comment 3 Osier Yang 2011-05-17 06:11:22 UTC
I'm surprised that this BZ actually says the same problem with BZ: https://bugzilla.redhat.com/show_bug.cgi?id=682741, and it's got fixed and verified.

Comment 4 Osier Yang 2011-05-17 06:13:33 UTC
<quote>
Related Package Version: libvirt-0.8.7-11.el6.x86_64 and
libvirt-client-0.8.7-11.el6.x86_64
</quote>

<quote>
Verified with the following builds. Move to VERIFIED, since it's already fixed.

libvirt-0.8.7-12.el6.x86_64
qemu-kvm-0.12.1.2-2.150.el6.x86_64
python-virtinst-0.500.5-2.el6.noarch
kernel-2.6.32-122.el6.x86_64
</quote>

Note that it's verified with libvirt-0.8.7-12.el6.x86_64

Comment 5 Osier Yang 2011-05-17 06:32:39 UTC
tested, with the fix for 682741, there is no warning like "Failed to disconnect from the hypervisor, 1 leaked reference", but the console is not disconnected automatically indeed, so this is a valid bug.

Comment 17 Huang Wenlong 2011-08-08 01:58:20 UTC
verify this bug with 
#rpm -q libvirt 
libvirt-0.9.4-1.el6.x86_64

connect it with "virsh console" then "shutdown -h now " it

...
Unmounting file systems: [ OK ]
init: Re-executing /sbin/init
Halting system...
Power down.

it can disconnect successfully

Comment 18 errata-xmlrpc 2011-12-06 11:09:13 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.

http://rhn.redhat.com/errata/RHBA-2011-1513.html