From 1223a5705e33e6946507f29764f187fb4a7c68a2 Mon Sep 17 00:00:00 2001 From: Simarpreet Singh Date: Thu, 25 Jan 2018 16:24:10 -0800 Subject: [PATCH 1/2] qemu: Fix unintentional shadowing of monitorPath variable Signed-off-by: Simarpreet Singh --- client/driver/qemu.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/driver/qemu.go b/client/driver/qemu.go index f256c829c..c8dc081ca 100644 --- a/client/driver/qemu.go +++ b/client/driver/qemu.go @@ -246,7 +246,7 @@ func (d *QemuDriver) Start(ctx *ExecContext, task *structs.Task) (*StartResponse } // This socket will be used to manage the virtual machine (for example, // to perform graceful shutdowns) - monitorPath, err := d.getMonitorPath(ctx.TaskDir.Dir) + monitorPath, err = d.getMonitorPath(ctx.TaskDir.Dir) if err != nil { d.logger.Printf("[ERR] driver.qemu: could not get qemu monitor path: %s", err) return nil, err @@ -464,6 +464,7 @@ func (h *qemuHandle) Kill() error { // If Nomad did not send a graceful shutdown signal, issue an interrupt to // the qemu process as a last resort if gracefulShutdownSent == false { + h.logger.Printf("[DEBUG] driver.qemu: graceful shutdown is not enabled, sending an interrupt signal to QEMU") if err := h.executor.ShutDown(); err != nil { if h.pluginClient.Exited() { return nil From 19e1a7fd61f472549ac6fd337eb8cc24d13ee968 Mon Sep 17 00:00:00 2001 From: Simarpreet Singh Date: Thu, 25 Jan 2018 16:40:16 -0800 Subject: [PATCH 2/2] qemu: Make the driver debugging output more indicative Signed-off-by: Simarpreet Singh --- client/driver/qemu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/driver/qemu.go b/client/driver/qemu.go index c8dc081ca..3e9d6f8d9 100644 --- a/client/driver/qemu.go +++ b/client/driver/qemu.go @@ -464,7 +464,7 @@ func (h *qemuHandle) Kill() error { // If Nomad did not send a graceful shutdown signal, issue an interrupt to // the qemu process as a last resort if gracefulShutdownSent == false { - h.logger.Printf("[DEBUG] driver.qemu: graceful shutdown is not enabled, sending an interrupt signal to QEMU") + h.logger.Printf("[DEBUG] driver.qemu: graceful shutdown is not enabled, sending an interrupt signal to pid: %d", h.userPid) if err := h.executor.ShutDown(); err != nil { if h.pluginClient.Exited() { return nil