From nobody Fri May 3 01:53:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1643077045312243.5815174827659; Mon, 24 Jan 2022 18:17:25 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-403-u4hRESdaMtqGIwY-vVLECA-1; Mon, 24 Jan 2022 21:17:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CEE01898293; Tue, 25 Jan 2022 02:17:15 +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 E941660BD8; Tue, 25 Jan 2022 02:17:13 +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 E17481809CB8; Tue, 25 Jan 2022 02:17:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20P2H9LX007121 for ; Mon, 24 Jan 2022 21:17:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2102E40CFD21; Tue, 25 Jan 2022 02:17:09 +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 1C22A40CFD05 for ; Tue, 25 Jan 2022 02:17:09 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0233A185A7B4 for ; Tue, 25 Jan 2022 02:17:09 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-PG72_FuyPCWFG-bZfBmuXA-1; Mon, 24 Jan 2022 21:17:07 -0500 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03lp2050.outbound.protection.outlook.com [104.47.9.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-12-17eeq0_iO7aJfprPxAxq8g-1; Tue, 25 Jan 2022 03:17:03 +0100 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) by DB3PR0402MB3708.eurprd04.prod.outlook.com (2603:10a6:8:d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17; Tue, 25 Jan 2022 02:17:01 +0000 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::9d7c:24e:fb2d:2b34]) by AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::9d7c:24e:fb2d:2b34%5]) with mapi id 15.20.4909.019; Tue, 25 Jan 2022 02:17:01 +0000 X-MC-Unique: u4hRESdaMtqGIwY-vVLECA-1 X-MC-Unique: PG72_FuyPCWFG-bZfBmuXA-1 X-MC-Unique: 17eeq0_iO7aJfprPxAxq8g-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] libxl: Add lock process indicator to saved VM state Date: Mon, 24 Jan 2022 19:16:57 -0700 Message-ID: <20220125021657.21768-1-jfehlig@suse.com> X-ClientProxiedBy: AS9PR05CA0050.eurprd05.prod.outlook.com (2603:10a6:20b:489::24) To AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad84b9d4-bd5d-483e-7ba9-08d9dfa8c55e X-MS-TrafficTypeDiagnostic: DB3PR0402MB3708:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:758 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: ymLlAg1dD70Rx2nRLWN1JBPODVGHORbLFIW503OJoI+kuDnFmxPDGZrwyhVY1VUMV9n9EWHmG7/m/mMJXODHBXNXGuRIAeNlz/n1Vms4uyguAT12ITKN8mPsxXNhoA2MrcmvVxXx1i5xvdgYxox6OOlhkz9+z0g++RpNQSS06DjpLzMJ+YdKFLsNmdY1U/SrSU20LrkBqqZx4AK6LF1zuIWAZw838POt7p2HCGzEaqOQkXWsyNiTosZCOT/lmoL29mxE5swfjnN3aMeQHyMAYreoGGFJGF6cH2BBi5y/LE3hgP5g7fDEcFC0h44DEiIyr6jScM5EfQaOrMxLkGj6lr4ugYZsLbuWe9Mr0+aNtXYqG1ukhL+kWh31MuU28LEES4csDWJV1CMjrEaroYfuIZm4NQOuilghMDLC83p7KeAiunFraHYJnamhpVaXLSNnuCdgVtSlXE325EUWQ/RJ5ljhlqN3Gcxza7oprFLAyFJBvfTzw/0Jn0xu68oMKU7DX0eiXcUbL1QXgZsFBE2zowxv+jlIe6BeFwWdpxuUznk4ab95CYT7GxLLHrfxkeqJ0OIArPi/0UjiUzr56uQoruPBledGwIdJMfEWauVYfCP/iARy7Z5Y/ZglHORqnItf/I+msxhzLGrQ867K+aT63Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4899.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(8936002)(6916009)(8676002)(66476007)(66556008)(66946007)(5660300002)(38100700002)(6486002)(1076003)(86362001)(316002)(2616005)(26005)(186003)(6666004)(2906002)(508600001)(6506007)(6512007)(83380400001)(36756003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BlnM8zpPFfiQpccSS3b4BLU1MV0y/NpGBIVbuqJHA+e3Z0qsRdyAFW5e8BXp?= =?us-ascii?Q?TtrGkKAgOqQdjMtH3Op1pI98SK5fIrijv5JQTKKLqHLZNAPJSvMg09Fd5PE5?= =?us-ascii?Q?CsqP686LjIJDGKplSndV2D44sPdRJjJqayMMeQsUljfvdIryZzrHWVtVFmla?= =?us-ascii?Q?80WLpPup/AjEHuglSuuKiI5eFlEALJA76sCIXMiQ87AC6L6DA+8cJx2IaLZo?= =?us-ascii?Q?kJgSG6kHFQKiDa8/B8odeaTpc4zidMjOjYsAtHSC3vZ0deQSd4h1a5TD3jyz?= =?us-ascii?Q?fztbwDXoOi1epVAwtzNYxKbrnnGz+Eo6mTE2L545BRtzJfCCfwIyX2EQwd4l?= =?us-ascii?Q?+JIcIijPSxedSDonq8y01JDQIqRari6V2of+oLD/XYs3yn6rPnc4cOF2eODc?= =?us-ascii?Q?a9CDxAGnUja2Z4c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ascii?Q?jL7PIIE+EP2UQuYjJaKPlcybjgyycfOKQhc3Ixlel8y4oKnB34Zq5H72Bqko?= =?us-ascii?Q?eD0tefieTIUpx0ONFcaAMPqca8s6Nf1LQ4fS/2tp/aBmothJY1d5bM2GrAI2?= =?us-ascii?Q?48lV1NlwNnbPmTBeEzAuje5ao1dNOrnPmxFWsgJigxMlc+Cv9f/O7oq9PYyj?= =?us-ascii?Q?pMC5ue2EHntivAUA73k81b4zzkYLZOFDCwVNa0tTcqyKJZjXrXxK5G7kexQ0?= =?us-ascii?Q?rRskvbg/hTxyKJcfp5VUc+5opgM7WOqYzlN/M6hDX8IMMlIR+zh/dxCQJt+3?= =?us-ascii?Q?NaFDrfA15jj1FbNVbA2RGlY=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad84b9d4-bd5d-483e-7ba9-08d9dfa8c55e X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4899.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 02:17:00.9689 (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: Rd+TRruEGT4i0TMQ1Z5sF2HSmhSArESrI1RPqpWyffllG40CdsfrAFnA/Mtpi8QyX4bRM1XMfM6Rb/ksKKEPsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3708 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.84 on 10.11.54.1 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 20P2H9LX007121 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.11 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 X-ZM-MESSAGEID: 1643077048496100001 Content-Type: text/plain; charset="utf-8" Commit fa58f571ee added a lock processes indicator to the libxlDomainObjPrivate struct to note that a lock process was successfully started for the VM. However, the commit neglected to add the indicator to the VM's saved state file. As a result, the indicator is lost on libvirtd restart, along with the knowledge of whether a lock process was started for the VM. This change adds support for the indicator in the domainObjPrivate data parse and format callbacks, ensuring its value survives libvirtd restarts. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/libxl_domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index feca60f7d2..8962adc60f 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -226,6 +226,7 @@ libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, libxlDomainObjPrivate *priv =3D vm->privateData; =20 priv->lockState =3D virXPathString("string(./lockstate)", ctxt); + priv->lockProcessRunning =3D virXPathBoolean("count(./lockProcessRunni= ng) > 0", ctxt); =20 return 0; } @@ -239,6 +240,9 @@ libxlDomainObjPrivateXMLFormat(virBuffer *buf, if (priv->lockState) virBufferAsprintf(buf, "%s\n", priv->lockSt= ate); =20 + if (priv->lockProcessRunning) + virBufferAddLit(buf, "\n"); + return 0; } =20 --=20 2.34.1