Search for qemu-system and qemy-kvm processes
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.
@@ -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 {
