From nobody Sun May 5 13:49:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579315096; cv=none; d=zohomail.com; s=zohoarc; b=F9ltDzkiuNqcjFVj8In/653toVr8ATWjzSy+vdc1EAG+Unc3IEUEoZyIS88S5x8HYvmDpH6Bk9fcgDK8tsDDPjoTqj8pxCEx/FG2hONoO4OQvPu4YO9Kz/dUm+nSP1UnzNzKz9YOdMMz5fmk+9U84GJ9PTVVj83DOjEMYNPr/QU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579315096; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=AkWZomEMV1IhRhCfQCDVS3AfzeMUnCsdNLS0MznBEJs=; b=ePRZT9z5Q3RG2rDurZnq23CfU0DBZIHpWSgH+bpi236bhI0Fdsn8sDAjIYsfvCoYFLyAIN31Q1jbvXiQnkcjkX5KyE1UF22GCYqGF38EUBpvSXpwgc1ken/vzWgpalYIgpgcqGteEGdXynoP+VR7QDvZIv2NI6oxrLJP8AVKbAI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579315096256454.91609207926604; Fri, 17 Jan 2020 18:38:16 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-255-MxvoXJZZOTWWjzG18NCStQ-1; Fri, 17 Jan 2020 21:38:13 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 414AB8010C1; Sat, 18 Jan 2020 02:38:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99AB319C4F; Sat, 18 Jan 2020 02:38:03 +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 9B27A1809567; Sat, 18 Jan 2020 02:37:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00I2bsf2014973 for ; Fri, 17 Jan 2020 21:37:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 65B121006EC4; Sat, 18 Jan 2020 02:37:54 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 616211006EC0 for ; Sat, 18 Jan 2020 02:37:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 852C11011A94 for ; Sat, 18 Jan 2020 02:37:52 +0000 (UTC) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-183-0f3z9EewMEWg379bPNAbzw-1; Fri, 17 Jan 2020 21:37:50 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id AC25F5E1; Fri, 17 Jan 2020 21:37:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 17 Jan 2020 21:37:48 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 921FD80062; Fri, 17 Jan 2020 21:37:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579315094; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AkWZomEMV1IhRhCfQCDVS3AfzeMUnCsdNLS0MznBEJs=; b=CLhzbvwEWmFXF2VVO5JBQsa2h3OIWchJrNAy42A5UAv4gMSafKuH2LK5w8P1RMjnRI/YTv QTJqwZ+V5C9Qo2nVD6aC94pfHnPq8jMq5VFw0i5wBWd1oPqYVjHVuRxCQ2I1QaDYBXUh5I 564DrV2SCf5Lgn0UVTNbTr6FEaWhEaY= X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtdelgdeglecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffogggtohfgsehtkeertd ertdejnecuhfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgvtghk ihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqe enucfkphepledurdeihedrfeegrdeffeenucfrrghrrghmpehmrghilhhfrhhomhepmhgr rhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: libvir-list@redhat.com Subject: [PATCH] libxl: initialize shutdown inhibit callback Date: Sat, 18 Jan 2020 03:37:42 +0100 Message-Id: <20200118023742.22120-1-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Organization: Invisible Things Lab X-MC-Unique: 0f3z9EewMEWg379bPNAbzw-1 X-MC-Unique: MxvoXJZZOTWWjzG18NCStQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00I2bsf2014973 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The libxl driver already tries to call shutdown inhibit callback in the right places, but only if it's set. That last part was missing, resulting in premature shutdown when running libvirtd --timeout=3D... Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jim Fehlig --- src/libxl/libxl_driver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index bece313ec5..d45e42c100 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -648,8 +648,8 @@ libxlAddDom0(libxlDriverPrivatePtr driver) =20 static int libxlStateInitialize(bool privileged, - virStateInhibitCallback callback G_GNUC_UNUSED, - void *opaque G_GNUC_UNUSED) + virStateInhibitCallback callback, + void *opaque) { libxlDriverConfigPtr cfg; char *driverConf =3D NULL; @@ -670,6 +670,9 @@ libxlStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_ERROR; } =20 + libxl_driver->inhibitCallback =3D callback; + libxl_driver->inhibitOpaque =3D opaque; + /* Allocate bitmap for vnc port reservation */ if (!(libxl_driver->reservedGraphicsPorts =3D virPortAllocatorRangeNew(_("VNC"), --=20 2.21.0