Dan Kenigsberg has posted comments on this change.
Change subject: virt: graphdev: add the GraphicsDevice class
......................................................................
Patch Set 27: Code-Review-1
(4 comments)
http://gerrit.ovirt.org/#/c/26895/27//COMMIT_MSG
Commit Message:
Line 24:
Line 25: Noteworthy side effects of this patch:
Line 26: * It is now possible to create a VM without any display
Line 27: (aka headless VM), and they are supported.
Line 28: * The input 'display' parameter of the Vm.create API is
I'm all for headless VMs, but what was the motivation of introducing this side effect
in this refactoring patch?
Line 29: no longer mandatory
Line 30: * In the API schema, the display* parameters are now
Line 31: marked as optional, even though Engine is expected to still
Line 32: send them in the near/medium term.
Line 29: no longer mandatory
Line 30: * In the API schema, the display* parameters are now
Line 31: marked as optional, even though Engine is expected to still
Line 32: send them in the near/medium term.
Line 33: * setTicket and the internally used _reviveTicket can now
it's fine for setTicket, as it is called from outside. But _reviveTicket must never be
called if there is no ticket to revive.
Line 34: fail if they are invoked against a VM without graphic devices.
Line 35:
Line 36: Change-Id: I82e4414aa3efe7c756ba8ef9b7b47e591613a717
http://gerrit.ovirt.org/#/c/26895/27/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 4281: def setTicket(self, otp, seconds, connAct, params):
Line 4282: try:
Line 4283: graphics = _domParseStr(self._dom.XMLDesc(0)).childNodes[0]. \
Line 4284: getElementsByTagName('graphics')[0]
Line 4285: except IndexError:
Why do you add support for optional "display" in this patch? I thought it
intended to be refactoring-only, with no functional effect.
Line 4286: return {
Line 4287: 'status': {'code':
errCode['ticketErr']['status']['code'],
Line 4288: 'message': 'no graphics devices
configured'}}
Line 4289: graphics.setAttribute('passwd', otp)
Line 4309: try:
Line 4310: graphics = _domParseStr(
Line 4311: self._dom.XMLDesc(libvirt.VIR_DOMAIN_XML_SECURE)). \
Line 4312: childNodes[0].getElementsByTagName('graphics')[0]
Line 4313: except IndexError:
Why is this needed? It seems that this function is called only if self._vm.hasSpice.
Swallowing an error like this is a sure way to hide bugs.
Line 4314: self.log.error('no graphics devices configured')
Line 4315: return
Line 4316: validto =
max(time.strptime(graphics.getAttribute('passwdValidTo'),
Line 4317: '%Y-%m-%dT%H:%M:%S'),
--
To view, visit
http://gerrit.ovirt.org/26895
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82e4414aa3efe7c756ba8ef9b7b47e591613a717
Gerrit-PatchSet: 27
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkobzik(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes