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

Cole Robinson crobinso at redhat.com
Fri Mar 18 22:41:12 UTC 2016


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




More information about the libvir-list mailing list