mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 12:16:49 +00:00
feat(instances): the VM lists follow changes by themselves
A VM list showed what it read when it was loaded: a VM stopped from inside its guest or with virsh, or made or removed elsewhere, showed only after a reload, unlike the VM page, which reloads when its VM's state changes. The lists of all VMs and of one host's VMs now poll the states of their VMs, at once and then every 5 s as the VM page does, and reload when an answer differs from the one before. The states come from one libvirt call per host; a user who does not see hosts gets only their own VMs. The page in use (a dialog, a field, an unsaved XML edit, a job outcome shown) holds the reload until it is free; that check is shared with the job panel.
This commit is contained in:
parent
f88deb22c1
commit
eb6e6ca626
15 changed files with 276 additions and 11 deletions
|
|
@ -1011,6 +1011,11 @@ class wvmConnect(object):
|
|||
instances.append(name)
|
||||
return instances
|
||||
|
||||
def get_domain_states(self):
|
||||
"""{uuid: [name, state]} of every domain, in one call."""
|
||||
return {dom.UUIDString(): [dom.name(), stats["state.state"]]
|
||||
for dom, stats in self.wvm.getAllDomainStats(libvirt.VIR_DOMAIN_STATS_STATE)}
|
||||
|
||||
def domain_trees(self, running_only=False):
|
||||
"""Each domain's name with its definitions, parsed: the live one, and
|
||||
for a persistent domain the one saved for its next boot too, read
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue