[PATCH 09/10] virDomainDriverAutoShutdownDoSave: Don't attempt to save transient VMs

Peter Krempa via Devel posted 10 patches 5 months, 1 week ago
[PATCH 09/10] virDomainDriverAutoShutdownDoSave: Don't attempt to save transient VMs
Posted by Peter Krempa via Devel 5 months, 1 week ago
From: Peter Krempa <pkrempa@redhat.com>

Commit 84bb136c31e added code that intended to skip the save of
transient domains but did so only in the setup part where we pause the
VMS. The second loop that actually attempts to save the VM was not
modified so we'd still try saving them:

 Jul 03 14:15:13 andariel virtqemud[247210]: auto-shutdown: unable to perform managed save of 'cd3': Requested operation is not valid: cannot do managed save for transient domain

Fixes: 84bb136c31e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/hypervisor/domain_driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c
index cce6c64d1b..d8ccee40d5 100644
--- a/src/hypervisor/domain_driver.c
+++ b/src/hypervisor/domain_driver.c
@@ -779,6 +779,10 @@ virDomainDriverAutoShutdownDoSave(virDomainPtr *domains,
     }

     for (i = 0; i < numDomains; i++) {
+        if ((transient[i] && cfg->trySave == VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOPE_PERSISTENT) ||
+            (!transient[i] && cfg->trySave == VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOPE_TRANSIENT))
+            continue;
+
         virSystemdNotifyStatus("Saving '%s' (%zu of %zu)",
                                virDomainGetName(domains[i]), i + 1, numDomains);
         VIR_INFO("Saving '%s'", virDomainGetName(domains[i]));
-- 
2.49.0
Re: [PATCH 09/10] virDomainDriverAutoShutdownDoSave: Don't attempt to save transient VMs
Posted by Pavel Hrdina via Devel 5 months, 1 week ago
On Thu, Jul 03, 2025 at 02:50:32PM +0200, Peter Krempa via Devel wrote:
> From: Peter Krempa <pkrempa@redhat.com>
> 
> Commit 84bb136c31e added code that intended to skip the save of
> transient domains but did so only in the setup part where we pause the
> VMS. The second loop that actually attempts to save the VM was not
> modified so we'd still try saving them:
> 
>  Jul 03 14:15:13 andariel virtqemud[247210]: auto-shutdown: unable to perform managed save of 'cd3': Requested operation is not valid: cannot do managed save for transient domain
> 
> Fixes: 84bb136c31e
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/hypervisor/domain_driver.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>