Bug 962222 - virsh shutdown VM doesn't always close qemu-kvm process.
virsh shutdown VM doesn't always close qemu-kvm process.
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
  Show dependency treegraph
Reported: 2013-05-12 13:53 EDT by Andreas
Modified: 2016-04-09 19:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-04-09 19:11:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andreas 2013-05-12 13:53:19 EDT
Description of problem:

Since I've changed my AMD FX processor (from quad-core to eight-core), there are problems with virsh shutdown of some VMs which I never saw before.

The VM (kvm, 64bit VM w/o any userinterface like vnc, ...) is shutting down as expected, but the qemu-kvm process isn't removed.

The following workarounds remove the process after executing virsh shutdown VM and waiting for complete shutdown of the VM:

- Starting vncviewer :12 e.g.
- Calling virsh shutdown VM again
- Stracing libvirtd during virsh shutdown VM makes it working again as expected.

Version-Release number of selected component (if applicable):

Linux:		3.4.x, 3.8.x, 3.9.x
kvm:		1.2.0, 1.3.1
libvirt:	0.9.10, 1.0.4, 1.0.5

How reproducible:

Steps to Reproduce:
1. Start a VM (virsh start VM) and wait until it's completely started.
2. Stop it again with virsh shutdown VM.

Actual results:

The VM has powered down, but the qemu-kvm process is running still.

Expected results:

The qemu-kvm process should have been killed.

Additional info:

This patch fixes the problem:

--- qemu_process.c.orig 2013-05-02 04:18:51.000000000 +0200
+++ qemu_process.c      2013-05-12 18:26:16.342729678 +0200
@@ -3935,6 +3935,7 @@

     if ((flags & VIR_QEMU_PROCESS_KILL_NOWAIT)) {
+       usleep(100*1000);
                        (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
                        SIGKILL : SIGTERM);
Comment 1 Cole Robinson 2016-04-09 19:11:57 EDT
I'm sorry this never received a response. Not sure what the root problem is... probably some temporary libvirt breakage because I haven't heard reports like this in a long time.

If anyone can still reproduce with modern libvirt, please file a new bug. I'm closing this one as DEFERRED

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