Skip to content

Commit

Permalink
LXC: don't set undefine flags (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyYakeley committed Jan 13, 2025
1 parent 3e66d99 commit 9063243
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tool/nixvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,17 @@ def _descriptionXML(self,lvobj):
return lvobj.XMLDesc(flags=2)
def _undefine(self,lvobj):
# https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefineFlagsValues
# VIR_DOMAIN_UNDEFINE_MANAGED_SAVE
# VIR_DOMAIN_UNDEFINE_KEEP_NVRAM
# VIR_DOMAIN_UNDEFINE_KEEP_TPM
lvobj.undefineFlags(flags=73)
match self.session.driver:
case "QEMU":
# VIR_DOMAIN_UNDEFINE_MANAGED_SAVE
# VIR_DOMAIN_UNDEFINE_KEEP_NVRAM
# VIR_DOMAIN_UNDEFINE_KEEP_TPM
flags=73
case "LXC":
flags=0 # LXC doesn't support undefine flags
case _:
flags=73 # best guess, same as QEMU
lvobj.undefineFlags(flags=flags)
def _fixDefinitionETree(self,objid,specDefETree):
interfaces = specDefETree.xpath("/domain/devices/interface")
index = 0
Expand Down

0 comments on commit 9063243

Please sign in to comment.