mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Remove the diagnostic/recovery when two domains end up with the same name. It
was working around bugs that have gone, and is now more dangerous than useful -- deadlock is a possibility with this code now. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
633d294bb5
commit
7e6a2a3288
2 files changed
+2
-31
No files matched your search
@@ -313,18 +313,11 @@ class XendDomain:
|
||||
def domain_lookup_by_name_nr(self, name):
|
||||
self.domains_lock.acquire()
|
||||
try:
|
||||
matching = filter(
|
||||
lambda d: d.getName() == name and not d.isShutdown(),
|
||||
self.domains.values())
|
||||
matching = filter(lambda d: d.getName() == name,
|
||||
self.domains.values())
|
||||
n = len(matching)
|
||||
if n == 1:
|
||||
return matching[0]
|
||||
elif n > 1:
|
||||
log.error('Name uniqueness has been violated for name %s! '
|
||||
'Recovering by renaming:', name)
|
||||
for d in matching:
|
||||
d.renameUniquely()
|
||||
|
||||
return None
|
||||
finally:
|
||||
self.domains_lock.release()
|
||||
|
||||
@@ -840,14 +840,6 @@ class XendDomainInfo:
|
||||
self.state_updated.release()
|
||||
|
||||
|
||||
def isShutdown(self):
|
||||
self.state_updated.acquire()
|
||||
try:
|
||||
return self.state == STATE_DOM_SHUTDOWN
|
||||
finally:
|
||||
self.state_updated.release()
|
||||
|
||||
|
||||
def __str__(self):
|
||||
s = "<domain"
|
||||
s += " id=" + str(self.domid)
|
||||
@@ -1292,20 +1284,6 @@ class XendDomainInfo:
|
||||
self.state_set(STATE_DOM_SHUTDOWN)
|
||||
|
||||
|
||||
## public:
|
||||
|
||||
def renameUniquely(self):
|
||||
"""Rename this domain so that it has a unique name. This is used by
|
||||
XendDomain to recover from non-uniqueness errors; we should never have
|
||||
allowed the system to reach this state in the first place."""
|
||||
new_name = self.generateUniqueName()
|
||||
|
||||
log.error('Renaming %s (%d, %s) to %s', self.info['name'], self.domid,
|
||||
self.uuid, new_name)
|
||||
|
||||
self.setName(new_name)
|
||||
|
||||
|
||||
# private:
|
||||
|
||||
def generateUniqueName(self):
|
||||
|
||||