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:
emellor@leeni.uk.xensource.com committed 2005-10-13 17:49:56 +01:00
1 parent 633d294bb5
commit 7e6a2a3288
2 files changed
+2 -31

No files matched your search

+2 -9
View File
@@ -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()
-22
View File
@@ -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):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.