qemu: Fix unintentional shadowing of monitorPath variable

Signed-off-by: Simarpreet Singh <simar@linux.com>
This commit is contained in:
Simarpreet Singh 2018-01-25 16:24:10 -08:00
parent 3dacd0171f
commit 8b058f7570
No known key found for this signature in database
GPG Key ID: 968CB29E0FB1DA5F
1 changed files with 2 additions and 1 deletions

View File

@ -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