1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(instances): a UEFI clone gets its own NVRAM without a new pool

Cloning a UEFI VM defined a persistent storage pool on the NVRAM's
directory when no pool held it, and dropped <nvram> from the clone,
which found its copy only because libvirt chose the same file name.
The copy is now made through the NVRAM directory's pool (a transient one
when there is none) or the pool that holds the file, with the original's
format, owner and mode, and the clone's definition names it. A failed
definition removes it with the copied disks. An NVRAM that is not a file
is refused before anything is copied.
This commit is contained in:
catborise 2026-10-09 17:48:58 +03:00
parent 11fe2409f9
commit 0ea5f0ff18
5 changed files with 144 additions and 23 deletions

View file

@ -906,7 +906,9 @@ class wvmConnect(object):
try:
yield pool
finally:
pool.destroy()
# a transient pool left by a failed destroy goes with libvirtd's next restart
with contextlib.suppress(libvirtError):
pool.destroy()
@staticmethod
def _find_volume(pool, name):