From nobody Wed May 14 09:51:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526250786763299.83088246428827; Sun, 13 May 2018 15:33:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A0CD317466D; Sun, 13 May 2018 22:33:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3D5E2010CF4; Sun, 13 May 2018 22:33:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A25364CA95; Sun, 13 May 2018 22:33:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4DMWYPc022305 for ; Sun, 13 May 2018 18:32:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id D21656017B; Sun, 13 May 2018 22:32:34 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9FA56017A for ; Sun, 13 May 2018 22:32:32 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E208B18DF7D for ; Sun, 13 May 2018 22:32:30 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id o4-v6so10331919wrm.0 for ; Sun, 13 May 2018 15:32:30 -0700 (PDT) Received: from clem.localdomain ([78.194.94.51]) by smtp.gmail.com with ESMTPSA id p7-v6sm9101486wrj.85.2018.05.13.15.32.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 May 2018 15:32:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fDXxMf6S1gfINpCL0C84bU3kFtvNTsc+357oP/K7/6o=; b=KB/kVNV/zpiMG+D2rgkaFO0qQttPs+vLROdoxUbzPZ7WAnzKZewX9+oYH5t8vbS/UW jJodJczidhA6R2AFaauWF1ti8jb8KB/9kdtXaS0kTBbSz1jxvpMYh2NpLzR9nxeCh4wg BCaiEmFmEVKV52GaPQh0xg8hLOGzRvyBtf4S2u0KA+Mo8rIRkEsqYkGxkSHxGo9+y43p +0SwM574FwTi8N+9nqk58ZvULMHv8vipDlicHkUhr2Gln25BbNA78QSgF+Cr/YkL/+Aq mSLY7JMoHjuUCjYd5mnuw43UqzD5XUz81w91JWZC5SDz+mKbdX6sX8nmNF/vgXfntleM POWQ== X-Gm-Message-State: ALKqPwcBX0vmPthb8VN89l2xwhfFjwEpMU/P1vizULzBByJSIdoGcJAF dXQSveqhRYq9tQt/+RCjdeX1WQ== X-Google-Smtp-Source: AB8JxZpt6fQEWaGVnEdpLM76XwFMnhvBd83MP7m4YURK6aTqZpPmKooVOUL+sfgwXDnpeM5Ox/DPmg== X-Received: by 2002:adf:ad61:: with SMTP id p88-v6mr4932849wrc.24.1526250749323; Sun, 13 May 2018 15:32:29 -0700 (PDT) From: clem@lse.epita.fr To: libvir-list@redhat.com Date: Mon, 14 May 2018 00:32:15 +0200 Message-Id: <20180513223215.5387-4-clem@lse.epita.fr> In-Reply-To: <20180513223215.5387-1-clem@lse.epita.fr> References: <20180513223215.5387-1-clem@lse.epita.fr> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 13 May 2018 22:32:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 13 May 2018 22:32:31 +0000 (UTC) for IP:'209.85.128.193' DOMAIN:'mail-wr0-f193.google.com' HELO:'mail-wr0-f193.google.com' FROM:'clementinehayat@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.117 (FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.193 mail-wr0-f193.google.com 209.85.128.193 mail-wr0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Clementine Hayat Subject: [libvirt] [PATCH 3/3] bhyve: start using virDomainObjCheckActive 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 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sun, 13 May 2018 22:33:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Clementine Hayat Signed-off-by: Clementine Hayat --- src/bhyve/bhyve_driver.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 24c4a9c80e..848116f14a 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -996,11 +996,8 @@ bhyveDomainDestroy(virDomainPtr dom) if (virDomainDestroyEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("Domain is not running")); + if (virDomainObjCheckActive(vm) < 0) goto cleanup; - } =20 ret =3D virBhyveProcessStop(privconn, vm, VIR_DOMAIN_SHUTOFF_DESTROYED= ); event =3D virDomainEventLifecycleNewFromObj(vm, @@ -1031,11 +1028,8 @@ bhyveDomainShutdown(virDomainPtr dom) if (virDomainShutdownEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("Domain is not running")); + if (virDomainObjCheckActive(vm) < 0) goto cleanup; - } =20 ret =3D virBhyveProcessShutdown(vm); =20 @@ -1062,11 +1056,8 @@ bhyveDomainOpenConsole(virDomainPtr dom, if (virDomainOpenConsoleEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + if (virDomainObjCheckActive(vm) < 0) goto cleanup; - } =20 if (!vm->def->nserials) { virReportError(VIR_ERR_INTERNAL_ERROR, --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list