From nobody Sun Apr 28 12:43:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1604456706; cv=none; d=zohomail.com; s=zohoarc; b=NhX1vqzMIQpifOKhWD5LzYGj20QCbXm1klUiRuytt+DfqsRvUEXj9thWXIxaWmuYy6voTaYjKP8DI6MudDKWShfkwaRPL59i8NJTn/1DfqfcPKqEZhdrlKLVacFwjIQ6D8u4LgDmOFC9zr4Ek27yrRhy32n3TGVbsZohgN4edVU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604456706; 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=hEWD1Mos8OarrUTG8TJAi7qPCxN4dHsTLEkU4sEq8Zw=; b=Y+2hGqTI7PKCSdMpxYx0f4LpIhoKchpRd9VjHBkZ+dM138UmyfmQpaqECyE2Q7Bwmmisyfj/Xgiz53mYHQmXs7z10REM5rDTMIv46FGHavxW4EPQLw3ZpKEoYKpZju1r4OPyFE/iT1Qo6c5WbCriNBbgxmGUxG735nov6tvys0M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1604456706354316.14093664919494; Tue, 3 Nov 2020 18:25:06 -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-93-ngjwJiTTPwWbb29Jlmi4RA-1; Tue, 03 Nov 2020 21:25:02 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FB8D1007468; Wed, 4 Nov 2020 02:24:54 +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 5B85375129; Wed, 4 Nov 2020 02:24:52 +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 AB481180C5A2; Wed, 4 Nov 2020 02:24:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A42Ojrj017102 for ; Tue, 3 Nov 2020 21:24:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0AD2AAB413; Wed, 4 Nov 2020 02:24:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 040B9A9E66 for ; Wed, 4 Nov 2020 02:24:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 E988E185A78B for ; Wed, 4 Nov 2020 02:24:42 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-m83AvKbDNpebEIOVxE03jQ-1; Tue, 03 Nov 2020 21:24:40 -0500 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02lp2053.outbound.protection.outlook.com [104.47.4.53]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-39-DQLZkTqkNlO-3cf0E8vOPA-1; Wed, 04 Nov 2020 03:24:37 +0100 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) by VI1PR04MB5375.eurprd04.prod.outlook.com (2603:10a6:803:ca::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Wed, 4 Nov 2020 02:24:34 +0000 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::d59f:cecf:64b9:c0b]) by VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::d59f:cecf:64b9:c0b%11]) with mapi id 15.20.3499.032; Wed, 4 Nov 2020 02:24:34 +0000 Received: from linux-tbji.devlab.prv.suse.com (75.169.16.1) by AM4PR0101CA0052.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 4 Nov 2020 02:24:33 +0000 X-MC-Unique: ngjwJiTTPwWbb29Jlmi4RA-1 X-MC-Unique: m83AvKbDNpebEIOVxE03jQ-1 X-MC-Unique: DQLZkTqkNlO-3cf0E8vOPA-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] remote: Add libvirtd dependency to virt-guest-shutdown.target Date: Tue, 3 Nov 2020 19:24:18 -0700 Message-ID: <20201104022418.19072-1-jfehlig@suse.com> X-Originating-IP: [75.169.16.1] X-ClientProxiedBy: AM4PR0101CA0052.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::20) To VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4fe00c12-0a9b-40b8-3a76-08d88068c4fe X-MS-TrafficTypeDiagnostic: VI1PR04MB5375: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: i6NvBokOZRjSVei9y/AnJRS0C7tt99I1M7cBB3aYswQ5tflAZ59NVkWwhW4Yn4Z00XBATUgAwmGcqLVG/hmLWj66mrRvTM0txE3kd9G1p22FOmE0WcyPHYf/Ops4jPnAvnN4pUNjUhCsrej1N826Q6M7cNG1x3vKOay1IFTI455X/BMSSDlz0Rx98uqedClMPWqqbiTxoKEUyZ8E2AACVBOZf5/Pt8pTbxufqpmknbAevCsJQV9jvuOFtiaFTCDcUEjbzc2Tz38MBLGHBASd4Pi9RihDltBVAW5I2gmD2XAaE8rLSfwjFtoiiQa8MBG+kFPvwJSfb7p2lquYOXhwoeHuG/Z1dNGWJlaIWYf86KaRdRoFN/xGacoTp2sdSXbM8nhE3UFVURSdLdgTGYEM3w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0401MB2429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(83380400001)(2616005)(956004)(6666004)(186003)(16526019)(36756003)(66476007)(66946007)(66556008)(26005)(6486002)(8936002)(966005)(6916009)(498600001)(7696005)(1076003)(4326008)(107886003)(2906002)(8676002)(5660300002)(52116002)(86362001); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: RBFMiSD3wI5XOuabFXOiFtJ3x4B6EguDV+ejawcD9PGF5Th/v5+K9L1YsxPboWVi6Dln3lhuwnOQcEVaa70dSASTi1apR0ZSVk4jXk6xKlxJDAg/oXQ/9RDnpTZnzXMWR4585HbhPNO27hGDQ5nUql2lqY9TEfiEUgqLCQ7pZXqT1kTkhGoB1vZpNgTRL7SXy2LVQJMAtutEUrHOpn5rBooFa8Vxldxb+SeFFwhIaHFuMZBxhulQER2hItLmoIrgY9Z+n0k1NpoJAXeKW2kHXtfYdpHFzhGPBduQtKcsJlHHnRZiarvfGWF7AVJYkSkR2E6T/VHPZbAUTAJ+E5houBukVsaDSZnQhrXGzgCoILPOSt0ItB0QHxJEQzIHLZPD5ZSFjxBWLj4iVZA4kLIwPQ2GGXzThWGLGddcuD2tHe5YWQTHu3k4VoZiLKaIkY8vi5pYNRUq9Yegzn6wBegKBtDQlcPrbrxwAog+Tvp7HB4yiOjIa9uvQeeR9NfeAf5gKcsi3Vda3D/DRlv99Oc0QlVSKW4c4/evnEG+FaFdLtL76q8f4XYo3ZG6aCh5ZC4KtYQFjBW0fJtfdTDoDUvhpEGyKsidKgIzWvXtWmoogFaNHjrKhd6a1VWHbH/TtplIWqId7DCebsQv6lob4IUMLA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fe00c12-0a9b-40b8-3a76-08d88068c4fe X-MS-Exchange-CrossTenant-AuthSource: VI1PR0401MB2429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2020 02:24:34.6633 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B4mCqEJDRx+vEtm5vkuFBrtABGOJVc7Wq5SGCsbN40kTjko7fJAwCc0ynM8lAGl536Ry1oaSqPmiYOVZtXeOtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5375 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0A42Ojrj017102 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.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When restarting libvirt services and sockets *and* libvirt-guests.service is running, the latter will sometimes hang when trying to connect to libvirtd. Even though libvirt-guests has 'Wants=3Dlibvirtd.service' and 'After=3Dlibvirtd.service', we can see via journalctl that it is not shutdown before libvirtd when executing something like systemctl try-restart libvirtd.service libvirtd.socket \ libvirtd-ro.socket virtlockd.service virtlockd.socket \ virtlogd.service virtlogd.socket virt-guest-shutdown.target Oct 28 15:53:31 systemd[1]: Stopping Virtualization daemon... Oct 28 15:53:31 systemd[1]: libvirtd.service: Succeeded. Oct 28 15:53:31 systemd[1]: Stopped Virtualization daemon. Oct 28 15:53:31 systemd[1]: libvirtd-admin.socket: Succeeded. Oct 28 15:53:31 systemd[1]: Closed Libvirt admin socket. Oct 28 15:53:31 systemd[1]: Stopping Libvirt admin socket. Oct 28 15:53:31 systemd[1]: libvirtd-ro.socket: Succeeded. Oct 28 15:53:31 systemd[1]: Closed Libvirt local read-only socket. Oct 28 15:53:31 systemd[1]: Stopping Libvirt local read-only socket. Oct 28 15:53:31 systemd[1]: libvirtd.socket: Succeeded. Oct 28 15:53:31 systemd[1]: Closed Libvirt local socket. Oct 28 15:53:31 systemd[1]: Stopping Libvirt local socket. Oct 28 15:53:31 systemd[1]: Listening on Libvirt local socket. Oct 28 15:53:31 systemd[1]: Listening on Libvirt admin socket. Oct 28 15:53:31 systemd[1]: Listening on Libvirt local read-only socket. Oct 28 15:53:31 systemd[1]: virtlockd.socket: Succeeded. Oct 28 15:53:31 systemd[1]: Closed Virtual machine lock manager socket. Oct 28 15:53:31 systemd[1]: Stopping Virtual machine lock manager socket. Oct 28 15:53:31 systemd[1]: Listening on Virtual machine lock manager socke= t. Oct 28 15:53:31 systemd[1]: virtlogd.socket: Succeeded. Oct 28 15:53:31 systemd[1]: Closed Virtual machine log manager socket. Oct 28 15:53:31 systemd[1]: Stopping Virtual machine log manager socket. Oct 28 15:53:31 systemd[1]: Listening on Virtual machine log manager socket. Oct 28 15:53:31 systemd[1]: Stopping Suspend/Resume Running libvirt Guests.= .. In this case, the try-restart command hung and libvirt-guests was stuck trying to connect to libvirtd. In the following case, the try-restart worked since libvirtd was started again before libvirt-guests was stopped! Oct 28 15:19:02 systemd[1]: Stopping Virtualization daemon... Oct 28 15:19:02 systemd[1]: Stopped Virtualization daemon. Oct 28 15:19:02 systemd[1]: Closed Libvirt admin socket. Oct 28 15:19:02 systemd[1]: Stopping Libvirt admin socket. Oct 28 15:19:02 systemd[1]: Closed Virtual machine lock manager socket. Oct 28 15:19:02 systemd[1]: Stopping Virtual machine lock manager socket. Oct 28 15:19:02 systemd[1]: Listening on Virtual machine lock manager sock= et. Oct 28 15:19:02 systemd[1]: Closed Libvirt local read-only socket. Oct 28 15:19:02 systemd[1]: Stopping Libvirt local read-only socket. Oct 28 15:19:02 systemd[1]: Closed Libvirt local socket. Oct 28 15:19:02 systemd[1]: Stopping Libvirt local socket. Oct 28 15:19:02 systemd[1]: Listening on Libvirt local socket. Oct 28 15:19:02 systemd[1]: Listening on Libvirt admin socket. Oct 28 15:19:02 systemd[1]: Listening on Libvirt local read-only socket. Oct 28 15:19:02 systemd[1]: Closed Virtual machine log manager socket. Oct 28 15:19:02 systemd[1]: Stopping Virtual machine log manager socket. Oct 28 15:19:02 systemd[1]: Listening on Virtual machine log manager socke= t. Oct 28 15:19:02 systemd[1]: Starting Virtualization daemon... Oct 28 15:19:02 systemd[1]: Stopping Suspend/Resume Running libvirt Guests= ... Oct 28 15:19:02 systemd[1]: Started Virtualization daemon. Oct 28 15:19:02 libvirt-guests.sh[4912]: Running guests on default URI: no= running guests. Oct 28 15:19:02 systemd[1]: Stopped Suspend/Resume Running libvirt Guests. Oct 28 15:19:02 systemd[1]: Stopped target Libvirt guests shutdown. Oct 28 15:19:02 systemd[1]: Stopping Libvirt guests shutdown. Oct 28 15:19:02 systemd[1]: Reached target Libvirt guests shutdown. Oct 28 15:19:02 systemd[1]: Starting Suspend/Resume Running libvirt Guests= ... Oct 28 15:19:02 systemd[1]: Started Suspend/Resume Running libvirt Guests. Adding 'Requires=3Dlibvirtd.service' to virt-guest-shutdown.target results in expected behavior Oct 28 15:40:00 systemd[1]: Stopping Suspend/Resume Running libvirt Guests= ... Oct 28 15:40:00 libvirt-guests.sh[5245]: Running guests on default URI: no= running guests. Oct 28 15:40:00 systemd[1]: Stopped Suspend/Resume Running libvirt Guests. Oct 28 15:40:00 systemd[1]: Stopped target Libvirt guests shutdown. Oct 28 15:40:00 systemd[1]: Stopping Libvirt guests shutdown. Oct 28 15:40:00 systemd[1]: Stopping Virtualization daemon... Oct 28 15:40:00 systemd[1]: Stopped Virtualization daemon. Oct 28 15:40:00 systemd[1]: Closed Virtual machine log manager socket. Oct 28 15:40:00 systemd[1]: Stopping Virtual machine log manager socket. Oct 28 15:40:00 systemd[1]: Listening on Virtual machine log manager socke= t. Oct 28 15:40:00 systemd[1]: Closed Libvirt admin socket. Oct 28 15:40:00 systemd[1]: Stopping Libvirt admin socket. Oct 28 15:40:00 systemd[1]: Closed Libvirt local read-only socket. Oct 28 15:40:00 systemd[1]: Stopping Libvirt local read-only socket. Oct 28 15:40:00 systemd[1]: Closed Libvirt local socket. Oct 28 15:40:00 systemd[1]: Stopping Libvirt local socket. Oct 28 15:40:00 systemd[1]: Listening on Libvirt local socket. Oct 28 15:40:00 systemd[1]: Listening on Libvirt admin socket. Oct 28 15:40:00 systemd[1]: Listening on Libvirt local read-only socket. Oct 28 15:40:00 systemd[1]: Closed Virtual machine lock manager socket. Oct 28 15:40:00 systemd[1]: Stopping Virtual machine lock manager socket. Oct 28 15:40:00 systemd[1]: Listening on Virtual machine lock manager sock= et. Oct 28 15:40:00 systemd[1]: Starting Virtualization daemon... Oct 28 15:40:00 systemd[1]: Started Virtualization daemon. Oct 28 15:40:00 systemd[1]: Reached target Libvirt guests shutdown. Oct 28 15:40:00 systemd[1]: Starting Suspend/Resume Running libvirt Guests= ... Oct 28 15:40:00 systemd[1]: Started Suspend/Resume Running libvirt Guests. Signed-off-by: Jim Fehlig Reviewed-by: Neal Gompa --- I asked about this on the dev list but it is probably best to send a patch for discussion instead. https://www.redhat.com/archives/libvir-list/2020-October/msg01492.html src/remote/virt-guest-shutdown.target | 1 + 1 file changed, 1 insertion(+) diff --git a/src/remote/virt-guest-shutdown.target b/src/remote/virt-guest-= shutdown.target index 25d4aaa267..e2efa3e63a 100644 --- a/src/remote/virt-guest-shutdown.target +++ b/src/remote/virt-guest-shutdown.target @@ -1,3 +1,4 @@ [Unit] Description=3DLibvirt guests shutdown +Requires=3Dlibvirtd.service Documentation=3Dhttps://libvirt.org --=20 2.28.0