Commit 30a54d0
NAS backup: resume paused VM on backup failure and fix missing exit
When a NAS backup job fails (e.g. due to backup storage being full or
I/O errors), the VM may remain indefinitely paused because:
1. The cleanup() function never checks or resumes the VM's paused state
that was set by virsh backup-begin during the push backup operation.
2. The 'Failed' case in the backup job monitoring loop calls cleanup()
but lacks an 'exit' statement, causing an infinite loop where the
script repeatedly detects the failed job and calls cleanup().
3. Similarly, backup_stopped_vm() calls cleanup() on qemu-img convert
failure but does not exit, allowing the loop to continue with
subsequent disks despite the failure.
This fix:
- Adds VM state detection and resume to cleanup(), ensuring the VM is
always resumed if found in a paused state during error handling
- Adds missing 'exit 1' after cleanup() in the Failed backup job case
to prevent the infinite monitoring loop
- Adds missing 'exit 1' after cleanup() in backup_stopped_vm() on
qemu-img convert failure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 93239e0 commit 30a54d0
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| 182 | + | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
225 | 240 | | |
226 | 241 | | |
227 | 242 | | |
| |||
0 commit comments