From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9A4B11FF0B2 for ; Tue, 08 Sep 2026 16:22:24 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C175821482; Tue, 08 Sep 2026 16:22:20 +0200 (CEST) Message-ID: <6e21c5b8-7010-478d-b4d5-333b85b129a5@proxmox.com> Date: Tue, 8 Sep 2026 16:22:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu v2 9/9] savevm-async: restore run state from before snapshot To: Erik Fastermann , pve-devel@lists.proxmox.com References: <20260907094744.131193-1-e.fastermann@proxmox.com> <20260907094744.131193-10-e.fastermann@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260907094744.131193-10-e.fastermann@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788877321243 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.703 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MUVFU6FEHFIVOQBSW7NQVCC627TFSQVW X-Message-ID-Hash: MUVFU6FEHFIVOQBSW7NQVCC627TFSQVW X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 07.09.26 um 11:49 AM schrieb Erik Fastermann: > @@ -230,6 +231,24 @@ index 0000000000..56c60b345f > + return snap_state.state == SAVE_STATE_COMPLETED && snap_state.skip_vm_start; > +} > + > ++static void restore_vm_old_state(void) > ++{ > ++ RunState old_state = snap_state.vm_old_state; > ++ > ++ if (old_state == RUN_STATE__MAX) { > ++ return; > ++ } > ++ snap_state.vm_old_state = RUN_STATE__MAX; > ++ > ++ if (runstate_is_live(old_state)) { > ++ if (!should_skip_vm_start() && !runstate_check(RUN_STATE_SHUTDOWN)) { > ++ vm_start(); > ++ } > ++ } else if (runstate_check(RUN_STATE_FINISH_MIGRATE)) { I'd prefer this condition to be dropped or extended to also check for RUN_STATE_SAVE_VM. Because when not using a statefile, we call vm_stop(RUN_STATE_SAVE_VM) and do not set the state to RUN_STATE_FINISH_MIGRATE. It might be fine in practice, because if the runstate was not live, then RUN_STATE_SAVE_VM is not actually applied, as vm_stop() skips setting the state if already not live. But still, it would be good to be explicit about it. > ++ runstate_set(old_state); > ++ } > ++} > ++