mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 04:36:48 +00:00
fix(instances): clones roll back their copies; own error messages stay
Clone: - only shut-off VMs are cloned, as the UI already required: a running guest keeps writing while its disks are copied; the definition comes from the persistent XML; - MAC addresses and disk destinations are checked before anything is allocated; - every volume the clone creates (NVRAM and disks) is tracked; if a later copy or the definition fails, only those are deleted, and any that cannot be deleted are named in the error. Before, a failed clone left its earlier copies behind. libvirtError(msg) reports the thread's last libvirt error instead of msg when there is one, so WebVirtCloud's own errors could show an earlier, unrelated failure. util.OperationError, a libvirtError subclass that keeps its message, replaces those raises in vrtManager, instances and nwfilters; 'except libvirtError' still catches it.
This commit is contained in:
parent
e5fda79f5a
commit
57cf49262a
8 changed files with 282 additions and 139 deletions
|
|
@ -9,6 +9,19 @@ import lxml.etree as etree
|
|||
from django.conf import settings
|
||||
|
||||
|
||||
|
||||
class OperationError(libvirt.libvirtError):
|
||||
"""An error with WebVirtCloud's own message.
|
||||
|
||||
libvirtError(msg) reports the thread's last libvirt error instead of msg
|
||||
when there is one, so an earlier, unrelated failure would be shown.
|
||||
"""
|
||||
|
||||
def __init__(self, msg):
|
||||
Exception.__init__(self, msg)
|
||||
self.err = None
|
||||
|
||||
|
||||
def is_kvm_available(xml):
|
||||
kvm_domains = get_xml_path(xml, "//domain/@type='kvm'")
|
||||
return kvm_domains > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue