Dan Kenigsberg has posted comments on this change. Change subject: clientIF: automatically unpause vms in EIO when SD becomes active ......................................................................
Patch Set 7: I would prefer that you didn't submit this (8 inline comments) .................................................... File vdsm/clientIF.py Line 74: self.log = log Line 75: self._recovery = True Line 76: self.channelListener = Listener(self.log) Line 77: self._generationID = str(uuid.uuid4()) Line 78: self.domainVmIds = {} better define as _private. it would be nicer if this dictionary contained the vmObjs directly, instead of their IDs, saving one or two lookups. But a more fundamental question: why should we bother to maintain the domain->vms mapping, while a vm->domains already exists? Line 79: self.domainVmIdsLock = threading.Lock() Line 80: self._initIRS() Line 81: self.irs.registerDomainStateChangeCallback(self.contEIOVms) Line 82: self.mom = None Line 77: self._generationID = str(uuid.uuid4()) Line 78: self.domainVmIds = {} Line 79: self.domainVmIdsLock = threading.Lock() Line 80: self._initIRS() Line 81: self.irs.registerDomainStateChangeCallback(self.contEIOVms) this has to be tucked inside _initIRS(), since we have an evil try-except block there, making it possible for self.irs == None here. Line 82: self.mom = None Line 83: if _glusterEnabled: Line 84: self.gluster = gapi.GlusterApi(self, log) Line 85: else: Line 141: if not isDomainStateValid: Line 142: return Line 143: Line 144: libvirtCon = libvirtconnection.get() Line 145: libvirtVms = libvirtCon.listAllDomains( why should we re-collect this information from libvirt? Vdsm should already have full information about all Vms, their state, and the reason for their being paused. Line 146: libvirt.VIR_CONNECT_LIST_DOMAINS_PAUSED) Line 147: Line 148: if sdUUID in self.domainVmIds: Line 149: with self.vmContainerLock: Line 406: Line 407: return {'status': 0, 'alignment': aligning} Line 408: Line 409: def createVm(self, vmParams): Line 410: with self.vmContainerLock: valid cleanup, but unrelated to patch. Line 411: self.log.info("vmContainerLock acquired by vm %s", Line 412: vmParams['vmId']) Line 413: try: Line 414: if 'recover' not in vmParams: .................................................... File vdsm/storage/hsm.py Line 399: storageRefreshThread.daemon = True Line 400: storageRefreshThread.start() Line 401: Line 402: @public Line 403: def registerDomainStateChangeCallback(self, callbackFunc): Doesn't this expose Vdsm to attack from its client, which could call the new verb directly, passing specially-concocted callbackFunc pointers? We trust our clients already, but making this @public over xmlrpc (albeit undocumented) is not pretty. A better client/server API would be to block until a domain state change (or timeout) occurs. P.s. a real "register" verb should have an accompanying "unregister" one. Line 404: """ Line 405: Currently this method assumes that all registrations Line 406: are done *prior* to connecting to pool. Line 407: """ Line 1052: res = pool.connect(hostID, scsiKey, msdUUID, masterVersion) Line 1053: if res: Line 1054: self.pools[spUUID] = pool Line 1055: for callback in self.domainStateChangeCallbacks: Line 1056: self.pools[spUUID].domainMonitor.\ nit: better use "pool" directly, instead of looking it up time and again in self.pools. Line 1057: onDomainStateChange.register(callback) Line 1058: return res Line 1059: Line 1060: @public Line 1053: if res: Line 1054: self.pools[spUUID] = pool Line 1055: for callback in self.domainStateChangeCallbacks: Line 1056: self.pools[spUUID].domainMonitor.\ Line 1057: onDomainStateChange.register(callback) this may block for quite some time on libvirt's operations (listAllDomains, cont). Can we do it after releasing the pool resource? With this, a single hung-up qemu process can jam the storage system as a whole. Line 1058: return res Line 1059: Line 1060: @public Line 1061: def disconnectStoragePool(self, spUUID, hostID, scsiKey, remove=False, .................................................... File vdsm/vm.py Line 2072: def isDisksStatsCollectionEnabled(self): Line 2073: return self._volumesPrepared Line 2074: Line 2075: def preparePaths(self, drives): Line 2076: domains = set() in vm.py, "domain" usually means libvirt.virDomain. I think that being explicit and calling this "storagedoms" would keep confusion checked. Line 2077: for drive in drives: Line 2078: with self._volPrepareLock: Line 2079: if self.destroyed: Line 2080: # A destroy request has been issued, exit early -- To view, visit http://gerrit.ovirt.org/16244 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f88ebcab07dea20a0288f6b75c5888a74d9e440 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yeela Kaplan <ykap...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Eduardo <ewars...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Yeela Kaplan <ykap...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches