[PATCH] bhyve: process: Log error message when kill fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



virProcessKillPainfully will raise a libvirt error, so log it. We
can drop the manual pid logging since ProcessKill always reports
the pid in its error message.
---
 src/bhyve/bhyve_process.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index 14588a9..f2ec712 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -283,9 +283,8 @@ virBhyveProcessStop(bhyveConnPtr driver,
 
     /* First, try to kill 'bhyve' process */
     if (virProcessKillPainfully(vm->pid, true) != 0)
-        VIR_WARN("Failed to gracefully stop bhyve VM '%s' (pid: %d)",
-                 vm->def->name,
-                 (int)vm->pid);
+        VIR_WARN("Failed to gracefully stop bhyve VM '%s': %s",
+                 vm->def->name, virGetLastErrorMessage());
 
     /* Cleanup network interfaces */
     bhyveNetCleanup(vm);
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]