From patchwork Fri Mar 18 22:41:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 64098 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp233523lbc; Fri, 18 Mar 2016 15:43:54 -0700 (PDT) X-Received: by 10.28.217.146 with SMTP id q140mr1472467wmg.85.1458341034567; Fri, 18 Mar 2016 15:43:54 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id j3si18419575wjb.167.2016.03.18.15.43.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Mar 2016 15:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2IMfLwB016529; Fri, 18 Mar 2016 18:41:21 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u2IMfGdv001950 for ; Fri, 18 Mar 2016 18:41:16 -0400 Received: from colepc.redhat.com (ovpn-113-66.phx2.redhat.com [10.3.113.66]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2IMfFer015291; Fri, 18 Mar 2016 18:41:16 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 18 Mar 2016 18:41:12 -0400 Message-Id: <7a23c4e794c0df4bd1c7b7aabf61f5985ff56396.1458340818.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Cc: bogorodskiy@gmail.com Subject: [libvirt] [PATCH] bhyve: process: Log error message when kill fails X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list 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);