)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"a7bb3778085e1adffbad8b2cf49f8807fc0d89c8","unresolved":false,"context_lines":[{"line_number":13,"context_line":"then select one which is not taken."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If7c3b14dd49ed05c5fde819c5a36d5608650cbbc"},{"line_number":16,"context_line":"Closes-Bug: #1255609"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2BPl4%3D","line":16,"updated":"2013-11-28 12:07:14.000000000","message":"This bug number does not appear to exist in launchpad","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"bb66bcf124ef83f6a352df4859f7a7880b8402fa","unresolved":false,"context_lines":[{"line_number":13,"context_line":"then select one which is not taken."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If7c3b14dd49ed05c5fde819c5a36d5608650cbbc"},{"line_number":16,"context_line":"Closes-Bug: #1255609"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2BPhU%3D","line":16,"in_reply_to":"AAAATn%2F%2BPl4%3D","updated":"2013-11-28 12:23:56.000000000","message":"This is security bug which was private but I made it public as the security team advised so.","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"263c4d8ef7a62ba945f38c526469fc1726c04372","unresolved":false,"context_lines":[{"line_number":9,"context_line":"There is small chance for VNC port collisions with the current"},{"line_number":10,"context_line":"implementation which choose the port number based on the MoRef id"},{"line_number":11,"context_line":"of the VM."},{"line_number":12,"context_line":"This patch fix this by running a query for all allocated ports and"},{"line_number":13,"context_line":"then select one which is not taken."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If7c3b14dd49ed05c5fde819c5a36d5608650cbbc"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2BPVE%3D","line":12,"updated":"2013-11-28 13:30:27.000000000","message":"fix  \u003d\u003e fixes","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"7c563558b08272cf4a4e8b062a94f2d5f9c995e8","unresolved":false,"context_lines":[{"line_number":9,"context_line":"There is small chance for VNC port collisions with the current"},{"line_number":10,"context_line":"implementation which choose the port number based on the MoRef id"},{"line_number":11,"context_line":"of the VM."},{"line_number":12,"context_line":"This patch fix this by running a query for all allocated ports and"},{"line_number":13,"context_line":"then select one which is not taken."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If7c3b14dd49ed05c5fde819c5a36d5608650cbbc"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2BObg%3D","line":12,"in_reply_to":"AAAATn%2F%2BPVE%3D","updated":"2013-11-28 17:08:00.000000000","message":"Done","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"263c4d8ef7a62ba945f38c526469fc1726c04372","unresolved":false,"context_lines":[{"line_number":10,"context_line":"implementation which choose the port number based on the MoRef id"},{"line_number":11,"context_line":"of the VM."},{"line_number":12,"context_line":"This patch fix this by running a query for all allocated ports and"},{"line_number":13,"context_line":"then select one which is not taken."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If7c3b14dd49ed05c5fde819c5a36d5608650cbbc"},{"line_number":16,"context_line":"Closes-Bug: #1255609"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2BPU8%3D","line":13,"updated":"2013-11-28 13:30:27.000000000","message":"select \u003d\u003e selects","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"7c563558b08272cf4a4e8b062a94f2d5f9c995e8","unresolved":false,"context_lines":[{"line_number":10,"context_line":"implementation which choose the port number based on the MoRef id"},{"line_number":11,"context_line":"of the VM."},{"line_number":12,"context_line":"This patch fix this by running a query for all allocated ports and"},{"line_number":13,"context_line":"then select one which is not taken."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: If7c3b14dd49ed05c5fde819c5a36d5608650cbbc"},{"line_number":16,"context_line":"Closes-Bug: #1255609"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2BObc%3D","line":13,"in_reply_to":"AAAATn%2F%2BPU8%3D","updated":"2013-11-28 17:08:00.000000000","message":"Done","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"}],"nova/tests/virt/vmwareapi/test_vmwareapi.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5f46a15bc2215dd106d8c35a4236646b76302c6a","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import copy"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import collections"},{"line_number":27,"context_line":"import mock"},{"line_number":28,"context_line":"import mox"},{"line_number":29,"context_line":"from oslo.config import cfg"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2Fm0g%3D","line":26,"updated":"2014-01-10 15:02:21.000000000","message":"the import collections should be in the section above","commit_id":"c8260e5adf0f96e290d684a50c98fda9f608059c"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"336f1aa956c43475e4b2574a18a0fb8968ed080b","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import copy"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import collections"},{"line_number":27,"context_line":"import mock"},{"line_number":28,"context_line":"import mox"},{"line_number":29,"context_line":"from oslo.config import cfg"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2Fmx8%3D","line":26,"in_reply_to":"AAAAUH%2F%2Fm0g%3D","updated":"2014-01-10 15:10:36.000000000","message":"Done","commit_id":"c8260e5adf0f96e290d684a50c98fda9f608059c"}],"nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        self.assertEqual(vm_util._LAST_VNC_PORT, 5910)"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"        vm_util._LAST_VNC_PORT \u003d None"},{"line_number":350,"context_line":"        self.assertRaises(exception.ConsolePortRangeExhausted,"},{"line_number":351,"context_line":"                          vm_util.get_vnc_port,"},{"line_number":352,"context_line":"                          fake_session(fake_objects),"},{"line_number":353,"context_line":"                          5900, 10)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2Fnuc%3D","line":350,"updated":"2014-01-10 12:07:18.000000000","message":"nit: that should be two unit tests, one call to get_vnc_port, in my view.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        self.assertEqual(vm_util._LAST_VNC_PORT, 5910)"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"        vm_util._LAST_VNC_PORT \u003d None"},{"line_number":350,"context_line":"        self.assertRaises(exception.ConsolePortRangeExhausted,"},{"line_number":351,"context_line":"                          vm_util.get_vnc_port,"},{"line_number":352,"context_line":"                          fake_session(fake_objects),"},{"line_number":353,"context_line":"                          5900, 10)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnJQ%3D","line":350,"in_reply_to":"AAAAUH%2F%2Fnuc%3D","updated":"2014-01-10 14:14:32.000000000","message":"Done","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"20e0101862415b83ecd8977183bcbeb824376328","unresolved":false,"context_lines":[{"line_number":593,"context_line":"def get_vnc_port(session, min_port\u003d5900, max_port\u003d65535):"},{"line_number":594,"context_line":"    \"\"\"Return VNC port for an VM or None if there is no available port.\"\"\""},{"line_number":595,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":596,"context_line":"    for port in range(min_port, max_port):"},{"line_number":597,"context_line":"        if port not in allocated_ports:"},{"line_number":598,"context_line":"            return port"},{"line_number":599,"context_line":"    raise exception.ConsoleTypeUnavailable(console_type\u003d\u0027vnc\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BODc%3D","line":596,"updated":"2013-11-28 19:33:49.000000000","message":"can you consider storing the last allocated port and then starting the loop from that port. that will save a lot of cycles. that is instead of start from 0 each time and getting to the masx port, you start from x and then go back to x -1, where x is the last allocated port.","commit_id":"3ea9fe09112c80cf686ded0502ebe7c660a72596"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"5ad99f9e974491e326de9f76b8cf02d181bcfb3f","unresolved":false,"context_lines":[{"line_number":593,"context_line":"def get_vnc_port(session, min_port\u003d5900, max_port\u003d65535):"},{"line_number":594,"context_line":"    \"\"\"Return VNC port for an VM or None if there is no available port.\"\"\""},{"line_number":595,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":596,"context_line":"    for port in range(min_port, max_port):"},{"line_number":597,"context_line":"        if port not in allocated_ports:"},{"line_number":598,"context_line":"            return port"},{"line_number":599,"context_line":"    raise exception.ConsoleTypeUnavailable(console_type\u003d\u0027vnc\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BGoo%3D","line":596,"in_reply_to":"AAAATn%2F%2BODc%3D","updated":"2013-12-02 15:22:22.000000000","message":"Done","commit_id":"3ea9fe09112c80cf686ded0502ebe7c660a72596"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"2f13b000fb6c054adb23604254a89d48e59de1f2","unresolved":false,"context_lines":[{"line_number":596,"context_line":"    for port in range(min_port, max_port):"},{"line_number":597,"context_line":"        if port not in allocated_ports:"},{"line_number":598,"context_line":"            return port"},{"line_number":599,"context_line":"    raise exception.ConsoleTypeUnavailable(console_type\u003d\u0027vnc\u0027)"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"def _get_allocated_vnc_ports(session):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BOYM%3D","line":599,"updated":"2013-11-28 17:23:31.000000000","message":"ConsoleTypeUnavailable is used when a client user requests information on the console connection.\n\nYou should invent a new exception for this scenario I think. eg ConsolePortRangeExhausted(min_port, max_port)","commit_id":"3ea9fe09112c80cf686ded0502ebe7c660a72596"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"5ad99f9e974491e326de9f76b8cf02d181bcfb3f","unresolved":false,"context_lines":[{"line_number":596,"context_line":"    for port in range(min_port, max_port):"},{"line_number":597,"context_line":"        if port not in allocated_ports:"},{"line_number":598,"context_line":"            return port"},{"line_number":599,"context_line":"    raise exception.ConsoleTypeUnavailable(console_type\u003d\u0027vnc\u0027)"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"def _get_allocated_vnc_ports(session):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BGok%3D","line":599,"in_reply_to":"AAAATn%2F%2BOYM%3D","updated":"2013-12-02 15:22:22.000000000","message":"Done","commit_id":"3ea9fe09112c80cf686ded0502ebe7c660a72596"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"2f13b000fb6c054adb23604254a89d48e59de1f2","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                                          token)"},{"line_number":619,"context_line":"        else:"},{"line_number":620,"context_line":"            break"},{"line_number":621,"context_line":"    return vnc_ports"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"def search_datastore_spec(client_factory, file_name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BOYc%3D","line":621,"updated":"2013-11-28 17:23:31.000000000","message":"As noted in my previous review, this logic is all seriously flawed due to it mistakenly enforcing VNC port uniqueness globally. I think this should be addressed now, but if that\u0027s not possible, then file a bug about this and add a clear TODO comment item refering to the bug.","commit_id":"3ea9fe09112c80cf686ded0502ebe7c660a72596"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"5ad99f9e974491e326de9f76b8cf02d181bcfb3f","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                                          token)"},{"line_number":619,"context_line":"        else:"},{"line_number":620,"context_line":"            break"},{"line_number":621,"context_line":"    return vnc_ports"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"def search_datastore_spec(client_factory, file_name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BGoM%3D","line":621,"in_reply_to":"AAAATn%2F%2BOYc%3D","updated":"2013-12-02 15:22:22.000000000","message":"I have filed bug #1256944","commit_id":"3ea9fe09112c80cf686ded0502ebe7c660a72596"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2f46ba1c0f389cbe225859475d048bde7f3a4d1b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# the last allocated VNC port"},{"line_number":36,"context_line":"_last_vnc_port \u003d None"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def build_datastore_path(datastore_name, path):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BGlE%3D","line":36,"updated":"2013-12-02 15:40:43.000000000","message":"i think that it is common practive to have global variables as upper csae","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e37d1a694976a356fd17bc51050a2a8c1ad550ef","unresolved":false,"context_lines":[{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# the last allocated VNC port"},{"line_number":36,"context_line":"_last_vnc_port \u003d None"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def build_datastore_path(datastore_name, path):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BBfM%3D","line":36,"in_reply_to":"AAAATn%2F%2BB4Y%3D","updated":"2013-12-03 10:59:31.000000000","message":"Done","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"cde0c9f1ba40c1ca5c310f22a99849cd23985f87","unresolved":false,"context_lines":[{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# the last allocated VNC port"},{"line_number":36,"context_line":"_last_vnc_port \u003d None"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def build_datastore_path(datastore_name, path):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BB4Y%3D","line":36,"in_reply_to":"AAAATn%2F%2BGYE%3D","updated":"2013-12-03 09:37:25.000000000","message":"please see https://github.com/openstack/nova/blob/master/nova/openstack/common/db/sqlalchemy/session.py#L358 for an example","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"62099b12aaa2fc4fc01d9866c1edfbfb2fbade9d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# the last allocated VNC port"},{"line_number":36,"context_line":"_last_vnc_port \u003d None"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def build_datastore_path(datastore_name, path):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BGYE%3D","line":36,"in_reply_to":"AAAATn%2F%2BGlE%3D","updated":"2013-12-02 15:48:14.000000000","message":"isn\u0027t this only for constants?","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2f46ba1c0f389cbe225859475d048bde7f3a4d1b","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        if _last_vnc_port not in allocated_ports:"},{"line_number":608,"context_line":"            return _last_vnc_port"},{"line_number":609,"context_line":"    raise exception.ConsolePortRangeExhausted(min_port\u003dmin_port,"},{"line_number":610,"context_line":"                                              max_port\u003dmax_port)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"def _get_allocated_vnc_ports(session):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BGlg%3D","line":610,"updated":"2013-12-02 15:40:43.000000000","message":"indentation here is a little odd","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"df51dccd2e0378838fad877112417923e320816c","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        if _last_vnc_port not in allocated_ports:"},{"line_number":608,"context_line":"            return _last_vnc_port"},{"line_number":609,"context_line":"    raise exception.ConsolePortRangeExhausted(min_port\u003dmin_port,"},{"line_number":610,"context_line":"                                              max_port\u003dmax_port)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"def _get_allocated_vnc_ports(session):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BB3k%3D","line":610,"in_reply_to":"AAAATn%2F%2BGXk%3D","updated":"2013-12-03 09:40:19.000000000","message":"the indentation is ok. it is just the way tha jenkins displayed it. when looking at your code it looks correct.","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"62099b12aaa2fc4fc01d9866c1edfbfb2fbade9d","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        if _last_vnc_port not in allocated_ports:"},{"line_number":608,"context_line":"            return _last_vnc_port"},{"line_number":609,"context_line":"    raise exception.ConsolePortRangeExhausted(min_port\u003dmin_port,"},{"line_number":610,"context_line":"                                              max_port\u003dmax_port)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"def _get_allocated_vnc_ports(session):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BGXk%3D","line":610,"in_reply_to":"AAAATn%2F%2BGlg%3D","updated":"2013-12-02 15:48:14.000000000","message":"I thought that vertical alignment of arguments is acceptable;\nif not, what is the preferred way to format long lines?","commit_id":"2112175119c9e50bc82bcfc646eaf0cf97730fb0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":592,"context_line":"    return virtual_machine_config_spec"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"@utils.synchronized(\u0027get_vnc_port\u0027)"},{"line_number":596,"context_line":"def get_vnc_port(session, min_port\u003d5900, port_total\u003d10000):"},{"line_number":597,"context_line":"    \"\"\"Return VNC port for an VM or None if there is no available port.\"\"\""},{"line_number":598,"context_line":"    global _LAST_VNC_PORT"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnyE%3D","line":595,"updated":"2014-01-10 12:07:18.000000000","message":"I think this name is global to nova, so better to include vmware in here. I could be wrong.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":592,"context_line":"    return virtual_machine_config_spec"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"@utils.synchronized(\u0027get_vnc_port\u0027)"},{"line_number":596,"context_line":"def get_vnc_port(session, min_port\u003d5900, port_total\u003d10000):"},{"line_number":597,"context_line":"    \"\"\"Return VNC port for an VM or None if there is no available port.\"\"\""},{"line_number":598,"context_line":"    global _LAST_VNC_PORT"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnJI%3D","line":595,"in_reply_to":"AAAAUH%2F%2FnyE%3D","updated":"2014-01-10 14:14:32.000000000","message":"Done","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":599,"context_line":"    if not _LAST_VNC_PORT:"},{"line_number":600,"context_line":"        _LAST_VNC_PORT \u003d min_port"},{"line_number":601,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":602,"context_line":"    max_port \u003d min_port + port_total"},{"line_number":603,"context_line":"    for i in range(0, port_total):"},{"line_number":604,"context_line":"        _LAST_VNC_PORT +\u003d 1"},{"line_number":605,"context_line":"        if _LAST_VNC_PORT \u003e\u003d max_port:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnxU%3D","line":602,"updated":"2014-01-10 12:07:18.000000000","message":"I don\u0027t understand why you don\u0027t read min_port and port_total from the config in here?\n\nIt would remove the need to pass these values into this method.\n\nWe have set.flags() in the unit tests to make it really easy to test that kind of thing.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":599,"context_line":"    if not _LAST_VNC_PORT:"},{"line_number":600,"context_line":"        _LAST_VNC_PORT \u003d min_port"},{"line_number":601,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":602,"context_line":"    max_port \u003d min_port + port_total"},{"line_number":603,"context_line":"    for i in range(0, port_total):"},{"line_number":604,"context_line":"        _LAST_VNC_PORT +\u003d 1"},{"line_number":605,"context_line":"        if _LAST_VNC_PORT \u003e\u003d max_port:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnI8%3D","line":602,"in_reply_to":"AAAAUH%2F%2FnxU%3D","updated":"2014-01-10 14:14:32.000000000","message":"Thanks for letting me know about the flags() method. Done.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":600,"context_line":"        _LAST_VNC_PORT \u003d min_port"},{"line_number":601,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":602,"context_line":"    max_port \u003d min_port + port_total"},{"line_number":603,"context_line":"    for i in range(0, port_total):"},{"line_number":604,"context_line":"        _LAST_VNC_PORT +\u003d 1"},{"line_number":605,"context_line":"        if _LAST_VNC_PORT \u003e\u003d max_port:"},{"line_number":606,"context_line":"            _LAST_VNC_PORT \u003d min_port"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnvY%3D","line":603,"updated":"2014-01-10 12:07:18.000000000","message":"why not just loop from min_port to max_port? and stop complicating things with _LAST_VNC_PORT. You have already done all the expensive API calls.\n\nA better method might be just to use the old method to generate a port id, then if it clashes, add one until you don\u0027t get a collision.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":600,"context_line":"        _LAST_VNC_PORT \u003d min_port"},{"line_number":601,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":602,"context_line":"    max_port \u003d min_port + port_total"},{"line_number":603,"context_line":"    for i in range(0, port_total):"},{"line_number":604,"context_line":"        _LAST_VNC_PORT +\u003d 1"},{"line_number":605,"context_line":"        if _LAST_VNC_PORT \u003e\u003d max_port:"},{"line_number":606,"context_line":"            _LAST_VNC_PORT \u003d min_port"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnGw%3D","line":603,"in_reply_to":"AAAAUH%2F%2FnvY%3D","updated":"2014-01-10 14:14:32.000000000","message":"Please see the comment from Gary in patch 5 about this.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":612,"context_line":""},{"line_number":613,"context_line":"def _get_allocated_vnc_ports(session):"},{"line_number":614,"context_line":"    \"\"\"Return an integer set of all allocated VNC ports.\"\"\""},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"    # TODO(rgerganov): bug #1256944"},{"line_number":617,"context_line":"    # The VNC port should be unique per host, not per vCenter"},{"line_number":618,"context_line":"    vnc_ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2Fnw8%3D","line":615,"updated":"2014-01-10 12:07:18.000000000","message":"nit: could remove this empty line.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":612,"context_line":""},{"line_number":613,"context_line":"def _get_allocated_vnc_ports(session):"},{"line_number":614,"context_line":"    \"\"\"Return an integer set of all allocated VNC ports.\"\"\""},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"    # TODO(rgerganov): bug #1256944"},{"line_number":617,"context_line":"    # The VNC port should be unique per host, not per vCenter"},{"line_number":618,"context_line":"    vnc_ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnI4%3D","line":615,"in_reply_to":"AAAAUH%2F%2Fnw8%3D","updated":"2014-01-10 14:14:32.000000000","message":"Done","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"97f452cd8c99c29e3f553b7a8e22cc69264bf551","unresolved":false,"context_lines":[{"line_number":603,"context_line":"    min_port \u003d CONF.vmware.vnc_port"},{"line_number":604,"context_line":"    port_total \u003d CONF.vmware.vnc_port_total"},{"line_number":605,"context_line":"    global _LAST_VNC_PORT"},{"line_number":606,"context_line":"    if not _LAST_VNC_PORT:"},{"line_number":607,"context_line":"        _LAST_VNC_PORT \u003d min_port"},{"line_number":608,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":609,"context_line":"    max_port \u003d min_port + port_total"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2F1Kw%3D","line":606,"updated":"2014-02-24 15:54:09.000000000","message":"So if I understand correctly the _LAST_VNC_PORT is an optimisation to make the loop start form the last port assigned (unless there has been a crash), but IMHO this is not worth it, seeing that it makes the code much more subtle. \n\nIt is likely that this will spend most of it\u0027s time talking to the API, and once we have a list of all ports (which we do need to get anyway, a O(N) linear sweep to get the max or first available one is a more simple algorithm to understand, and a negligible overhead I am sure, compared to all the back and forth with the API.\n\nThoughts?","commit_id":"670c0ce5fa95f68f05d3304024e6fb1dfebca530"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"403c73382d51845f6eaf51a42f75cda470e5d4c7","unresolved":false,"context_lines":[{"line_number":603,"context_line":"    min_port \u003d CONF.vmware.vnc_port"},{"line_number":604,"context_line":"    port_total \u003d CONF.vmware.vnc_port_total"},{"line_number":605,"context_line":"    global _LAST_VNC_PORT"},{"line_number":606,"context_line":"    if not _LAST_VNC_PORT:"},{"line_number":607,"context_line":"        _LAST_VNC_PORT \u003d min_port"},{"line_number":608,"context_line":"    allocated_ports \u003d _get_allocated_vnc_ports(session)"},{"line_number":609,"context_line":"    max_port \u003d min_port + port_total"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2FsQQ%3D","line":606,"in_reply_to":"AAAAU3%2F%2F1Kw%3D","updated":"2014-02-25 08:40:00.000000000","message":"This optimization was suggested in patch set #5 but I am OK to remove it. You are correct that the overall time is dominated by the backend call and a linear search won\u0027t hurt here. On the plus side the code would become much more clear.","commit_id":"670c0ce5fa95f68f05d3304024e6fb1dfebca530"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"5bcce9615fa2f0c6d66fb73c2b441f2089f174e4","unresolved":false,"context_lines":[{"line_number":713,"context_line":"    vnc_ports \u003d set()"},{"line_number":714,"context_line":"    result \u003d session._call_method(vim_util, \"get_objects\","},{"line_number":715,"context_line":"                                  \"VirtualMachine\", [VNC_CONFIG_KEY])"},{"line_number":716,"context_line":"    while result:"},{"line_number":717,"context_line":"        for obj in result.objects:"},{"line_number":718,"context_line":"            if not hasattr(obj, \u0027propSet\u0027):"},{"line_number":719,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2FqmQ%3D","line":716,"updated":"2014-02-25 11:28:34.000000000","message":"I see this pattern a lot while-\u003echeck token-\u003e get stuff if there is more in these patches... how about abstracting it and basing this work on that patch?\n\nNot a -1 though - but it is good to do these things unless you feel it\u0027s better to get the fixes in first., \n\nWould be good to at least raise a bug","commit_id":"2f49ed4b5dbb5c954fc7a9b42ee7b170c38c775c"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"28efaa366788922e18ac8fc9537503969e036a3b","unresolved":false,"context_lines":[{"line_number":713,"context_line":"    vnc_ports \u003d set()"},{"line_number":714,"context_line":"    result \u003d session._call_method(vim_util, \"get_objects\","},{"line_number":715,"context_line":"                                  \"VirtualMachine\", [VNC_CONFIG_KEY])"},{"line_number":716,"context_line":"    while result:"},{"line_number":717,"context_line":"        for obj in result.objects:"},{"line_number":718,"context_line":"            if not hasattr(obj, \u0027propSet\u0027):"},{"line_number":719,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Foy8%3D","line":716,"in_reply_to":"AAAAU3%2F%2FqmQ%3D","updated":"2014-02-25 14:37:59.000000000","message":"I have filed https://bugs.launchpad.net/nova/+bug/1284658\nI prefer to get this patch in first because it fixes a bug with high importance.","commit_id":"2f49ed4b5dbb5c954fc7a9b42ee7b170c38c775c"}],"nova/virt/vmwareapi/vmops.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"a7bb3778085e1adffbad8b2cf49f8807fc0d89c8","unresolved":false,"context_lines":[{"line_number":299,"context_line":"        if CONF.vnc_enabled:"},{"line_number":300,"context_line":"            vnc_port \u003d self._get_vnc_port()"},{"line_number":301,"context_line":"            if vnc_port:"},{"line_number":302,"context_line":"                self._set_vnc_config(client_factory, instance, vnc_port)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        def _create_virtual_disk():"},{"line_number":305,"context_line":"            \"\"\"Create a virtual disk of the size of flat vmdk file.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BPlw%3D","line":302,"updated":"2013-11-28 12:07:14.000000000","message":"This is just skipping VNC setup if port allocation fails. If the host requires VNC and there are no free ports, then IMHO you should raise an error, not silently start the VM without VNC","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"bb66bcf124ef83f6a352df4859f7a7880b8402fa","unresolved":false,"context_lines":[{"line_number":299,"context_line":"        if CONF.vnc_enabled:"},{"line_number":300,"context_line":"            vnc_port \u003d self._get_vnc_port()"},{"line_number":301,"context_line":"            if vnc_port:"},{"line_number":302,"context_line":"                self._set_vnc_config(client_factory, instance, vnc_port)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        def _create_virtual_disk():"},{"line_number":305,"context_line":"            \"\"\"Create a virtual disk of the size of flat vmdk file.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BPjA%3D","line":302,"in_reply_to":"AAAATn%2F%2BPlw%3D","updated":"2013-11-28 12:23:56.000000000","message":"OK, I wasn\u0027t sure what would be the appropriate behavior here. I will change it to raise exception.","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"a7bb3778085e1adffbad8b2cf49f8807fc0d89c8","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"                dynamic_prop \u003d obj.propSet[0]"},{"line_number":1378,"context_line":"                option_value \u003d dynamic_prop.val"},{"line_number":1379,"context_line":"                vnc_port \u003d option_value.value"},{"line_number":1380,"context_line":"                vnc_ports.add(int(vnc_port))"},{"line_number":1381,"context_line":"        return vnc_ports"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BPlM%3D","line":1380,"updated":"2013-11-28 12:07:14.000000000","message":"IIUC, the VMWare driver can run against vCenter and thus a single Nova instance will see VMs running across multiple virtualization hosts. This logic appears to build a list of ports used by all VMs regardless of host. Tthe VNC port, however, only needs to be unique within 1 single host. So unless I\u0027m mistaken, this code requiring a globally unique port would limit the total VMs you can run in the entire cloud to just 65536 (or even less depending on vnc_port_total)","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"50eaeea5ad56966b618d1e0687be931b7d809bf9","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"                dynamic_prop \u003d obj.propSet[0]"},{"line_number":1378,"context_line":"                option_value \u003d dynamic_prop.val"},{"line_number":1379,"context_line":"                vnc_port \u003d option_value.value"},{"line_number":1380,"context_line":"                vnc_ports.add(int(vnc_port))"},{"line_number":1381,"context_line":"        return vnc_ports"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BOY4%3D","line":1380,"in_reply_to":"AAAATn%2F%2BPV0%3D","updated":"2013-11-28 17:21:03.000000000","message":"The maximum number of registered virtual machines in vCenter is 15000 (source: http://goo.gl/u90zhZ), so we should be OK with this approach if we increase vnc_port_total. I agree it is not very nice but it seems to be the most easy way to fix this security issue with the current API.","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"6f37a5b54e65dd0fda49fbeadba7ff8bc9a38016","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"                dynamic_prop \u003d obj.propSet[0]"},{"line_number":1378,"context_line":"                option_value \u003d dynamic_prop.val"},{"line_number":1379,"context_line":"                vnc_port \u003d option_value.value"},{"line_number":1380,"context_line":"                vnc_ports.add(int(vnc_port))"},{"line_number":1381,"context_line":"        return vnc_ports"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BPV0%3D","line":1380,"in_reply_to":"AAAATn%2F%2BPhs%3D","updated":"2013-11-28 13:04:15.000000000","message":"Then this is a really awful design flaw. At the very least there needs to be a TODO comment here referencing a bug to track this problem, but I really think this should be fixed now instead of creating a new port allocater algorithm which is equally broken.","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"bb66bcf124ef83f6a352df4859f7a7880b8402fa","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"                dynamic_prop \u003d obj.propSet[0]"},{"line_number":1378,"context_line":"                option_value \u003d dynamic_prop.val"},{"line_number":1379,"context_line":"                vnc_port \u003d option_value.value"},{"line_number":1380,"context_line":"                vnc_ports.add(int(vnc_port))"},{"line_number":1381,"context_line":"        return vnc_ports"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BPhs%3D","line":1380,"in_reply_to":"AAAATn%2F%2BPlM%3D","updated":"2013-11-28 12:23:56.000000000","message":"You are correct but unfortunately there is no way to know in advance on which host the VM is going to be placed if you have a DRS cluster. This limitation was in place even before my changes but there was a chance for VNC port collisions.","commit_id":"3b8d1f812cdf976529e56c457d5c7f337a42c9d3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"263c4d8ef7a62ba945f38c526469fc1726c04372","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"                               \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027)"},{"line_number":1330,"context_line":"        if opt_value:"},{"line_number":1331,"context_line":"            port \u003d int(opt_value.value)"},{"line_number":1332,"context_line":"        else:"},{"line_number":1333,"context_line":"            raise exception.ConsoleTypeUnavailable(console_type\u003d\u0027vnc\u0027)"},{"line_number":1334,"context_line":""},{"line_number":1335,"context_line":"        return {\u0027host\u0027: CONF.vmware.host_ip,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BPOs%3D","line":1332,"updated":"2013-11-28 13:30:27.000000000","message":"i do not think an exception here is good. why would we want to prevent someone running a VM?\nI would prefer a log warning here for the admin","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"d44dac646d621d35786909396cbae83abffc29d9","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"                               \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027)"},{"line_number":1330,"context_line":"        if opt_value:"},{"line_number":1331,"context_line":"            port \u003d int(opt_value.value)"},{"line_number":1332,"context_line":"        else:"},{"line_number":1333,"context_line":"            raise exception.ConsoleTypeUnavailable(console_type\u003d\u0027vnc\u0027)"},{"line_number":1334,"context_line":""},{"line_number":1335,"context_line":"        return {\u0027host\u0027: CONF.vmware.host_ip,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BPMA%3D","line":1332,"in_reply_to":"AAAATn%2F%2BPOs%3D","updated":"2013-11-28 13:42:02.000000000","message":"This is the code path used once a VM is running and the user tries to access the console. The codepath for starting a VM is further up at line 300.\n\nWe absolutely should raise an error when starting a VM if we run out of ports. Ignoring the any kind of resource exhaustion and carrying on booting the VM results in a VM which is broken from the POV of the user. By aborting the VM boot attempts, apps using Nova such as Heat will see the failure and can retry VM creation, potentially in another cluster where it will succeed. Just silently ignoring the error prevents them from doing such error handling.","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"263c4d8ef7a62ba945f38c526469fc1726c04372","unresolved":false,"context_lines":[{"line_number":1361,"context_line":"        allocated_ports \u003d self._get_allocated_vnc_ports()"},{"line_number":1362,"context_line":"        min_port \u003d CONF.vmware.vnc_port"},{"line_number":1363,"context_line":"        max_port \u003d min_port + CONF.vmware.vnc_port_total"},{"line_number":1364,"context_line":"        for port in range(min_port, max_port):"},{"line_number":1365,"context_line":"            if port not in allocated_ports:"},{"line_number":1366,"context_line":"                return port"},{"line_number":1367,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BPOc%3D","line":1364,"updated":"2013-11-28 13:30:27.000000000","message":"would it not be better to select a random number from the free set of ports instead of just incrementing. this will reuse ports and that may also be a problem","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"7c563558b08272cf4a4e8b062a94f2d5f9c995e8","unresolved":false,"context_lines":[{"line_number":1361,"context_line":"        allocated_ports \u003d self._get_allocated_vnc_ports()"},{"line_number":1362,"context_line":"        min_port \u003d CONF.vmware.vnc_port"},{"line_number":1363,"context_line":"        max_port \u003d min_port + CONF.vmware.vnc_port_total"},{"line_number":1364,"context_line":"        for port in range(min_port, max_port):"},{"line_number":1365,"context_line":"            if port not in allocated_ports:"},{"line_number":1366,"context_line":"                return port"},{"line_number":1367,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BOaw%3D","line":1364,"in_reply_to":"AAAATn%2F%2BPOc%3D","updated":"2013-11-28 17:08:00.000000000","message":"I prefer to use synchronization to avoid race conditions. Please take a look at the next patch.","commit_id":"771d226379b92c4f879bbf215534923bec291ca0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        # Set the vnc configuration of the instance, vnc port starts from 5900"},{"line_number":299,"context_line":"        if CONF.vnc_enabled:"},{"line_number":300,"context_line":"            vnc_port \u003d vm_util.get_vnc_port(self._session,"},{"line_number":301,"context_line":"                                            CONF.vmware.vnc_port,"},{"line_number":302,"context_line":"                                            CONF.vmware.vnc_port_total)"},{"line_number":303,"context_line":"            self._set_vnc_config(client_factory, instance, vnc_port)"},{"line_number":304,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnvI%3D","line":301,"updated":"2014-01-10 12:07:18.000000000","message":"This feels wrong, the conf can be read inside vm_util right?","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        # Set the vnc configuration of the instance, vnc port starts from 5900"},{"line_number":299,"context_line":"        if CONF.vnc_enabled:"},{"line_number":300,"context_line":"            vnc_port \u003d vm_util.get_vnc_port(self._session,"},{"line_number":301,"context_line":"                                            CONF.vmware.vnc_port,"},{"line_number":302,"context_line":"                                            CONF.vmware.vnc_port_total)"},{"line_number":303,"context_line":"            self._set_vnc_config(client_factory, instance, vnc_port)"},{"line_number":304,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnI0%3D","line":301,"in_reply_to":"AAAAUH%2F%2FnvI%3D","updated":"2014-01-10 14:14:32.000000000","message":"Done","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"93b3a0044f031a3014e361e212e7d960709d8593","unresolved":false,"context_lines":[{"line_number":1327,"context_line":"        opt_value \u003d self._session._call_method(vim_util,"},{"line_number":1328,"context_line":"                               \u0027get_dynamic_property\u0027,"},{"line_number":1329,"context_line":"                               vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1330,"context_line":"                               \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027)"},{"line_number":1331,"context_line":"        if opt_value:"},{"line_number":1332,"context_line":"            port \u003d int(opt_value.value)"},{"line_number":1333,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2Fnu4%3D","line":1330,"updated":"2014-01-10 12:07:18.000000000","message":"This is not dry, please share with vm_util for this key name.\n\nMaybe add a vm_util method to get_vnc_port?","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"e9155bd2d3845913fe09c91ebae09a15aa011d65","unresolved":false,"context_lines":[{"line_number":1327,"context_line":"        opt_value \u003d self._session._call_method(vim_util,"},{"line_number":1328,"context_line":"                               \u0027get_dynamic_property\u0027,"},{"line_number":1329,"context_line":"                               vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1330,"context_line":"                               \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027)"},{"line_number":1331,"context_line":"        if opt_value:"},{"line_number":1332,"context_line":"            port \u003d int(opt_value.value)"},{"line_number":1333,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FnHg%3D","line":1330,"in_reply_to":"AAAAUH%2F%2Fnu4%3D","updated":"2014-01-10 14:14:32.000000000","message":"I have added a constant in vm_util for the key.","commit_id":"8bf1244b23dca2dab3552baa1da369e40aea27eb"}]}
