Skip to content

Commit

Permalink
Search for qemu-system and qemy-kvm processes
Browse files Browse the repository at this point in the history
On some platform we call qemu-kvm and not qemu-system. Therefore search
for both types of processes when sending SIGTERM to left over qemu
processes.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Nov 27, 2019
1 parent 31db24a commit 60b2027
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/virt-launcher/virt-launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,13 @@ func ForkAndMonitor(qemuProcessCommandPrefix string, ephemeralDiskDir string, co

}
// give qemu some time to shut down in case it survived virt-handler
pid, _ := virtlauncher.FindPid(qemuProcessCommandPrefix)
// Most of the time we call `qemu-system=* binaries, but qemu-system-* packages
// are not everywhere available where libvirt and qemu are. There we usually call qemu-kvm
// which resides in /usr/libexec/qemu-kvm
pid, _ := virtlauncher.FindPid("qemu-system")
if pid <= 0 {
pid, _ = virtlauncher.FindPid("qemu-kvm")
}
if pid > 0 {
p, err := os.FindProcess(pid)
if err != nil {
Expand Down

0 comments on commit 60b2027

Please sign in to comment.