ShaoHe Feng has posted comments on this change.

Change subject: dump the core of a VM
......................................................................


Patch Set 6: (12 inline comments)

....................................................
File vdsm/API.py
Line 276:                       'reset': False,
Line 277:                       'memory-only': False}
Line 278:         for k, v in params.items():
Line 279:             try:
Line 280:                 if k not in dumpParams or v not in [False, True]:
done.
Line 281:                     raise ValueError("Core dump: Invalid argument: 
%s=%s" %
Line 282:                                      (k, v))
Line 283:             except ValueError, e:
Line 284:                 return reportError(msg=e.message)


Line 283:             except ValueError, e:
Line 284:                 return reportError(msg=e.message)
Line 285: 
Line 286:         dumpParams.update(params)
Line 287:         if dumpParams["crash"] is True and dumpParams["live"] is True:
good idea.
Line 288:             return reportError(msg='crash and live are mutually 
exclusive')
Line 289:         if dumpParams["crash"] is True and dumpParams["reset"] is 
True:
Line 290:             return reportError(msg='crash and reset are mutually 
exclusive')
Line 291:         if dumpParams["reset"] is True and dumpParams["live"] is True:


....................................................
File vdsm/libvirtvm.py
Line 522:     def _startUnderlyingDump(self):
Line 523:         try:
Line 524:             self._vm._dom.coreDump(self.dumpfile, self.dumpflag)
Line 525:         except libvirt.libvirtError:
Line 526:             raise
done. remove the try.
Line 527: 
Line 528:     def stop(self):
Line 529:         try:
Line 530:             self._vm._dom.abortJob()


Line 528:     def stop(self):
Line 529:         try:
Line 530:             self._vm._dom.abortJob()
Line 531:         except libvirt.libvirtError:
Line 532:             raise
done. remove the try.
Line 533: 
Line 534: 
Line 535: class TimeoutError(libvirt.libvirtError):
Line 536:     pass


....................................................
File vdsm/vm.py
Line 314:         dataProgress = (100 - 100 * dataRemaining / dataTotal
Line 315:                         if dataTotal else 0)
Line 316:         self.log.info('dump status: job type: %d, dump Progress: '
Line 317:                       'dataRemaining = %d, dataTotal=%d, %s%% 
processed'
Line 318:                       % (jobType, dataRemaining, dataTotal, 
dataProgress))
done
Line 319:         if self.isAlive():
Line 320:             return self.status
Line 321:         else:
Line 322:             status = self.status


Line 331:                   "memory-only": libvirt.VIR_DUMP_MEMORY_ONLY}
Line 332:         self.dumpflag = 0
Line 333:         for k, v in self.dumpParams.items():
Line 334:             if v is True:
Line 335:                 self.dumpflag += params[k]
done
Line 336:         if self.dumpParams.get('memory-only') is True:
Line 337:             self._mode = "memory"
Line 338:         else:
Line 339:             self._mode = "core"


Line 344:         else:
Line 345:             error = {'status':
Line 346:                      {'code': errCode[key]['status']['code'],
Line 347:                       'message': msg}}
Line 348:         self.log.error("Failed to do dump. " + msg, exc_info=True)
done
Line 349: 
Line 350:         return error
Line 351: 
Line 352:     def _status(self, msg=''):


Line 353:         return {'status': {'code': 0, 'message': msg}}
Line 354: 
Line 355:     def run(self):
Line 356:         try:
Line 357:             self.log.debug("begine to do coredump")
done
Line 358:             if self._vm._dom is None:
Line 359:                 self.status = self._error(key='noVM')
Line 360:                 raise RuntimeError('do core dump error')
Line 361:             self._setupDumpParams()


Line 356:         try:
Line 357:             self.log.debug("begine to do coredump")
Line 358:             if self._vm._dom is None:
Line 359:                 self.status = self._error(key='noVM')
Line 360:                 raise RuntimeError('do core dump error')
done
Line 361:             self._setupDumpParams()
Line 362:             self.status = self._status(msg="ongoing")
Line 363:             self._startUnderlyingDump()
Line 364:             self.status = self._status(msg="finished")


Line 1275:         self._acquireCpuLockWithTimeout()
Line 1276:         try:
Line 1277:             if self.isDoingDump():
Line 1278:                 self.log.warning('vm is doing coredump, '
Line 1279:                                  'conflict with migrating')
done
Line 1280:                 return errCode['exist']
Line 1281:             if self.isMigrating():
Line 1282:                 self.log.warning('vm already migrating')
Line 1283:                 return errCode['exist']


Line 1328:             if self.isDoingDump():
Line 1329:                 self.log.warning('vm already coredump')
Line 1330:                 return errCode['exist']
Line 1331:             if self.isMigrating():
Line 1332:                 self.log.warning('vm is do migrating, conflict with 
coredump')
done
Line 1333:                 return errCode['exist']
Line 1334: 
Line 1335:             # even if the vm status is "Down", we still need to do 
core dump
Line 1336:             # we do not care "Down"


Line 1340:             check = self._doCoredumpThread.getStat()
Line 1341:             return check
Line 1342:         except Exception:
Line 1343:             check = self._doCoredumpThread.getStat()
Line 1344:             return check
add a log
Line 1345:         finally:


--
To view, visit http://gerrit.ovirt.org/7329
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If4aac9e747dc7aa64a6ff5ef256a7a4375aa2bb5
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Ryan Harper <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to