From nobody Fri Dec 19 08:04:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1742913402; cv=none; d=zohomail.com; s=zohoarc; b=GsAw2ctmZSZgH3FLDrYv/1hkmrB/a2cL1zP5oXLBvIyaFru4xDiRglQSqA4aP67ciralcJVML05WLOvhkY9YkBvQS5bvS4ovBr6aPXLhzUSYXGOENO4mgePF1CifefCf9zCBkQ2g0KSuH9ObGeUkHH36SazmsMTlDfPdaa5hi+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742913402; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=ZHmUsgk2tSprygk7dcb8epRHRhHVBrsZqDgheUqA0io=; b=BH4QQ3WbwVm6T1qMvhWTeSBMq4iZD9pd+y81GVSf3pileo2AT6WSGOb6R8p+yPWADrgFMwJKGj/aK00lx8hdqp8AEDnsehjremS/tAoXXEUW4rZusYNx7RPezoH9/iF77xd9RZ0L05Gj5P5JAaadwW5ENNwtredRjbdoMYvd63c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 174291340288615.341882276289198; Tue, 25 Mar 2025 07:36:42 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 42F431557; Tue, 25 Mar 2025 10:36:42 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id F09601589; Tue, 25 Mar 2025 10:35:41 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9CFE4163F; Tue, 25 Mar 2025 10:35:37 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5127F163F for ; Tue, 25 Mar 2025 10:35:28 -0400 (EDT) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-_BLewN6cPxq6qd2nM_hwlQ-1; Tue, 25 Mar 2025 10:35:26 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9177818DB8E1 for ; Tue, 25 Mar 2025 14:35:25 +0000 (UTC) Received: from kshcheti-thinkpadp1gen4i.tpbc.com (unknown [10.43.2.246]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A46F0180176A; Tue, 25 Mar 2025 14:35:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742913327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u99nYJy7Wr6TWeelmaCe7viQKySzkq91SAuqDYUcQhY=; b=amBUNO/7MtMUYOCYZJKS+qMaaHpACq5+scLU2LyOAbSuPbvGU7duYLIpXwF4JWocJeLMiY Sg3yXPpKC3KBGoxXjvEvoe5POi1Fj3A9ONKgQJ2Vy6ZJNgCXMadntktD34xZ3ulYahdhHb LVktVaElzpRVp0/DtACYiY8FjE2+lsI= X-MC-Unique: _BLewN6cPxq6qd2nM_hwlQ-1 X-Mimecast-MFC-AGG-ID: _BLewN6cPxq6qd2nM_hwlQ_1742913325 To: devel@lists.libvirt.org Subject: [PATCH 2/3] ch: virCHProcessEvent() update domain info after reboot Date: Tue, 25 Mar 2025 15:11:58 +0100 Message-ID: <20250325143501.728342-3-kshcheti@redhat.com> In-Reply-To: <20250325143501.728342-1-kshcheti@redhat.com> References: <20250325143501.728342-1-kshcheti@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6wUzo3onew_qAKdjdQ5SL8NQPDm2FZSU40y6WV6mLfE_1742913325 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 23SZ3JHM5Y5CHKBD2DUML5QK6UOV7YTE X-Message-ID-Hash: 23SZ3JHM5Y5CHKBD2DUML5QK6UOV7YTE X-MailFrom: kshcheti@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Kirill Shchetiniuk X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Kirill Shchetiniuk via Devel Reply-To: Kirill Shchetiniuk X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742913404033019000 Content-Type: text/plain; charset="utf-8"; x-default="true" When the domain was rebooted, some of its properties were changed but not updated in the transient domain definition. This led to the inability to connect to the serial console as its path had changed during the reboot but was not updated in the domain definition. Added VIR_CH_EVENT_VM_REBOOTED event handling to update the information in transient domain definition after domain's reboot is completed to maintain it in consistent state. Signed-off-by: Kirill Shchetiniuk --- src/ch/ch_events.c | 6 +++++- src/ch/ch_process.c | 2 +- src/ch/ch_process.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ch/ch_events.c b/src/ch/ch_events.c index 2dd3e7ecc2..32846ba4e5 100644 --- a/src/ch/ch_events.c +++ b/src/ch/ch_events.c @@ -97,7 +97,6 @@ virCHProcessEvent(virCHMonitor *mon, case VIR_CH_EVENT_VM_BOOTING: case VIR_CH_EVENT_VM_BOOTED: case VIR_CH_EVENT_VM_REBOOTING: - case VIR_CH_EVENT_VM_REBOOTED: case VIR_CH_EVENT_VM_PAUSING: case VIR_CH_EVENT_VM_PAUSED: case VIR_CH_EVENT_VM_RESUMING: @@ -120,6 +119,11 @@ virCHProcessEvent(virCHMonitor *mon, virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_SH= UTDOWN); virObjectUnlock(vm); break; + case VIR_CH_EVENT_VM_REBOOTED: + virObjectLock(vm); + virCHProcessUpdateInfo(vm); + virObjectUnlock(vm); + break; case VIR_CH_EVENT_LAST: default: VIR_WARN("%s: Unknown event: %s", vm->def->name, full_event); diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 0954de6180..31aa49b3a5 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -131,7 +131,7 @@ virCHProcessUpdateConsole(virDomainObj *vm, virCHProcessUpdateConsoleDevice(vm, config, "serial"); } =20 -static int +int virCHProcessUpdateInfo(virDomainObj *vm) { g_autoptr(virJSONValue) info =3D NULL; diff --git a/src/ch/ch_process.h b/src/ch/ch_process.h index 38bfce3b7f..7a6995b7cf 100644 --- a/src/ch/ch_process.h +++ b/src/ch/ch_process.h @@ -36,3 +36,5 @@ int virCHProcessSetupVcpu(virDomainObj *vm, int virCHProcessStartRestore(virCHDriver *driver, virDomainObj *vm, const char *from); + +int virCHProcessUpdateInfo(virDomainObj *vm); --=20 2.48.1