remove unused netid code

it's unused and has a netid property with name different than key
that would cause issues in the next commit
This commit is contained in:
qubesuser 2017-11-11 02:36:17 +01:00
parent b297ecbcf1
commit f2b8ad7d38
5 changed files with 1 additions and 23 deletions

View File

@ -536,14 +536,6 @@ class VMCollection(object):
raise LookupError("Cannot find unused qid!")
def get_new_unused_netid(self):
used_ids = set([vm.netid for vm in self]) # if vm.is_netvm()])
for i in range(1, qubes.config.max_netid):
if i not in used_ids:
return i
raise LookupError("Cannot find unused netid!")
def get_new_unused_dispid(self):
for _ in range(int(qubes.config.max_dispid ** 0.5)):
dispid = random.SystemRandom().randrange(qubes.config.max_dispid)

View File

@ -100,7 +100,6 @@ defaults = {
}
max_qid = 254
max_netid = 254
max_dispid = 10000
#: built-in standard labels, if creating new one, allocate them above this
# number, at least until label index is removed from API

View File

@ -257,12 +257,6 @@ class TC_30_VMCollection(qubes.tests.QubesTestCase):
self.vms.get_new_unused_qid()
def test_101_get_new_unused_netid(self):
self.vms.add(self.testvm1)
self.vms.add(self.testvm2)
self.vms.get_new_unused_netid()
# def test_200_get_vms_based_on(self):
# pass

View File

@ -323,7 +323,6 @@ class TC_20_PropertyHolder(qubes.tests.QubesTestCase):
class TestVM(qubes.vm.BaseVM):
qid = qubes.property('qid', type=int)
name = qubes.property('name')
netid = qid
uuid = uuid.uuid5(uuid.NAMESPACE_DNS, 'testvm')
def __lt__(self, other):
@ -452,12 +451,6 @@ class TC_30_VMCollection(qubes.tests.QubesTestCase):
self.vms.get_new_unused_qid()
def test_101_get_new_unused_netid(self):
self.vms.add(self.testvm1)
self.vms.add(self.testvm2)
self.vms.get_new_unused_netid()
# def test_200_get_vms_based_on(self):
# pass

View File

@ -189,7 +189,7 @@ class AdminVM(qubes.vm.BaseVM):
# def __init__(self, **kwargs):
# super(QubesAdminVm, self).__init__(qid=0, name="dom0", netid=0,
# super(QubesAdminVm, self).__init__(qid=0, name="dom0",
# dir_path=None,
# private_img = None,
# template = None,