domain: Don't throw error when stopping a transient domain

This commit is contained in:
Cole Robinson 2011-03-08 10:56:13 -05:00
parent b11eeffae3
commit 18335a0b43
1 changed files with 9 additions and 1 deletions

View File

@ -1270,8 +1270,16 @@ class vmmDomain(vmmDomainBase):
self.vcpu_max_count()
def _update_status(self, status=None):
if status == None:
try:
info = self.get_info()
except libvirt.libvirtError, e:
if (hasattr(libvirt, "VIR_ERR_NO_DOMAIN") and
e.get_error_code() == getattr(libvirt, "VIR_ERR_NO_DOMAIN")):
# Possibly a transient domain that was removed on shutdown
return
raise
if status == None:
status = info[0]
status = self._normalize_status(status)