From nobody Wed Oct 29 09:06:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524758339125335.7699247409837; Thu, 26 Apr 2018 08:58:59 -0700 (PDT) Received: from localhost ([::1]:43050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBjIQ-0002O6-34 for importer@patchew.org; Thu, 26 Apr 2018 11:58:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBjGM-0000yg-ME for qemu-devel@nongnu.org; Thu, 26 Apr 2018 11:56:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBjGL-0003fL-Iy for qemu-devel@nongnu.org; Thu, 26 Apr 2018 11:56:50 -0400 Received: from smtp03.citrix.com ([162.221.156.55]:29395) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBjGL-0003eE-AM for qemu-devel@nongnu.org; Thu, 26 Apr 2018 11:56:49 -0400 X-IronPort-AV: E=Sophos;i="5.49,330,1520899200"; d="scan'208";a="52857217" From: Ian Jackson To: Date: Thu, 26 Apr 2018 16:56:17 +0100 Message-ID: <1524758187-9351-7-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1524758187-9351-1-git-send-email-ian.jackson@eu.citrix.com> References: <1524758187-9351-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 162.221.156.55 Subject: [Qemu-devel] [PULL 06/16] xen: destroy_hvm_domain: Move reason into a variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Ian Jackson , Ross Lagerwall , Anthony PERARD , xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We are going to want to reuse this. No functional change. Signed-off-by: Ian Jackson Reviewed-by: Anthony PERARD Acked-by: Stefano Stabellini --- hw/i386/xen/xen-hvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 9c3b6b3..3590d99 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1387,12 +1387,13 @@ void destroy_hvm_domain(bool reboot) xc_interface *xc_handle; int sts; =20 + unsigned int reason =3D reboot ? SHUTDOWN_reboot : SHUTDOWN_poweroff; + xc_handle =3D xc_interface_open(0, 0, 0); if (xc_handle =3D=3D NULL) { fprintf(stderr, "Cannot acquire xenctrl handle\n"); } else { - sts =3D xc_domain_shutdown(xc_handle, xen_domid, - reboot ? SHUTDOWN_reboot : SHUTDOWN_power= off); + sts =3D xc_domain_shutdown(xc_handle, xen_domid, reason); if (sts !=3D 0) { fprintf(stderr, "xc_domain_shutdown failed to issue %s, " "sts %d, %s\n", reboot ? "reboot" : "poweroff", --=20 2.1.4