def isCurrentStorageAction(self, domainid):
domain = self._get_domain(domainid)
if not domain:
return False
# at this moment we suppose the machine is following the default naming
# of disks
if domain.state()[0] not in [libvirt.VIR_DOMAIN_SHUTDOWN,
libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED]:
status = domain.blockJobInfo('vda', 0)
if 'cur' in status:
return True
# check also that there is no qemu-img job running
if self.isLocked(domainid):
return True
return False
评论列表
文章目录