Univention Bugzilla – Attachment 5681 Details for
Bug 33166
noVNC connections not immediately possible after starting a VM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Immediately write noVNC token on domain state change
33166_uvmm-novnc-event.diff (text/plain), 2.62 KB, created by
Philipp Hahn
on 2013-11-28 14:13:47 CET
(
hide
)
Description:
Immediately write noVNC token on domain state change
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2013-11-28 14:13:47 CET
Size:
2.62 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/ucs-3.2-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py b/branches/ucs-3.2/ucs-3.2-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py >index 7f6abc1..a1ce39b 100644 >--- a/branches/ucs-3.2/ucs-3.2-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py >+++ b/branches/ucs-3.2/ucs-3.2-0/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/node.py >@@ -688,6 +688,7 @@ class Node(PersistentCached): > try: > domStat = self.domains[uuid] > domStat.update( dom ) >+ self.write_novnc_tokens() > except KeyError: > # during migration events are not ordered causal > pass >@@ -735,7 +736,6 @@ class Node(PersistentCached): > for name in self.conn.listDefinedDomains(): > yield self.conn.lookupByName(name) > >- novnc_mapping = {} > for dom in all_domains(): > uuid = dom.UUIDString() > if uuid in self.domains: >@@ -753,7 +753,6 @@ class Node(PersistentCached): > curMem += domStat.pd.curMem > maxMem += domStat.pd.maxMem > cpu_usage += domStat._cpu_usage >- self.get_novnc_mapping(domStat, novnc_mapping) > for uuid in cached_domains: > # Remove obsolete domains > del self.domains[uuid] >@@ -769,24 +768,25 @@ class Node(PersistentCached): > self._cache_id = cache_id > except IOError, ex: > logger.exception("Failed to write cached node %s: %s" % (self.pd.uri, ex)) >- self.write_novnc_tokens(novnc_mapping) >+ self.write_novnc_tokens() > >- def get_novnc_mapping(self, domStat, mapping): >- try: >- gfx = domStat.pd.graphics[0] >- except (AttributeError, IndexError), ex: >- pass >- else: >- if gfx.type == Graphic.TYPE_VNC and gfx.listen == '0.0.0.0' and gfx.port > 0: >- mapping[domStat.pd.uuid] = (self.pd.name, gfx.port) >- >- def write_novnc_tokens(self, mapping): >+ def write_novnc_tokens(self): > path = os.path.join(self.cache_dir, 'novnc.tokens', uri_encode(self.pd.uri)) > logger.debug("Writing noVNC tokens to '%s'", path) > tmp_path = path + '.new' > with open(tmp_path, 'w') as token_file: >- for uuid, (host, port) in mapping.iteritems(): >- print >> token_file, '%s: %s:%d' % (uuid, host, port) >+ for uuid, domStat in self.domains.iteritems(): >+ try: >+ gfx = domStat.pd.graphics[0] >+ except (AttributeError, IndexError): >+ continue >+ if gfx.type != Graphic.TYPE_VNC: >+ continue >+ if gfx.listen != '0.0.0.0': >+ continue >+ if gfx.port <= 0: >+ continue >+ print >> token_file, '%s: %s:%d' % (uuid, self.pd.name, gfx.port) > os.rename(tmp_path, path) > > def wait_update(self, domain, state_key, timeout=10):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33166
: 5681