From 6ce56629f41cbc4063af6b012226af48f5e21ab7 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Thu, 30 Jul 2026 03:25:54 +0000 Subject: [PATCH] =?UTF-8?q?[FIX]=20script=20todo:=20redimension=20?= =?UTF-8?q?=E2=80=94=20r=C3=A9soudre=20le=20nom=20de=20VM=20AVANT=20extinc?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Après un shrink, « Démarrer la VM » faisait « virsh start » : une fois la VM éteinte, l'ID numérique disparaît -> « failed to get domain 32 ». On résout désormais le NOM canonique dès le début de _qemu_resize_disk (VM encore allumée, ID résoluble) et on l'utilise partout, y compris pour le redémarrage final. Plus de dépendance à l'ID une fois la VM arrêtée. Co-Authored-By: Claude Opus 4.8 (1M context) --- script/todo/todo.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/todo/todo.py b/script/todo/todo.py index 6d03ee4..ea3d4bd 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -1569,6 +1569,10 @@ class TODO: if not self._qemu_domain_exists(name): print(f"{name}: {t('VM not found.')}") return + # Résout tout de suite le NOM canonique (VM encore allumée -> l'ID est + # résoluble). Après extinction, un ID numérique disparaît : « virsh + # start 32 » échouerait. On travaille désormais avec le nom. + name = self._qemu_domname(name) disk = self._qemu_main_disk(name) if not disk: print(t("Main disk not found for this VM.")) @@ -1680,8 +1684,9 @@ class TODO: if self._is_yes( input(t("Start the VM now? (y/N): ")) ): - real = self._qemu_domname(name) - cmd = f"sudo virsh start {shlex.quote(real)}" + # `name` est déjà le nom canonique (résolu au début) : un + # « virsh start » échouerait car l'ID a disparu. + cmd = f"sudo virsh start {shlex.quote(name)}" print(f"{t('Will execute:')} {cmd}") self.execute.exec_command_live(cmd, source_erplibre=False)