)]}'
{".zuul.yaml":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ae7bbc42c3d22aaa41680f80455cf52837f4526","unresolved":false,"context_lines":[{"line_number":11,"context_line":"      - openstack/devstack-gate"},{"line_number":12,"context_line":"      - openstack/nova"},{"line_number":13,"context_line":"      - openstack/tempest"},{"line_number":14,"context_line":"      - openstack/os-traits"},{"line_number":15,"context_line":"    irrelevant-files: \u0026dsvm-irrelevant-files"},{"line_number":16,"context_line":"      - ^api-.*$"},{"line_number":17,"context_line":"      - ^(test-|)requirements.txt$"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"bfb3d3c7_0f52fbde","line":14,"updated":"2019-05-28 16:58:19.000000000","message":"You should have a big fat comment on this saying to not merge it like this.","commit_id":"fc369eb03f4a2d061d8ba32db9c48c6c2336dd92"}],"/COMMIT_MSG":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bb1602f7496fc16e09f30b793cfd463fd454605a","unresolved":false,"context_lines":[{"line_number":24,"context_line":"      capability retrieval and parsing code which was added in"},{"line_number":25,"context_line":"      I4c35b6a27db05349213429422ffe62adb09bd921."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"The change also depends on I15364d37fb7426f4eec00ca4eaf99bec50e964b6"},{"line_number":28,"context_line":"and Ic4c16b23834b43a258be5073e32bcdb9c0421f02 in order to map the"},{"line_number":29,"context_line":"capability to the standard trait HW_CPU_AMD_SEV which already exists"},{"line_number":30,"context_line":"in os-traits from 0.11.0."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_f31f0d6d","line":27,"range":{"start_line":27,"start_character":27,"end_line":27,"end_character":68},"updated":"2019-03-01 19:27:27.000000000","message":"That\u0027s part of this patch series, I don\u0027t think you need to specify that it\u0027s a dependant. Just by being below this one it\u0027s implicit.","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"72b54ef17b04bc67dd540bdeefa2e2ebf7743f88","unresolved":false,"context_lines":[{"line_number":24,"context_line":"      capability retrieval and parsing code which was added in"},{"line_number":25,"context_line":"      I4c35b6a27db05349213429422ffe62adb09bd921."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"The change also depends on I15364d37fb7426f4eec00ca4eaf99bec50e964b6"},{"line_number":28,"context_line":"and Ic4c16b23834b43a258be5073e32bcdb9c0421f02 in order to map the"},{"line_number":29,"context_line":"capability to the standard trait HW_CPU_AMD_SEV which already exists"},{"line_number":30,"context_line":"in os-traits from 0.11.0."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_0fae2581","line":27,"range":{"start_line":27,"start_character":27,"end_line":27,"end_character":68},"in_reply_to":"9fdfeff1_f31f0d6d","updated":"2019-03-01 20:14:06.000000000","message":"True - as discussed on IRC I wanted this to be explicit:\n\nhttp://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-03-01.log.html#t2019-03-01T19:27:56","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"bb1602f7496fc16e09f30b793cfd463fd454605a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"      I4c35b6a27db05349213429422ffe62adb09bd921."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"The change also depends on I15364d37fb7426f4eec00ca4eaf99bec50e964b6"},{"line_number":28,"context_line":"and Ic4c16b23834b43a258be5073e32bcdb9c0421f02 in order to map the"},{"line_number":29,"context_line":"capability to the standard trait HW_CPU_AMD_SEV which already exists"},{"line_number":30,"context_line":"in os-traits from 0.11.0."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_b350a52d","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":45},"updated":"2019-03-01 19:27:27.000000000","message":"That\u0027s merged, can be removed from here.","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"72b54ef17b04bc67dd540bdeefa2e2ebf7743f88","unresolved":false,"context_lines":[{"line_number":25,"context_line":"      I4c35b6a27db05349213429422ffe62adb09bd921."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"The change also depends on I15364d37fb7426f4eec00ca4eaf99bec50e964b6"},{"line_number":28,"context_line":"and Ic4c16b23834b43a258be5073e32bcdb9c0421f02 in order to map the"},{"line_number":29,"context_line":"capability to the standard trait HW_CPU_AMD_SEV which already exists"},{"line_number":30,"context_line":"in os-traits from 0.11.0."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_afdd99de","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":45},"in_reply_to":"9fdfeff1_b350a52d","updated":"2019-03-01 20:14:06.000000000","message":"Actually IMHO there\u0027s even more reason to have the dependency explicitly documented when merged, since at that point it\u0027s in an enormous linear history where the real dependencies are almost indistinguishable from all the other ancestors ... well, at least difficult to distinguish without the help of my tool https://github.com/aspiers/git-deps ;-)","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"feb677b7c14e2a349d3a1267a74d3cf8a3c03a3b","unresolved":false,"context_lines":[{"line_number":24,"context_line":"      capability retrieval and parsing code which was added in"},{"line_number":25,"context_line":"      I4c35b6a27db05349213429422ffe62adb09bd921."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"The change also depends on two changes which are already merged:"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"  - Convert driver supported capabilities to compute node provider traits"},{"line_number":30,"context_line":"    (I15364d37fb7426f4eec00ca4eaf99bec50e964b6)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"  - Change LibvirtDriver.capabilities to an instance variable"},{"line_number":33,"context_line":"    (Ic4c16b23834b43a258be5073e32bcdb9c0421f02)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"in order to map the capability to the standard trait HW_CPU_AMD_SEV"},{"line_number":36,"context_line":"which already exists in os-traits from 0.11.0."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"bfb3d3c7_cee325a4","line":33,"range":{"start_line":27,"start_character":0,"end_line":33,"end_character":47},"updated":"2019-05-17 18:36:57.000000000","message":"Since they\u0027re merged, this isn\u0027t necessary, though it\u0027s nice context.\n\nHowever, given that we shouldn\u0027t be doing this as a driver-level capability (see other comments), it should be removed.","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"09b131346a009f3bb8b29efb877a2dd7858ab2fd","unresolved":false,"context_lines":[{"line_number":24,"context_line":"      capability retrieval and parsing code which was added in"},{"line_number":25,"context_line":"      I4c35b6a27db05349213429422ffe62adb09bd921."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"The change also depends on two changes which are already merged:"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"  - Convert driver supported capabilities to compute node provider traits"},{"line_number":30,"context_line":"    (I15364d37fb7426f4eec00ca4eaf99bec50e964b6)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"  - Change LibvirtDriver.capabilities to an instance variable"},{"line_number":33,"context_line":"    (Ic4c16b23834b43a258be5073e32bcdb9c0421f02)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"in order to map the capability to the standard trait HW_CPU_AMD_SEV"},{"line_number":36,"context_line":"which already exists in os-traits from 0.11.0."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"bfb3d3c7_ae991120","line":33,"range":{"start_line":27,"start_character":0,"end_line":33,"end_character":47},"in_reply_to":"bfb3d3c7_cee325a4","updated":"2019-05-24 19:04:48.000000000","message":"\u003e Since they\u0027re merged, this isn\u0027t necessary, though it\u0027s nice\n \u003e context.\n\nRight: https://review.opendev.org/#/c/638680/4//COMMIT_MSG@27\n\n \u003e However, given that we shouldn\u0027t be doing this as a driver-level\n \u003e capability (see other comments), it should be removed.\n\nDone.","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"012bcbbb0a256d8b7354a371d047cec0cf58ab9a","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Provide HW_CPU_X86_AMD_SEV trait when SEV is supported"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add the final piece of the SEV detection code to init_host() in the"},{"line_number":10,"context_line":"libvirt driver, by checking that:"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"   a) \u0027sev\u0027 parameter of the kvm-amd kernel module is enabled, and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"7faddb67_443978ef","line":9,"range":{"start_line":9,"start_character":8,"end_line":9,"end_character":13},"updated":"2019-07-19 17:24:16.000000000","message":"heh, this reads kind of funny now that this is the first patch in the series :)","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"689133bfd8b92c6c44b5b265c6bdada97745aa05","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Provide HW_CPU_X86_AMD_SEV trait when SEV is supported"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add the final piece of the SEV detection code to init_host() in the"},{"line_number":10,"context_line":"libvirt driver, by checking that:"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"   a) \u0027sev\u0027 parameter of the kvm-amd kernel module is enabled, and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"7faddb67_18bacbdd","line":9,"range":{"start_line":9,"start_character":8,"end_line":9,"end_character":13},"in_reply_to":"7faddb67_443978ef","updated":"2019-07-24 11:02:00.000000000","message":"Done","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"encrypted memory can be run on a host concurrently.  Until that point,"},{"line_number":34,"context_line":"SEV functionality cannot be used, and this trait is effectively"},{"line_number":35,"context_line":"dormant."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Since the functional test setup is near identical to that already used"},{"line_number":38,"context_line":"in test_shared_resource_provider.py, extract it into a new base class"},{"line_number":39,"context_line":"called LibvirtProviderUsageBaseTestCase in a new file:"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    nova/tests/functional/libvirt/integrated_helpers.py"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"and reuse that for the new tests."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"blueprint: amd-sev-libvirt-support"},{"line_number":46,"context_line":"Change-Id: I2b41f1cce0af8b9d36b74a4663aa4ff227e17cc6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":38,"id":"7faddb67_9243f2af","line":43,"range":{"start_line":36,"start_character":0,"end_line":43,"end_character":32},"updated":"2019-08-09 14:45:51.000000000","message":"This probably should have been done separately","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"11e9caaad110aa7a285fcbda6e0ea0cc9aa79042","unresolved":false,"context_lines":[{"line_number":33,"context_line":"encrypted memory can be run on a host concurrently.  Until that point,"},{"line_number":34,"context_line":"SEV functionality cannot be used, and this trait is effectively"},{"line_number":35,"context_line":"dormant."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Since the functional test setup is near identical to that already used"},{"line_number":38,"context_line":"in test_shared_resource_provider.py, extract it into a new base class"},{"line_number":39,"context_line":"called LibvirtProviderUsageBaseTestCase in a new file:"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    nova/tests/functional/libvirt/integrated_helpers.py"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"and reuse that for the new tests."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"blueprint: amd-sev-libvirt-support"},{"line_number":46,"context_line":"Change-Id: I2b41f1cce0af8b9d36b74a4663aa4ff227e17cc6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":38,"id":"7faddb67_b466ac50","line":43,"range":{"start_line":36,"start_character":0,"end_line":43,"end_character":32},"in_reply_to":"7faddb67_9243f2af","updated":"2019-08-16 14:47:58.000000000","message":"Done","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"}],"nova/tests/functional/libvirt/integrated_helpers.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 SUSE"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_f2c08ee3","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":21},"updated":"2019-05-29 23:04:47.000000000","message":"Does SUSE require that you do this?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 SUSE"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_e7976aeb","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":21},"in_reply_to":"bfb3d3c7_f2c08ee3","updated":"2019-05-30 10:42:55.000000000","message":"Honestly I don\u0027t know.  I literally copied the header of an existing file (functional/integrated_helpers.py), but thought it was wrong to use the copyright name from it (Justin Santa Barbara) since this is a brand new file which has little to do with them.\n\nHaving said that, it seems (and I suspect you\u0027ll agree based on our previous IRC conversations) like total bullshit putting individuals or organizations at the top of these files, since they tend to be a big amalgamation of work from many different people and organizations. Clearly the git history is a far better way to track copyright ownership.\n\nI\u0027ll ditch it, but guidance is very welcome if there\u0027s something better to put here. If you\u0027re wondering why I didn\u0027t put my own name, well SUSE\u0027s paying me to do this so it seems fairer that they should get any copyright assignment.  That might even be in my contract but it seems like a grey area anyway when it comes to FOSS (e.g. I don\u0027t believe they should have any claim to hacking done in my spare time, I\u0027m free to hack on OpenStack outside working hours, and my hours are pretty fluid anyway ...)","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 SUSE"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_12c442f4","line":2,"range":{"start_line":2,"start_character":0,"end_line":2,"end_character":22},"updated":"2019-05-29 23:04:47.000000000","message":"or this? There was a movement a while back to stop saying this.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 SUSE"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_87af8e28","line":2,"range":{"start_line":2,"start_character":0,"end_line":2,"end_character":22},"in_reply_to":"bfb3d3c7_12c442f4","updated":"2019-05-30 10:42:55.000000000","message":"As per above, just copied from the existing integrated_helpers.py.  Is there any documentation on that movement?\n\nI did just find https://docs.openstack.org/hacking/latest/user/hacking.html#openstack-licensing which seems to imply that I could just ditch these first two lines, but it would be better if there was an explicit policy documented.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":"    compute_driver \u003d \u0027libvirt.LibvirtDriver\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def setUp(self, init_host\u003dFalse):"},{"line_number":37,"context_line":"        super(LibvirtProviderUsageBaseTestCase, self).setUp()"},{"line_number":38,"context_line":"        self.useFixture(fakelibvirt.FakeLibvirtFixture(stub_os_vif\u003dFalse))"},{"line_number":39,"context_line":"        if not init_host:"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_52a5da45","line":36,"range":{"start_line":36,"start_character":20,"end_line":36,"end_character":35},"updated":"2019-05-29 23:04:47.000000000","message":"We usually do this with class-level variables. See e.g. [1]. Giving setUp a nonstandard call signature can have painful knock-on effects.\n\nSo here maybe you would set up a STUB_INIT_HOST \u003d True...\n\n[1] https://opendev.org/openstack/nova/src/branch/master/nova/test.py#L181-L199","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":"    compute_driver \u003d \u0027libvirt.LibvirtDriver\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def setUp(self, init_host\u003dFalse):"},{"line_number":37,"context_line":"        super(LibvirtProviderUsageBaseTestCase, self).setUp()"},{"line_number":38,"context_line":"        self.useFixture(fakelibvirt.FakeLibvirtFixture(stub_os_vif\u003dFalse))"},{"line_number":39,"context_line":"        if not init_host:"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_47a51646","line":36,"range":{"start_line":36,"start_character":20,"end_line":36,"end_character":35},"in_reply_to":"bfb3d3c7_52a5da45","updated":"2019-05-30 10:42:55.000000000","message":"Ah, nice idea thanks!!  Yeah I wasn\u0027t keen on changing the signature but stupidly didn\u0027t think of this way to do it.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    allocations and usage using the libvirt driver."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    :param init_host: boolean representing whether the test case needs"},{"line_number":29,"context_line":"    to test the init_host() code path. Defaults to False."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    compute_driver \u003d \u0027libvirt.LibvirtDriver\u0027"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fb8cfa7_505854f8","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":57},"updated":"2019-08-09 14:45:51.000000000","message":"nit: this should be indented to render properly (this is rST)","commit_id":"8802b78217d77cd162dff1ef69ad16b2cdd7d393"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"012bcbbb0a256d8b7354a371d047cec0cf58ab9a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \"\"\"Base test class for functional tests that check provider"},{"line_number":26,"context_line":"    allocations and usage using the libvirt driver."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    :param init_host: boolean representing whether the test case needs"},{"line_number":29,"context_line":"    to test the init_host() code path. Defaults to False."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    compute_driver \u003d \u0027libvirt.LibvirtDriver\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"7faddb67_6ae8fdb1","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":20},"updated":"2019-07-19 17:24:16.000000000","message":"eh?","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"dad184456e75d4de2e76fad928074eac804c162e","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \"\"\"Base test class for functional tests that check provider"},{"line_number":26,"context_line":"    allocations and usage using the libvirt driver."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    :param init_host: boolean representing whether the test case needs"},{"line_number":29,"context_line":"    to test the init_host() code path. Defaults to False."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    compute_driver \u003d \u0027libvirt.LibvirtDriver\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"7faddb67_d41f3eb5","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":20},"in_reply_to":"7faddb67_6ae8fdb1","updated":"2019-07-22 18:54:55.000000000","message":"My bad, looks like I screwed up when introducing this file in patch set 20.","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"689133bfd8b92c6c44b5b265c6bdada97745aa05","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \"\"\"Base test class for functional tests that check provider"},{"line_number":26,"context_line":"    allocations and usage using the libvirt driver."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    :param init_host: boolean representing whether the test case needs"},{"line_number":29,"context_line":"    to test the init_host() code path. Defaults to False."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":"    compute_driver \u003d \u0027libvirt.LibvirtDriver\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"7faddb67_581843d2","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":20},"in_reply_to":"7faddb67_d41f3eb5","updated":"2019-07-24 11:02:00.000000000","message":"Now fixed (removed).","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":20,"context_line":"CONF \u003d conf.CONF"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class LibvirtProviderUsageBaseTestCase("},{"line_number":24,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":25,"context_line":"    \"\"\"Base test class for functional tests that check provider"},{"line_number":26,"context_line":"    allocations and usage using the libvirt driver."},{"line_number":27,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_f20b467a","line":24,"range":{"start_line":23,"start_character":0,"end_line":24,"end_character":54},"updated":"2019-08-09 14:45:51.000000000","message":"I have a use for this in cpu-resources. Excellent","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            fixtures.MockPatch("},{"line_number":41,"context_line":"                \u0027nova.virt.libvirt.driver.LibvirtDriver.spawn\u0027))"},{"line_number":42,"context_line":"        self.pre_start_compute()"},{"line_number":43,"context_line":"        self.start_compute()"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def pre_start_compute(self):"},{"line_number":46,"context_line":"        \"\"\"Subclasses can override this in order to do extra stuff"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_d2fe4a37","line":43,"range":{"start_line":43,"start_character":0,"end_line":43,"end_character":28},"updated":"2019-08-09 14:45:51.000000000","message":"What about not doing this in setUp, and instead doing this manually as part of each test? It removes the need for the \u0027pre_start_compute\u0027 and also means we don\u0027t need to have separate test classes with their own mocks on setUp in \u0027test_report_cpu_traits.py\u0027. Could we do that?","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"11e9caaad110aa7a285fcbda6e0ea0cc9aa79042","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            fixtures.MockPatch("},{"line_number":41,"context_line":"                \u0027nova.virt.libvirt.driver.LibvirtDriver.spawn\u0027))"},{"line_number":42,"context_line":"        self.pre_start_compute()"},{"line_number":43,"context_line":"        self.start_compute()"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def pre_start_compute(self):"},{"line_number":46,"context_line":"        \"\"\"Subclasses can override this in order to do extra stuff"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_d4a6c854","line":43,"range":{"start_line":43,"start_character":0,"end_line":43,"end_character":28},"in_reply_to":"7faddb67_d2fe4a37","updated":"2019-08-16 14:47:58.000000000","message":"Done","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"}],"nova/tests/functional/libvirt/test_report_cpu_traits.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class LibvirtReportTraitsTestBase("},{"line_number":30,"context_line":"        integrated_helpers.LibvirtProviderUsageBaseTestCase):"},{"line_number":31,"context_line":"    def setUp(self, init_host\u003dFalse):"},{"line_number":32,"context_line":"        super(LibvirtReportTraitsTestBase, self).setUp(init_host)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def pre_start_compute(self):"},{"line_number":35,"context_line":"        self.assertEqual([], self._get_all_providers())"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_527abab9","line":32,"range":{"start_line":31,"start_character":0,"end_line":32,"end_character":65},"updated":"2019-05-29 23:04:47.000000000","message":"...and then you could get rid of this override entirely (um, which you actually could have done anyway I think)","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class LibvirtReportTraitsTestBase("},{"line_number":30,"context_line":"        integrated_helpers.LibvirtProviderUsageBaseTestCase):"},{"line_number":31,"context_line":"    def setUp(self, init_host\u003dFalse):"},{"line_number":32,"context_line":"        super(LibvirtReportTraitsTestBase, self).setUp(init_host)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def pre_start_compute(self):"},{"line_number":35,"context_line":"        self.assertEqual([], self._get_all_providers())"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_a73972f2","line":32,"range":{"start_line":31,"start_character":0,"end_line":32,"end_character":65},"in_reply_to":"bfb3d3c7_527abab9","updated":"2019-05-30 10:42:55.000000000","message":"Done","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class LibvirtReportNoSevTraitsTests(LibvirtReportTraitsTestBase):"},{"line_number":64,"context_line":"    @test.patch_exists(SEV_KERNEL_PARAM_FILE, False)"},{"line_number":65,"context_line":"    def setUp(self):"},{"line_number":66,"context_line":"        super(LibvirtReportNoSevTraitsTests, self).setUp(True)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_52539a39","line":64,"updated":"2019-05-29 23:04:47.000000000","message":"...and then here you would say\n\n STUB_INIT_HOST \u003d False\n\ninstead of having a one-line setUp method.\n\n(You still need to put your patch_exists somewhere, but you could probably put it on the class.)\n\n[Later] Actually, you could init it in your setUp and save the mock as an instance var so you can override it later when you need to without re-mocking it.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class LibvirtReportNoSevTraitsTests(LibvirtReportTraitsTestBase):"},{"line_number":64,"context_line":"    @test.patch_exists(SEV_KERNEL_PARAM_FILE, False)"},{"line_number":65,"context_line":"    def setUp(self):"},{"line_number":66,"context_line":"        super(LibvirtReportNoSevTraitsTests, self).setUp(True)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_392e0692","line":64,"in_reply_to":"bfb3d3c7_52539a39","updated":"2019-05-30 10:42:55.000000000","message":"I\u0027ve put on the class for now (and ditto for the other test below).  Not sure what you mean by \"init it in your setUp [...]\"?  The decorator form of @patch_exists doesn\u0027t provide access to the mock, and the context-manager form wouldn\u0027t be any use in setUp() since it needs to apply the context during the tests too, so I guess you are talking about another approach, but I can\u0027t immediately figure out what that would be.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        super(LibvirtReportNoSevTraitsTests, self).setUp(True)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def test_sev_trait_off_on(self):"},{"line_number":69,"context_line":"        \"\"\"Test that the compute service reports the SEV trait and register it"},{"line_number":70,"context_line":"        on the compute host resource provider in the placement API."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        Then test that if the SEV capability appears, after a restart"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_f233ae12","line":69,"range":{"start_line":69,"start_character":67,"end_line":69,"end_character":75},"updated":"2019-05-29 23:04:47.000000000","message":"registers","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        super(LibvirtReportNoSevTraitsTests, self).setUp(True)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def test_sev_trait_off_on(self):"},{"line_number":69,"context_line":"        \"\"\"Test that the compute service reports the SEV trait and register it"},{"line_number":70,"context_line":"        on the compute host resource provider in the placement API."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        Then test that if the SEV capability appears, after a restart"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_59e5fa36","line":69,"range":{"start_line":69,"start_character":67,"end_line":69,"end_character":75},"in_reply_to":"bfb3d3c7_f233ae12","updated":"2019-05-30 10:42:55.000000000","message":"Done","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        Then test that if the SEV capability appears, after a restart"},{"line_number":73,"context_line":"        of the compute service, the trait gets registered on the"},{"line_number":74,"context_line":"        compute host."},{"line_number":75,"context_line":"        \"\"\""},{"line_number":76,"context_line":"        sev_trait \u003d ost.HW_CPU_X86_AMD_SEV"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_322dc6a7","line":74,"updated":"2019-05-29 23:04:47.000000000","message":"I may be being thick, but these two sentences seem to be saying the same thing, and the test is doing something different.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        Then test that if the SEV capability appears, after a restart"},{"line_number":73,"context_line":"        of the compute service, the trait gets registered on the"},{"line_number":74,"context_line":"        compute host."},{"line_number":75,"context_line":"        \"\"\""},{"line_number":76,"context_line":"        sev_trait \u003d ost.HW_CPU_X86_AMD_SEV"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_993e12bf","line":74,"in_reply_to":"bfb3d3c7_322dc6a7","updated":"2019-05-30 10:42:55.000000000","message":"No, you\u0027re right - probably a combination of rewrites of the test, forgetting to corresponding update the docstring at one or more points.  Fixed in next patchset.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        sev_features \u003d \\"},{"line_number":87,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":88,"context_line":"        with test.nested("},{"line_number":89,"context_line":"                self.patch_exists(SEV_KERNEL_PARAM_FILE, True),"},{"line_number":90,"context_line":"                self.patch_open(SEV_KERNEL_PARAM_FILE, \"1\\n\"),"},{"line_number":91,"context_line":"                mock.patch.object(fakelibvirt.virConnect,"},{"line_number":92,"context_line":"                                  \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_f5015806","line":89,"range":{"start_line":89,"start_character":16,"end_line":89,"end_character":63},"updated":"2019-05-29 23:04:47.000000000","message":"this is re-mocking the thing you already mocked in setUp; you could save off the mock up there and just change its return_value here.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5102b798e3c1cb885883d9e4de2e5d209d7a6d54","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        sev_features \u003d \\"},{"line_number":87,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":88,"context_line":"        with test.nested("},{"line_number":89,"context_line":"                self.patch_exists(SEV_KERNEL_PARAM_FILE, True),"},{"line_number":90,"context_line":"                self.patch_open(SEV_KERNEL_PARAM_FILE, \"1\\n\"),"},{"line_number":91,"context_line":"                mock.patch.object(fakelibvirt.virConnect,"},{"line_number":92,"context_line":"                                  \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_b1367e50","line":89,"range":{"start_line":89,"start_character":16,"end_line":89,"end_character":63},"in_reply_to":"bfb3d3c7_3995a633","updated":"2019-05-30 22:26:00.000000000","message":"Nah, never mind; because of the way you set it up to be a context manager, you can\u0027t actually get access to the mock itself (at least I can\u0027t figure out how).","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"e4fa19b751f2a8a095055d39638465c8554da35c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        sev_features \u003d \\"},{"line_number":87,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":88,"context_line":"        with test.nested("},{"line_number":89,"context_line":"                self.patch_exists(SEV_KERNEL_PARAM_FILE, True),"},{"line_number":90,"context_line":"                self.patch_open(SEV_KERNEL_PARAM_FILE, \"1\\n\"),"},{"line_number":91,"context_line":"                mock.patch.object(fakelibvirt.virConnect,"},{"line_number":92,"context_line":"                                  \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_2de9cee4","line":89,"range":{"start_line":89,"start_character":16,"end_line":89,"end_character":63},"in_reply_to":"bfb3d3c7_b1367e50","updated":"2019-05-31 08:31:00.000000000","message":"You can get the mock (as shown on line 94), but only when used as a context manager rather than a decorator, and using it as a context manager within setUp would force the context to end within setUp, which isn\u0027t what we need.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        sev_features \u003d \\"},{"line_number":87,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":88,"context_line":"        with test.nested("},{"line_number":89,"context_line":"                self.patch_exists(SEV_KERNEL_PARAM_FILE, True),"},{"line_number":90,"context_line":"                self.patch_open(SEV_KERNEL_PARAM_FILE, \"1\\n\"),"},{"line_number":91,"context_line":"                mock.patch.object(fakelibvirt.virConnect,"},{"line_number":92,"context_line":"                                  \u0027_domain_capability_features\u0027,"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_3995a633","line":89,"range":{"start_line":89,"start_character":16,"end_line":89,"end_character":63},"in_reply_to":"bfb3d3c7_f5015806","updated":"2019-05-30 10:42:55.000000000","message":"As explained above, I can\u0027t think how this would work - am I missing something?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        # libvirtd upgrade)."},{"line_number":86,"context_line":"        sev_features \u003d \\"},{"line_number":87,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":88,"context_line":"        with test.nested("},{"line_number":89,"context_line":"                self.patch_exists(SEV_KERNEL_PARAM_FILE, True),"},{"line_number":90,"context_line":"                self.patch_open(SEV_KERNEL_PARAM_FILE, \"1\\n\"),"},{"line_number":91,"context_line":"                mock.patch.object(fakelibvirt.virConnect,"},{"line_number":92,"context_line":"                                  \u0027_domain_capability_features\u0027,"},{"line_number":93,"context_line":"                                  new\u003dsev_features)"},{"line_number":94,"context_line":"        ) as (mock_exists, mock_open, mock_features):"},{"line_number":95,"context_line":"            # Now when we re-init the compute service, the driver\u0027s"},{"line_number":96,"context_line":"            # init_host() should discover that the SEV capability has"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_1220c2ab","line":93,"range":{"start_line":88,"start_character":0,"end_line":93,"end_character":51},"updated":"2019-05-29 23:04:47.000000000","message":"yes, nice deep test here, ++","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        # libvirtd upgrade)."},{"line_number":86,"context_line":"        sev_features \u003d \\"},{"line_number":87,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":88,"context_line":"        with test.nested("},{"line_number":89,"context_line":"                self.patch_exists(SEV_KERNEL_PARAM_FILE, True),"},{"line_number":90,"context_line":"                self.patch_open(SEV_KERNEL_PARAM_FILE, \"1\\n\"),"},{"line_number":91,"context_line":"                mock.patch.object(fakelibvirt.virConnect,"},{"line_number":92,"context_line":"                                  \u0027_domain_capability_features\u0027,"},{"line_number":93,"context_line":"                                  new\u003dsev_features)"},{"line_number":94,"context_line":"        ) as (mock_exists, mock_open, mock_features):"},{"line_number":95,"context_line":"            # Now when we re-init the compute service, the driver\u0027s"},{"line_number":96,"context_line":"            # init_host() should discover that the SEV capability has"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_39d84679","line":93,"range":{"start_line":88,"start_character":0,"end_line":93,"end_character":51},"in_reply_to":"bfb3d3c7_1220c2ab","updated":"2019-05-30 10:42:55.000000000","message":"The on -\u003e off equivalent of this test in the preceding class  actually found and forced me to fix a quite obscure bug in my logic.  So testing is actually worth it - who\u0027d have thought?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"            # However it won\u0027t disappear in the provider tree and get synced"},{"line_number":103,"context_line":"            # back to placement until we force a reinventory:"},{"line_number":104,"context_line":"            # placement."},{"line_number":105,"context_line":"            self.compute.manager.reset()"},{"line_number":106,"context_line":"            self._run_periodics()"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_52287a95","line":104,"range":{"start_line":104,"start_character":12,"end_line":104,"end_character":24},"updated":"2019-05-29 23:04:47.000000000","message":"extraneous","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"            # However it won\u0027t disappear in the provider tree and get synced"},{"line_number":103,"context_line":"            # back to placement until we force a reinventory:"},{"line_number":104,"context_line":"            # placement."},{"line_number":105,"context_line":"            self.compute.manager.reset()"},{"line_number":106,"context_line":"            self._run_periodics()"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_99a5b2a4","line":104,"range":{"start_line":104,"start_character":12,"end_line":104,"end_character":24},"in_reply_to":"bfb3d3c7_52287a95","updated":"2019-05-30 10:42:55.000000000","message":"Done","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"            # Sanity check that we\u0027ve still got the trait globally."},{"line_number":157,"context_line":"            global_traits \u003d self._get_all_traits()"},{"line_number":158,"context_line":"            self.assertIn(sev_trait, global_traits)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_72101e58","line":158,"updated":"2019-05-29 23:04:47.000000000","message":"This is cool. You could combine the two tests into one, though.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"            # Sanity check that we\u0027ve still got the trait globally."},{"line_number":157,"context_line":"            global_traits \u003d self._get_all_traits()"},{"line_number":158,"context_line":"            self.assertIn(sev_trait, global_traits)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_79a6bead","line":158,"in_reply_to":"bfb3d3c7_72101e58","updated":"2019-05-30 10:42:55.000000000","message":"Do you mean combine the two *lines* into one?  I\u0027ve done that, but if you mean something else, I\u0027m not sure what.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5102b798e3c1cb885883d9e4de2e5d209d7a6d54","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"            # Sanity check that we\u0027ve still got the trait globally."},{"line_number":157,"context_line":"            global_traits \u003d self._get_all_traits()"},{"line_number":158,"context_line":"            self.assertIn(sev_trait, global_traits)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_d11692a8","line":158,"in_reply_to":"bfb3d3c7_79a6bead","updated":"2019-05-30 22:26:00.000000000","message":"I mean combine LibvirtReportNoSevTraitsTests.test_sev_trait_off_on and LibvirtReportSevTraitsTests.test_sev_trait_on_off into one class and one functional test.\n\nNo big deal, though.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"e4fa19b751f2a8a095055d39638465c8554da35c","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"            # Sanity check that we\u0027ve still got the trait globally."},{"line_number":157,"context_line":"            global_traits \u003d self._get_all_traits()"},{"line_number":158,"context_line":"            self.assertIn(sev_trait, global_traits)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_2dd22e29","line":158,"in_reply_to":"bfb3d3c7_d11692a8","updated":"2019-05-31 08:31:00.000000000","message":"Not really, because there are two different mock environments which need to be built for when init_host() is *first* called inside setUp().  If we had a single off_on_off test then it wouldn\u0027t test init_host() being called for the first time in a \"clean\", environment which has SEV functionality mocked in. And vice-versa for on_off_on without SEV.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        Then test that if the SEV capability appears (again via"},{"line_number":75,"context_line":"        mocking), after a restart of the compute service, the trait"},{"line_number":76,"context_line":"        gets registered on the compute host."},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        sev_trait \u003d ost.HW_CPU_X86_AMD_SEV"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        global_traits \u003d self._get_all_traits()"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_f259068e","line":77,"updated":"2019-08-09 14:45:51.000000000","message":"++ (we should have these on every darn functional test)","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab7eb5fd4240d1373da1804cdea9d7bd16757089","unresolved":false,"context_lines":[{"line_number":26,"context_line":"CONF \u003d conf.CONF"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class LibvirtReportTraitsTestBase("},{"line_number":30,"context_line":"        integrated_helpers.LibvirtProviderUsageBaseTestCase):"},{"line_number":31,"context_line":"    pass"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class LibvirtReportTraitsTests(LibvirtReportTraitsTestBase):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_1066a5ee","line":31,"range":{"start_line":29,"start_character":0,"end_line":31,"end_character":8},"updated":"2019-08-16 19:16:03.000000000","message":"um, why does this need to exist?","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"1a790e25f5034c6328145a901518a4297b4efc48","unresolved":false,"context_lines":[{"line_number":26,"context_line":"CONF \u003d conf.CONF"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class LibvirtReportTraitsTestBase("},{"line_number":30,"context_line":"        integrated_helpers.LibvirtProviderUsageBaseTestCase):"},{"line_number":31,"context_line":"    pass"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class LibvirtReportTraitsTests(LibvirtReportTraitsTestBase):"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_8b882671","line":31,"range":{"start_line":29,"start_character":0,"end_line":31,"end_character":8},"in_reply_to":"7faddb67_1066a5ee","updated":"2019-08-16 20:50:00.000000000","message":"Technically it doesn\u0027t, but it was a style choice because integrated_helpers.LibvirtProviderUsageBaseTestCase is a hell of a mouthful / eyeful and big enough that I felt the DRY principle applied, especially bearing in mind that three classes below all need to inherit from the same base class.  It makes it more explicit that they\u0027re all inheriting from the same base.  Plus of course it makes it easy to share stuff between them in the future.\n\nSo, mild preference to keep it, but not a big deal either way.","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"75ba155f28e4da234a7fc3b34cf042af76b49014","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        traits \u003d self._get_provider_traits(self.host_uuid)"},{"line_number":89,"context_line":"        self.assertNotIn(sev_trait, traits)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Now simulate the host gaining SEV functionality (e.g. via a"},{"line_number":92,"context_line":"        # libvirtd upgrade)."},{"line_number":93,"context_line":"        sev_features \u003d \\"},{"line_number":94,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":95,"context_line":"        with test.nested("}],"source_content_type":"text/x-python","patch_set":46,"id":"7faddb67_f5063486","line":92,"range":{"start_line":91,"start_character":8,"end_line":92,"end_character":28},"updated":"2019-08-20 12:46:54.000000000","message":"If you want to simulate the case of libvirtd upgrade, then the sysfs should be existed and can read the value \u00271\\n\u0027, but you only fake the path_exists as False at line 65","commit_id":"1100116f8e5cb30d28b335bdd737672d0af075a0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c962ef5d2c9588426e365ab33d854aa2d2128b12","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        traits \u003d self._get_provider_traits(self.host_uuid)"},{"line_number":89,"context_line":"        self.assertNotIn(sev_trait, traits)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Now simulate the host gaining SEV functionality (e.g. via a"},{"line_number":92,"context_line":"        # libvirtd upgrade)."},{"line_number":93,"context_line":"        sev_features \u003d \\"},{"line_number":94,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":95,"context_line":"        with test.nested("}],"source_content_type":"text/x-python","patch_set":46,"id":"7faddb67_b1451e71","line":92,"range":{"start_line":91,"start_character":8,"end_line":92,"end_character":28},"in_reply_to":"7faddb67_3545acb4","updated":"2019-08-21 07:19:55.000000000","message":"I mean the code before this line is about kernel supported but libvirt doesn\u0027t. And the code after this line is about kernel supported and libvirt supported by upgrade libvirt.\n\nActually, the code before this line is about kernel doesn\u0027t support. So the libvirt upgrade doesn\u0027t fix the kernel.\n\nBut yes, I didn\u0027t see the different we test the kernel upgrade or libvirt upgrade. It is just about this comment confuse.","commit_id":"1100116f8e5cb30d28b335bdd737672d0af075a0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"de1f3e6d8d2a0151d760f2f47e2bd211cd39d408","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        traits \u003d self._get_provider_traits(self.host_uuid)"},{"line_number":89,"context_line":"        self.assertNotIn(sev_trait, traits)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Now simulate the host gaining SEV functionality (e.g. via a"},{"line_number":92,"context_line":"        # libvirtd upgrade)."},{"line_number":93,"context_line":"        sev_features \u003d \\"},{"line_number":94,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":95,"context_line":"        with test.nested("}],"source_content_type":"text/x-python","patch_set":46,"id":"7faddb67_9df27004","line":92,"range":{"start_line":91,"start_character":8,"end_line":92,"end_character":28},"in_reply_to":"7faddb67_b1451e71","updated":"2019-08-21 13:00:11.000000000","message":"Oh I see! Thanks for the explanation. Yes you are right :) Fixed now.","commit_id":"1100116f8e5cb30d28b335bdd737672d0af075a0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"ffd2194f18025beb6e56e73fd5b4f663b0d872e5","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        traits \u003d self._get_provider_traits(self.host_uuid)"},{"line_number":89,"context_line":"        self.assertNotIn(sev_trait, traits)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Now simulate the host gaining SEV functionality (e.g. via a"},{"line_number":92,"context_line":"        # libvirtd upgrade)."},{"line_number":93,"context_line":"        sev_features \u003d \\"},{"line_number":94,"context_line":"            fakelibvirt.virConnect._domain_capability_features_with_SEV"},{"line_number":95,"context_line":"        with test.nested("}],"source_content_type":"text/x-python","patch_set":46,"id":"7faddb67_3545acb4","line":92,"range":{"start_line":91,"start_character":8,"end_line":92,"end_character":28},"in_reply_to":"7faddb67_f5063486","updated":"2019-08-20 12:49:56.000000000","message":"No, the test.nested(...) below takes care of that.  Line 65 only patches setUp() so it does not apply to the code in this test method (but even if it did, the test.nested(...) would override it).","commit_id":"1100116f8e5cb30d28b335bdd737672d0af075a0"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ff209f663141524a6b47b413619061a17c38aef1","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import os_traits as ost"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from nova import conf"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_5d269ccd","line":17,"updated":"2019-08-30 09:32:03.000000000","message":"nit: drop (mock is third party like os_traits)","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"9bae205cbde98f2ff010014e6a14821730b2a748","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import os_traits as ost"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from nova import conf"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_d6b7c984","line":17,"in_reply_to":"7faddb67_5d269ccd","updated":"2019-08-30 12:29:59.000000000","message":"Heh, I don\u0027t think of os_trait as third party (more like 2.5-party ;-) but OK.  Could do in a follow-up since this will be in the gate shortly.","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"68039a54f1374d01d0c720569e134de310314398","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import os_traits as ost"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from nova import conf"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_5ae1accf","line":17,"in_reply_to":"7faddb67_d6b7c984","updated":"2019-09-01 14:00:14.000000000","message":"Done in https://review.opendev.org/#/c/679568/","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ff209f663141524a6b47b413619061a17c38aef1","unresolved":false,"context_lines":[{"line_number":62,"context_line":"class LibvirtReportNoSevTraitsTests(LibvirtReportTraitsTestBase):"},{"line_number":63,"context_line":"    STUB_INIT_HOST \u003d False"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @test.patch_exists(SEV_KERNEL_PARAM_FILE, False)"},{"line_number":66,"context_line":"    def setUp(self):"},{"line_number":67,"context_line":"        super(LibvirtReportNoSevTraitsTests, self).setUp()"},{"line_number":68,"context_line":"        self.start_compute()"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_sev_trait_off_on(self):"},{"line_number":71,"context_line":"        \"\"\"Test that the compute service reports the SEV trait in the list of"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_c09fffb0","line":68,"range":{"start_line":65,"start_character":0,"end_line":68,"end_character":28},"updated":"2019-08-30 09:32:03.000000000","message":"style nit: If we did the \u0027start_compute\u0027 call inside the test and moved the decorator onto that class, would we be able to squash these two test classes together?","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"9bae205cbde98f2ff010014e6a14821730b2a748","unresolved":false,"context_lines":[{"line_number":62,"context_line":"class LibvirtReportNoSevTraitsTests(LibvirtReportTraitsTestBase):"},{"line_number":63,"context_line":"    STUB_INIT_HOST \u003d False"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @test.patch_exists(SEV_KERNEL_PARAM_FILE, False)"},{"line_number":66,"context_line":"    def setUp(self):"},{"line_number":67,"context_line":"        super(LibvirtReportNoSevTraitsTests, self).setUp()"},{"line_number":68,"context_line":"        self.start_compute()"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_sev_trait_off_on(self):"},{"line_number":71,"context_line":"        \"\"\"Test that the compute service reports the SEV trait in the list of"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_163561f7","line":68,"range":{"start_line":65,"start_character":0,"end_line":68,"end_character":28},"in_reply_to":"7faddb67_c09fffb0","updated":"2019-08-30 12:29:59.000000000","message":"Yeah could do in the same follow-up as above.","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ff209f663141524a6b47b413619061a17c38aef1","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        traits \u003d self._get_provider_traits(self.host_uuid)"},{"line_number":89,"context_line":"        self.assertNotIn(sev_trait, traits)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Now simulate the host gaining SEV functionality.  Here we"},{"line_number":92,"context_line":"        # simulate a kernel update or reconfiguration which causes the"},{"line_number":93,"context_line":"        # kvm-amd kernel module\u0027s \"sev\" parameter to become available"},{"line_number":94,"context_line":"        # and set to 1, however it could also happen via a libvirt"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_40178f47","line":91,"updated":"2019-08-30 09:32:03.000000000","message":"I\u0027m pretty sure we could have just done these tests separately and made things a bit simpler. You\u0027re essentially checking the restarting a service actually results in all the startup routines being re-run, which (a) has to be the case, otherwise loads of things would break, and (b) is really a separate test to what we\u0027re doing here. Maybe a follow-up?\n\nLater: Actually, we\u0027re already testing the positive case below. I guess if it\u0027s not expensive to run we could just keep it, but it does feel like overkill","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"9bae205cbde98f2ff010014e6a14821730b2a748","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        traits \u003d self._get_provider_traits(self.host_uuid)"},{"line_number":89,"context_line":"        self.assertNotIn(sev_trait, traits)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Now simulate the host gaining SEV functionality.  Here we"},{"line_number":92,"context_line":"        # simulate a kernel update or reconfiguration which causes the"},{"line_number":93,"context_line":"        # kvm-amd kernel module\u0027s \"sev\" parameter to become available"},{"line_number":94,"context_line":"        # and set to 1, however it could also happen via a libvirt"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_b6400d61","line":91,"in_reply_to":"7faddb67_40178f47","updated":"2019-08-30 12:29:59.000000000","message":"This changed quite significantly due to your previous feedback which led to supports_amd_sev being converted to a JIT property which gets calculated on demand.  Previously IIRC this called init_host() (or something which would trigger that) instead of calling _set_amd_sev_support() directly, so the test was more functional in nature.  However it still has to test the resync with placement via .reset() and ._run_periodics() so if you\u0027re still proposing a simplification I can\u0027t currently see how that would work and would need more guidance.","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f0a8ac913c5c4e0372c47f9d3f9acc93b1384bef","unresolved":false,"context_lines":[{"line_number":22506,"context_line":"    \"\"\"Libvirt driver tests for AMD SEV support.\"\"\""},{"line_number":22507,"context_line":""},{"line_number":22508,"context_line":"    builtin_module \u003d \u0027__builtin__\u0027 \\"},{"line_number":22509,"context_line":"        if sys.version_info[0] \u003c 3 else \"builtins\""},{"line_number":22510,"context_line":""},{"line_number":22511,"context_line":"    def setUp(self):"},{"line_number":22512,"context_line":"        super(TestLibvirtSEV, self).setUp()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_46d4e147","line":22509,"updated":"2019-03-05 15:12:33.000000000","message":"instead of the above, consider doing:\n\n import six.moves\n ...\n \n @mock.patch(six.moves.builtins, \u0027open\u0027, mock.mock_open(...))\n\nfor reference:\n\nhttps://pythonhosted.org/six/#module-six.moves","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"760f335ca9693843403cdc60bcf81b00b33b768a","unresolved":false,"context_lines":[{"line_number":22506,"context_line":"    \"\"\"Libvirt driver tests for AMD SEV support.\"\"\""},{"line_number":22507,"context_line":""},{"line_number":22508,"context_line":"    builtin_module \u003d \u0027__builtin__\u0027 \\"},{"line_number":22509,"context_line":"        if sys.version_info[0] \u003c 3 else \"builtins\""},{"line_number":22510,"context_line":""},{"line_number":22511,"context_line":"    def setUp(self):"},{"line_number":22512,"context_line":"        super(TestLibvirtSEV, self).setUp()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_1cb501ef","line":22509,"in_reply_to":"9fdfeff1_46d4e147","updated":"2019-03-05 21:47:25.000000000","message":"Doh, I should have guessed this would be a thing :) And it\u0027s even already imported into this file! Fixed - thanks for the lesson :)","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f0a8ac913c5c4e0372c47f9d3f9acc93b1384bef","unresolved":false,"context_lines":[{"line_number":22513,"context_line":"        self.useFixture(fakelibvirt.FakeLibvirtFixture())"},{"line_number":22514,"context_line":"        self.driver \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":22515,"context_line":""},{"line_number":22516,"context_line":"        # For use in mocking open():"},{"line_number":22517,"context_line":""},{"line_number":22518,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dFalse)"},{"line_number":22519,"context_line":"    def test_kernel_parameter_missing(self, fake_exists):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_a647cd1e","line":22516,"updated":"2019-03-05 15:12:33.000000000","message":"I think the above was leftover from somewhere? :)","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"760f335ca9693843403cdc60bcf81b00b33b768a","unresolved":false,"context_lines":[{"line_number":22513,"context_line":"        self.useFixture(fakelibvirt.FakeLibvirtFixture())"},{"line_number":22514,"context_line":"        self.driver \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":22515,"context_line":""},{"line_number":22516,"context_line":"        # For use in mocking open():"},{"line_number":22517,"context_line":""},{"line_number":22518,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dFalse)"},{"line_number":22519,"context_line":"    def test_kernel_parameter_missing(self, fake_exists):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_bc9aad6b","line":22516,"in_reply_to":"9fdfeff1_a647cd1e","updated":"2019-03-05 21:47:25.000000000","message":"Whoops!  Yes, must have been from one of my many private rebases whilst polishing history.  Fixed.","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"feb677b7c14e2a349d3a1267a74d3cf8a3c03a3b","unresolved":false,"context_lines":[{"line_number":23163,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dTrue)"},{"line_number":23164,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"1\\n\"))"},{"line_number":23165,"context_line":"    @mock.patch.object(fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"},{"line_number":23166,"context_line":"        new\u003dfakelibvirt.virConnect._domain_capability_features_with_SEV)"},{"line_number":23167,"context_line":"    def test_unsupported_with_feature(self, fake_exists):"},{"line_number":23168,"context_line":"        self.driver._set_amd_sev_support()"},{"line_number":23169,"context_line":"        self.assertTrue(self.driver.capabilities[\u0027supports_amd_sev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_2e7a0124","line":23166,"range":{"start_line":23166,"start_character":35,"end_line":23166,"end_character":71},"updated":"2019-05-17 18:36:57.000000000","message":"should add a test using _domain_capability_features_with_SEV_unsupported (i.e. explicitly supported\u003d\u0027no\u0027) which isn\u0027t covered above.","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"09b131346a009f3bb8b29efb877a2dd7858ab2fd","unresolved":false,"context_lines":[{"line_number":23163,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dTrue)"},{"line_number":23164,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"1\\n\"))"},{"line_number":23165,"context_line":"    @mock.patch.object(fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"},{"line_number":23166,"context_line":"        new\u003dfakelibvirt.virConnect._domain_capability_features_with_SEV)"},{"line_number":23167,"context_line":"    def test_unsupported_with_feature(self, fake_exists):"},{"line_number":23168,"context_line":"        self.driver._set_amd_sev_support()"},{"line_number":23169,"context_line":"        self.assertTrue(self.driver.capabilities[\u0027supports_amd_sev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_4e1fbcb6","line":23166,"range":{"start_line":23166,"start_character":35,"end_line":23166,"end_character":71},"in_reply_to":"bfb3d3c7_2e7a0124","updated":"2019-05-24 19:04:48.000000000","message":"Done","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"feb677b7c14e2a349d3a1267a74d3cf8a3c03a3b","unresolved":false,"context_lines":[{"line_number":23164,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"1\\n\"))"},{"line_number":23165,"context_line":"    @mock.patch.object(fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"},{"line_number":23166,"context_line":"        new\u003dfakelibvirt.virConnect._domain_capability_features_with_SEV)"},{"line_number":23167,"context_line":"    def test_unsupported_with_feature(self, fake_exists):"},{"line_number":23168,"context_line":"        self.driver._set_amd_sev_support()"},{"line_number":23169,"context_line":"        self.assertTrue(self.driver.capabilities[\u0027supports_amd_sev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_ce9d6567","line":23167,"range":{"start_line":23167,"start_character":13,"end_line":23167,"end_character":24},"updated":"2019-05-17 18:36:57.000000000","message":"supported","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"09b131346a009f3bb8b29efb877a2dd7858ab2fd","unresolved":false,"context_lines":[{"line_number":23164,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"1\\n\"))"},{"line_number":23165,"context_line":"    @mock.patch.object(fakelibvirt.virConnect, \u0027_domain_capability_features\u0027,"},{"line_number":23166,"context_line":"        new\u003dfakelibvirt.virConnect._domain_capability_features_with_SEV)"},{"line_number":23167,"context_line":"    def test_unsupported_with_feature(self, fake_exists):"},{"line_number":23168,"context_line":"        self.driver._set_amd_sev_support()"},{"line_number":23169,"context_line":"        self.assertTrue(self.driver.capabilities[\u0027supports_amd_sev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_0e7b04f5","line":23167,"range":{"start_line":23167,"start_character":13,"end_line":23167,"end_character":24},"in_reply_to":"bfb3d3c7_ce9d6567","updated":"2019-05-24 19:04:48.000000000","message":"Done","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":23118,"context_line":"        self.useFixture(fakelibvirt.FakeLibvirtFixture())"},{"line_number":23119,"context_line":"        self.driver \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":23120,"context_line":""},{"line_number":23121,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dFalse)"},{"line_number":23122,"context_line":"    def test_kernel_parameter_missing(self, fake_exists):"},{"line_number":23123,"context_line":"        self.assertFalse(self.driver._kernel_supports_amd_sev())"},{"line_number":23124,"context_line":"        fake_exists.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_95101c50","line":23121,"range":{"start_line":23121,"start_character":4,"end_line":23121,"end_character":61},"updated":"2019-05-29 23:04:47.000000000","message":"use patch_exists here \u0026 throughout?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":23118,"context_line":"        self.useFixture(fakelibvirt.FakeLibvirtFixture())"},{"line_number":23119,"context_line":"        self.driver \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":23120,"context_line":""},{"line_number":23121,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dFalse)"},{"line_number":23122,"context_line":"    def test_kernel_parameter_missing(self, fake_exists):"},{"line_number":23123,"context_line":"        self.assertFalse(self.driver._kernel_supports_amd_sev())"},{"line_number":23124,"context_line":"        fake_exists.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_79bf9ea9","line":23121,"range":{"start_line":23121,"start_character":4,"end_line":23121,"end_character":61},"in_reply_to":"bfb3d3c7_95101c50","updated":"2019-05-30 10:42:55.000000000","message":"Then I wouldn\u0027t have the mock object to call assert_called_once_with() on, unless I switched away from the decorator form, and I don\u0027t think that gains anything.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":23125,"context_line":"            \u0027/sys/module/kvm_amd/parameters/sev\u0027)"},{"line_number":23126,"context_line":""},{"line_number":23127,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dTrue)"},{"line_number":23128,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"0\\n\"))"},{"line_number":23129,"context_line":"    def test_kernel_parameter_zero(self, fake_exists):"},{"line_number":23130,"context_line":"        self.assertFalse(self.driver._kernel_supports_amd_sev())"},{"line_number":23131,"context_line":"        fake_exists.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_351b7073","line":23128,"range":{"start_line":23128,"start_character":4,"end_line":23128,"end_character":73},"updated":"2019-05-29 23:04:47.000000000","message":"...and patch_open?\n\n...or are you avoiding them because they don\u0027t need to be conditional on the path?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":23125,"context_line":"            \u0027/sys/module/kvm_amd/parameters/sev\u0027)"},{"line_number":23126,"context_line":""},{"line_number":23127,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dTrue)"},{"line_number":23128,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"0\\n\"))"},{"line_number":23129,"context_line":"    def test_kernel_parameter_zero(self, fake_exists):"},{"line_number":23130,"context_line":"        self.assertFalse(self.driver._kernel_supports_amd_sev())"},{"line_number":23131,"context_line":"        fake_exists.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_39e366db","line":23128,"range":{"start_line":23128,"start_character":4,"end_line":23128,"end_character":73},"in_reply_to":"bfb3d3c7_351b7073","updated":"2019-05-30 10:42:55.000000000","message":"Yes exactly - these are unit tests, so I can be sure that nothing else in the code path calls exists or open.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":23138,"context_line":"        fake_exists.assert_called_once_with("},{"line_number":23139,"context_line":"            \u0027/sys/module/kvm_amd/parameters/sev\u0027)"},{"line_number":23140,"context_line":""},{"line_number":23141,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dTrue)"},{"line_number":23142,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"1\\n\"))"},{"line_number":23143,"context_line":"    def test_unsupported_without_feature(self, fake_exists):"},{"line_number":23144,"context_line":"        self.driver._set_amd_sev_support()"},{"line_number":23145,"context_line":"        self.assertFalse(self.driver.supports_amd_sev)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_1553cc18","line":23142,"range":{"start_line":23141,"start_character":0,"end_line":23142,"end_character":73},"updated":"2019-05-29 23:04:47.000000000","message":"nit: you could mock these at setUp, saving the mocks as instance vars so you can override the return_value/side_effect in the couple of places you need to.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":23138,"context_line":"        fake_exists.assert_called_once_with("},{"line_number":23139,"context_line":"            \u0027/sys/module/kvm_amd/parameters/sev\u0027)"},{"line_number":23140,"context_line":""},{"line_number":23141,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027, return_value\u003dTrue)"},{"line_number":23142,"context_line":"    @mock.patch.object(builtins, \u0027open\u0027, mock.mock_open(read_data\u003d\"1\\n\"))"},{"line_number":23143,"context_line":"    def test_unsupported_without_feature(self, fake_exists):"},{"line_number":23144,"context_line":"        self.driver._set_amd_sev_support()"},{"line_number":23145,"context_line":"        self.assertFalse(self.driver.supports_amd_sev)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_f9362e51","line":23142,"range":{"start_line":23141,"start_character":0,"end_line":23142,"end_character":73},"in_reply_to":"bfb3d3c7_1553cc18","updated":"2019-05-30 10:42:55.000000000","message":"Wouldn\u0027t that just increase the delta LoC and marginally reduce legibility?  And I\u0027m struggling to see the gain, but maybe I\u0027m missing something?  I\u0027d still need a line per mock per test - the only difference would be that it would be setting the return_value/side_effect on mocks whose setup is divorced from the code of the test case, requiring readers to scroll up to setUp() before they can understand how the mocks are set up?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ff209f663141524a6b47b413619061a17c38aef1","unresolved":false,"context_lines":[{"line_number":21762,"context_line":"    def test_cpu_traits_sev_no_feature_traits(self):"},{"line_number":21763,"context_line":"        for support in (False, True):"},{"line_number":21764,"context_line":"            self.drvr._host._supports_amd_sev \u003d support"},{"line_number":21765,"context_line":"        self.assertEqual({ot.HW_CPU_X86_AMD_SEV: support},"},{"line_number":21766,"context_line":"                         self.drvr._get_cpu_traits())"},{"line_number":21767,"context_line":""},{"line_number":21768,"context_line":"    def test_cpu_traits_with_passthrough_mode(self):"},{"line_number":21769,"context_line":"        \"\"\"Test getting CPU traits when cpu_mmode is \u0027host-passthrough\u0027, traits"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_a0c1a382","line":21766,"range":{"start_line":21765,"start_character":0,"end_line":21766,"end_character":53},"updated":"2019-08-30 09:32:03.000000000","message":"This needs to be indented, right?","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"9bae205cbde98f2ff010014e6a14821730b2a748","unresolved":false,"context_lines":[{"line_number":21762,"context_line":"    def test_cpu_traits_sev_no_feature_traits(self):"},{"line_number":21763,"context_line":"        for support in (False, True):"},{"line_number":21764,"context_line":"            self.drvr._host._supports_amd_sev \u003d support"},{"line_number":21765,"context_line":"        self.assertEqual({ot.HW_CPU_X86_AMD_SEV: support},"},{"line_number":21766,"context_line":"                         self.drvr._get_cpu_traits())"},{"line_number":21767,"context_line":""},{"line_number":21768,"context_line":"    def test_cpu_traits_with_passthrough_mode(self):"},{"line_number":21769,"context_line":"        \"\"\"Test getting CPU traits when cpu_mmode is \u0027host-passthrough\u0027, traits"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_b6356df8","line":21766,"range":{"start_line":21765,"start_character":0,"end_line":21766,"end_character":53},"in_reply_to":"7faddb67_00b757da","updated":"2019-08-30 12:29:59.000000000","message":"Thanks.","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1fcee35bdd72f3a5fa19cb83d4adb4f90f72931b","unresolved":false,"context_lines":[{"line_number":21762,"context_line":"    def test_cpu_traits_sev_no_feature_traits(self):"},{"line_number":21763,"context_line":"        for support in (False, True):"},{"line_number":21764,"context_line":"            self.drvr._host._supports_amd_sev \u003d support"},{"line_number":21765,"context_line":"        self.assertEqual({ot.HW_CPU_X86_AMD_SEV: support},"},{"line_number":21766,"context_line":"                         self.drvr._get_cpu_traits())"},{"line_number":21767,"context_line":""},{"line_number":21768,"context_line":"    def test_cpu_traits_with_passthrough_mode(self):"},{"line_number":21769,"context_line":"        \"\"\"Test getting CPU traits when cpu_mmode is \u0027host-passthrough\u0027, traits"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_00b757da","line":21766,"range":{"start_line":21765,"start_character":0,"end_line":21766,"end_character":53},"in_reply_to":"7faddb67_a0c1a382","updated":"2019-08-30 09:37:13.000000000","message":"Yeah, I think it does. Will fix","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"}],"nova/virt/driver.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f0a8ac913c5c4e0372c47f9d3f9acc93b1384bef","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    # Added in os-traits 0.8.0."},{"line_number":112,"context_line":"    \"supports_trusted_certs\": os_traits.COMPUTE_TRUSTED_CERTS,"},{"line_number":113,"context_line":"    # Added in os-traits 0.11.0."},{"line_number":114,"context_line":"    \"supports_amd_sev\": os_traits.HW_CPU_AMD_SEV"},{"line_number":115,"context_line":"}"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_a6702d75","line":114,"updated":"2019-03-05 15:12:33.000000000","message":"✔","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"da3e88e882f3a2f7641b1158d8e6b3fec55a01bc","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    # Added in os-traits 0.8.0."},{"line_number":112,"context_line":"    \"supports_trusted_certs\": os_traits.COMPUTE_TRUSTED_CERTS,"},{"line_number":113,"context_line":"    # Added in os-traits 0.11.0."},{"line_number":114,"context_line":"    \"supports_amd_sev\": os_traits.HW_CPU_AMD_SEV"},{"line_number":115,"context_line":"}"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ffb9cba7_c196213f","line":114,"updated":"2019-04-27 16:55:00.000000000","message":"just a little top tip: if you leave a trailing comma on all list and dict items, then the next time you add an item, the patch will only contain additional lines of code instead of changing the last line in the list to add a trailing comma.","commit_id":"64cd38e698eed24aa563f2aa1b307138eb62e845"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"da3e88e882f3a2f7641b1158d8e6b3fec55a01bc","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"supports_extend_volume\": False,"},{"line_number":161,"context_line":"        \"supports_multiattach\": False,"},{"line_number":162,"context_line":"        \"supports_trusted_certs\": False,"},{"line_number":163,"context_line":"        \"supports_amd_sev\": False,"},{"line_number":164,"context_line":"    }"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    # Indicates if this driver will rebalance nodes among compute service"}],"source_content_type":"text/x-python","patch_set":10,"id":"ffb9cba7_e19b2563","line":163,"updated":"2019-04-27 16:55:00.000000000","message":"like you did, appropriately, here :)","commit_id":"64cd38e698eed24aa563f2aa1b307138eb62e845"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"67ec9b2a6333098084132d34d24eafea21215f19","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"supports_extend_volume\": False,"},{"line_number":161,"context_line":"        \"supports_multiattach\": False,"},{"line_number":162,"context_line":"        \"supports_trusted_certs\": False,"},{"line_number":163,"context_line":"        \"supports_amd_sev\": False,"},{"line_number":164,"context_line":"    }"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    # Indicates if this driver will rebalance nodes among compute service"}],"source_content_type":"text/x-python","patch_set":10,"id":"ffb9cba7_a4269b14","line":163,"in_reply_to":"ffb9cba7_e19b2563","updated":"2019-04-27 22:01:04.000000000","message":"Haha yeah, I always do that in my own code, but these two cases weren\u0027t consistent with each other before I touched them, so I chickened out of making a decision and instead just followed suit with each one individually ;-)","commit_id":"64cd38e698eed24aa563f2aa1b307138eb62e845"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"feb677b7c14e2a349d3a1267a74d3cf8a3c03a3b","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    # Added in os-traits 0.8.0."},{"line_number":112,"context_line":"    \"supports_trusted_certs\": os_traits.COMPUTE_TRUSTED_CERTS,"},{"line_number":113,"context_line":"    # Added in os-traits 0.11.0."},{"line_number":114,"context_line":"    \"supports_amd_sev\": os_traits.HW_CPU_AMD_SEV,"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    # Image type support flags, added in os-traits 0.12.0"},{"line_number":117,"context_line":"    \"supports_image_type_aki\": os_traits.COMPUTE_IMAGE_TYPE_AKI,"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_ce47a5bc","line":114,"range":{"start_line":114,"start_character":4,"end_line":114,"end_character":49},"updated":"2019-05-17 18:36:57.000000000","message":"This should not be added to the general virt driver capabilities dict. It can be added explicitly by the libvirt driver in update_provider_tree at the same time it figures out that it needs to inventory MEM_ENCRYPTION_CONTEXT.\n\nIf we\u0027re going to make this a general virt driver capability, it absolutely needs to be a (new) generic trait, like COMPUTE_MEM_ENCRYPTION. But I don\u0027t think we should bother with that right now.","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"09b131346a009f3bb8b29efb877a2dd7858ab2fd","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    # Added in os-traits 0.8.0."},{"line_number":112,"context_line":"    \"supports_trusted_certs\": os_traits.COMPUTE_TRUSTED_CERTS,"},{"line_number":113,"context_line":"    # Added in os-traits 0.11.0."},{"line_number":114,"context_line":"    \"supports_amd_sev\": os_traits.HW_CPU_AMD_SEV,"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    # Image type support flags, added in os-traits 0.12.0"},{"line_number":117,"context_line":"    \"supports_image_type_aki\": os_traits.COMPUTE_IMAGE_TYPE_AKI,"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_ce808cc2","line":114,"range":{"start_line":114,"start_character":4,"end_line":114,"end_character":49},"in_reply_to":"bfb3d3c7_ce47a5bc","updated":"2019-05-24 19:04:48.000000000","message":"Done","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8c59bd47a664b6b430b30321d453b8f11f2ff55f","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":628,"context_line":"        for feature in domain_caps.features:"},{"line_number":629,"context_line":"            if (isinstance(feature, vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":630,"context_line":"                and feature.supported):"},{"line_number":631,"context_line":"                self.capabilities[\u0027supports_amd_sev\u0027] \u003d True"},{"line_number":632,"context_line":"                return"},{"line_number":633,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_d53cbee2","line":630,"range":{"start_line":630,"start_character":20,"end_line":630,"end_character":27},"updated":"2019-02-23 10:39:23.000000000","message":"Nit: indent this line more.","commit_id":"5ae27c7206893822f1996893208e177395dfab16"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f9ab2f88b0d48e9b7ab7b7945ad1e127bca5b4aa","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":628,"context_line":"        for feature in domain_caps.features:"},{"line_number":629,"context_line":"            if (isinstance(feature, vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":630,"context_line":"                and feature.supported):"},{"line_number":631,"context_line":"                self.capabilities[\u0027supports_amd_sev\u0027] \u003d True"},{"line_number":632,"context_line":"                return"},{"line_number":633,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_b7cf9e7d","line":630,"range":{"start_line":630,"start_character":20,"end_line":630,"end_character":27},"in_reply_to":"9fdfeff1_c23b94e7","updated":"2019-02-25 23:03:35.000000000","message":"It does. We ignore that one and a bunch of other whitespace rules [1]. I would personally be in favor of reinstating some of those, but we\u0027ve been ignoring them long enough that that would likely be a nightmarish refactor for very little gain.\n\n[1] https://github.com/openstack/nova/blob/c7f0d160e4df95cc82706bcd8c4a9890a4dfeb51/tox.ini#L241-L255","commit_id":"5ae27c7206893822f1996893208e177395dfab16"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"a4db5d252d2416e2eaaef3446c98d5d6b4972a06","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":628,"context_line":"        for feature in domain_caps.features:"},{"line_number":629,"context_line":"            if (isinstance(feature, vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":630,"context_line":"                and feature.supported):"},{"line_number":631,"context_line":"                self.capabilities[\u0027supports_amd_sev\u0027] \u003d True"},{"line_number":632,"context_line":"                return"},{"line_number":633,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_c23b94e7","line":630,"range":{"start_line":630,"start_character":20,"end_line":630,"end_character":27},"in_reply_to":"9fdfeff1_d53cbee2","updated":"2019-02-25 11:11:49.000000000","message":"Done.  Maybe pep8/flake8 should catch these?","commit_id":"5ae27c7206893822f1996893208e177395dfab16"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"961475abea59335638261785795bf4d0b930cee5","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        return False"},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":622,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":623,"context_line":"        # supported."},{"line_number":624,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":625,"context_line":"            return"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":628,"context_line":"        for feature in domain_caps.features:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_44ad5082","line":625,"range":{"start_line":622,"start_character":5,"end_line":625,"end_character":18},"updated":"2019-02-26 15:42:33.000000000","message":"is this needed if we have the libvirt check?  (i.e. will libvirt say it\u0027s supported if the host kernel can\u0027t do it?)","commit_id":"26d003d51e5913d261e562ee88e24b7527b2f42c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"72b54ef17b04bc67dd540bdeefa2e2ebf7743f88","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        return False"},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":622,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":623,"context_line":"        # supported."},{"line_number":624,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":625,"context_line":"            return"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":628,"context_line":"        for feature in domain_caps.features:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_4f5f4d4d","line":625,"range":{"start_line":622,"start_character":5,"end_line":625,"end_character":18},"in_reply_to":"9fdfeff1_10277e14","updated":"2019-03-01 20:14:06.000000000","message":"I can now confirm it is needed:\n\ndella5s17:/opt/stack/nova # cat /sys/module/kvm_amd/parameters/sev\n0\ndella5s17:/opt/stack/nova # virsh domcapabilities --virttype kvm --emulatorbin /usr/bin/qemu-kvm --arch x86_64 --machine q35 | xq /domainCapabilities/features/sev/@supported\n\u003cresults\u003e\n  \u003cresult\u003eyes\u003c/result\u003e\n\u003c/results\u003e","commit_id":"26d003d51e5913d261e562ee88e24b7527b2f42c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"8c7fff049a3a608258ac42aa62b002c30238523a","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        return False"},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":622,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":623,"context_line":"        # supported."},{"line_number":624,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":625,"context_line":"            return"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":628,"context_line":"        for feature in domain_caps.features:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_10277e14","line":625,"range":{"start_line":622,"start_character":5,"end_line":625,"end_character":18},"in_reply_to":"9fdfeff1_44ad5082","updated":"2019-02-26 18:49:40.000000000","message":"This is the advice I\u0027ve been given by the SEV experts, yes.  We had quite in-depth discussion about the right way to check, and https://specs.openstack.org/openstack/nova-specs/specs/stein/approved/amd-sev-libvirt-support.html#proposed-change was the result.  Having said that, all SEV code is relatively new so even experts can be wrong :-)  If I get a chance I\u0027ll try disabling the kernel module option on our SEV hardware and see if it affects libvirt.","commit_id":"26d003d51e5913d261e562ee88e24b7527b2f42c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f0a8ac913c5c4e0372c47f9d3f9acc93b1384bef","unresolved":false,"context_lines":[{"line_number":613,"context_line":"                      \u00272.10 or libvirt must be greater than or equal to 3.10.\u0027)"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"    def _kernel_supports_amd_sev(self):"},{"line_number":616,"context_line":"        param_file \u003d \u0027/sys/module/kvm_amd/parameters/sev\u0027"},{"line_number":617,"context_line":"        if os.path.exists(param_file):"},{"line_number":618,"context_line":"            with open(param_file) as f:"},{"line_number":619,"context_line":"                if f.read() \u003d\u003d \"1\\n\":"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_66ffa5ab","line":616,"updated":"2019-03-05 15:12:33.000000000","message":"femtonit: consider making this a constant at the top of this file.","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"760f335ca9693843403cdc60bcf81b00b33b768a","unresolved":false,"context_lines":[{"line_number":613,"context_line":"                      \u00272.10 or libvirt must be greater than or equal to 3.10.\u0027)"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"    def _kernel_supports_amd_sev(self):"},{"line_number":616,"context_line":"        param_file \u003d \u0027/sys/module/kvm_amd/parameters/sev\u0027"},{"line_number":617,"context_line":"        if os.path.exists(param_file):"},{"line_number":618,"context_line":"            with open(param_file) as f:"},{"line_number":619,"context_line":"                if f.read() \u003d\u003d \"1\\n\":"}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_5c8e2928","line":616,"in_reply_to":"9fdfeff1_66ffa5ab","updated":"2019-03-05 21:47:25.000000000","message":"I\u0027d say it\u0027s closer to a nanonit ;-) Nice idea - done.","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f0a8ac913c5c4e0372c47f9d3f9acc93b1384bef","unresolved":false,"context_lines":[{"line_number":631,"context_line":"            if (isinstance(feature, vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":632,"context_line":"                 and feature.supported):"},{"line_number":633,"context_line":"                self.capabilities[\u0027supports_amd_sev\u0027] \u003d True"},{"line_number":634,"context_line":"                return"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"    def _check_file_backed_memory_support(self):"},{"line_number":637,"context_line":"        if CONF.libvirt.file_backed_memory:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_66732518","line":634,"updated":"2019-03-05 15:12:33.000000000","message":"✔","commit_id":"5d07bb0e9d26a597d71a8ba0a57bcf9ce11909b0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"feb677b7c14e2a349d3a1267a74d3cf8a3c03a3b","unresolved":false,"context_lines":[{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def _kernel_supports_amd_sev(self):"},{"line_number":666,"context_line":"        if os.path.exists(SEV_KERNEL_PARAM_FILE):"},{"line_number":667,"context_line":"            with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":668,"context_line":"                if f.read() \u003d\u003d \"1\\n\":"},{"line_number":669,"context_line":"                    return True"},{"line_number":670,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_0ee61d18","line":667,"updated":"2019-05-17 18:36:57.000000000","message":"does this need to be privsep-y?","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"09b131346a009f3bb8b29efb877a2dd7858ab2fd","unresolved":false,"context_lines":[{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def _kernel_supports_amd_sev(self):"},{"line_number":666,"context_line":"        if os.path.exists(SEV_KERNEL_PARAM_FILE):"},{"line_number":667,"context_line":"            with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":668,"context_line":"                if f.read() \u003d\u003d \"1\\n\":"},{"line_number":669,"context_line":"                    return True"},{"line_number":670,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":11,"id":"bfb3d3c7_ee8550d0","line":667,"in_reply_to":"bfb3d3c7_0ee61d18","updated":"2019-05-24 19:04:48.000000000","message":"No because it\u0027s globally readable.","commit_id":"b121ec70767771c864acda6593ddaa4bb1cdbdc7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":682,"context_line":"            LOG.debug(\"%s does not exist\", SEV_KERNEL_PARAM_FILE)"},{"line_number":683,"context_line":"            return False"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":686,"context_line":"            contents \u003d f.read()"},{"line_number":687,"context_line":"            LOG.debug(\"%s contains [%s]\", SEV_KERNEL_PARAM_FILE, contents)"},{"line_number":688,"context_line":"            return contents \u003d\u003d \"1\\n\""},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":691,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_756c88cd","line":688,"range":{"start_line":685,"start_character":0,"end_line":688,"end_character":36},"updated":"2019-05-29 23:04:47.000000000","message":"Any need to trap OSError here?","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        # supported."},{"line_number":693,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":694,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":695,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":696,"context_line":"            return"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_d5a6940f","line":695,"range":{"start_line":695,"start_character":12,"end_line":695,"end_character":41},"updated":"2019-05-29 23:04:47.000000000","message":"This is redundant, unless you plan to call this method from somewhere other than init_host. If you want to keep it, consider adding a comment. Maybe like, \"This is redundant, but preserved in case this method is ever called from somewhere other than init_host.\"","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5102b798e3c1cb885883d9e4de2e5d209d7a6d54","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        # supported."},{"line_number":693,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":694,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":695,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":696,"context_line":"            return"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_11e3caa5","line":695,"range":{"start_line":695,"start_character":12,"end_line":695,"end_character":41},"in_reply_to":"bfb3d3c7_996ff229","updated":"2019-05-30 22:26:00.000000000","message":"Well, if you decide it is redundant except for test, you could always set it to False in your test.\n\nBut I\u0027m unsure enough about the SIGHUP thing (assuming that ever gets fixed) that I\u0027m fine leaving it here.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        # supported."},{"line_number":693,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":694,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":695,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":696,"context_line":"            return"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_996ff229","line":695,"range":{"start_line":695,"start_character":12,"end_line":695,"end_character":41},"in_reply_to":"bfb3d3c7_d5a6940f","updated":"2019-05-30 10:42:55.000000000","message":"Actually, it isn\u0027t redundant - it\u0027s the fix for the obscure bug I previously mentioned that I discovered by writing the on -\u003e off test.  The test re-invokes init_host() to make the SEV functionality vanish (as recommended by dansmith[0]), so this needs to be explicitly set back from True to False.  Having said that, I\u0027m glad you raised this, because it just occurred to me that in the real world outside testing environments, maybe this *is* redundant if even a SIGHUP of the service wouldn\u0027t re-trigger init_host(), meaning that the only way the SEV functionality can vanish is restarting the service?\n\nBut even if so, this is needed for the tests to pass.  If you can suggest a better way to handle this, I\u0027m all ears.\n\n[0] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-05-24.log.html#t2019-05-24T17:15:46","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":703,"context_line":"                for feature in domain_caps[arch][machine_type].features:"},{"line_number":704,"context_line":"                    if (isinstance(feature,"},{"line_number":705,"context_line":"                                   vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":706,"context_line":"                         and feature.supported):"},{"line_number":707,"context_line":"                        LOG.info(\"AMD SEV support detected\")"},{"line_number":708,"context_line":"                        self.supports_amd_sev \u003d True"},{"line_number":709,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_35b7f03c","line":706,"range":{"start_line":706,"start_character":24,"end_line":706,"end_character":25},"updated":"2019-05-29 23:04:47.000000000","message":"nit: this indent is a little weak, consider adding three spaces.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":703,"context_line":"                for feature in domain_caps[arch][machine_type].features:"},{"line_number":704,"context_line":"                    if (isinstance(feature,"},{"line_number":705,"context_line":"                                   vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":706,"context_line":"                         and feature.supported):"},{"line_number":707,"context_line":"                        LOG.info(\"AMD SEV support detected\")"},{"line_number":708,"context_line":"                        self.supports_amd_sev \u003d True"},{"line_number":709,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_79f79e5a","line":706,"range":{"start_line":706,"start_character":24,"end_line":706,"end_character":25},"in_reply_to":"bfb3d3c7_35b7f03c","updated":"2019-05-30 10:42:55.000000000","message":"Done.  Looks like a blind spot in flake8/pep8.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5102b798e3c1cb885883d9e4de2e5d209d7a6d54","unresolved":false,"context_lines":[{"line_number":703,"context_line":"                for feature in domain_caps[arch][machine_type].features:"},{"line_number":704,"context_line":"                    if (isinstance(feature,"},{"line_number":705,"context_line":"                                   vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":706,"context_line":"                         and feature.supported):"},{"line_number":707,"context_line":"                        LOG.info(\"AMD SEV support detected\")"},{"line_number":708,"context_line":"                        self.supports_amd_sev \u003d True"},{"line_number":709,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_d164524c","line":706,"range":{"start_line":706,"start_character":24,"end_line":706,"end_character":25},"in_reply_to":"bfb3d3c7_79f79e5a","updated":"2019-05-30 22:26:00.000000000","message":"Not a blind spot, it\u0027s because we\u0027re ignoring a whole passel of pep rules: https://opendev.org/openstack/nova/src/branch/master/tox.ini#L227-L243","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"e4fa19b751f2a8a095055d39638465c8554da35c","unresolved":false,"context_lines":[{"line_number":703,"context_line":"                for feature in domain_caps[arch][machine_type].features:"},{"line_number":704,"context_line":"                    if (isinstance(feature,"},{"line_number":705,"context_line":"                                   vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":706,"context_line":"                         and feature.supported):"},{"line_number":707,"context_line":"                        LOG.info(\"AMD SEV support detected\")"},{"line_number":708,"context_line":"                        self.supports_amd_sev \u003d True"},{"line_number":709,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_cda6f2c1","line":706,"range":{"start_line":706,"start_character":24,"end_line":706,"end_character":25},"in_reply_to":"bfb3d3c7_d164524c","updated":"2019-05-31 08:31:00.000000000","message":"Ah OK.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7267b185337cf1bc9c4f76dd83a40abafdbdbc61","unresolved":false,"context_lines":[{"line_number":9641,"context_line":""},{"line_number":9642,"context_line":"        :return: A dict of trait names mapped to boolean values or None."},{"line_number":9643,"context_line":"        \"\"\""},{"line_number":9644,"context_line":"        traits \u003d self._get_cpu_feature_traits()"},{"line_number":9645,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self.supports_amd_sev"},{"line_number":9646,"context_line":"        return traits"},{"line_number":9647,"context_line":""},{"line_number":9648,"context_line":"    def _get_cpu_feature_traits(self):"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_55b2a44a","line":9645,"range":{"start_line":9644,"start_character":0,"end_line":9645,"end_character":61},"updated":"2019-05-29 23:04:47.000000000","message":"This feels like a slightly awkward split. But I get it, and it\u0027s the right thing.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"4c121d836fa2bfda5ab42d58e84cf8686d845d34","unresolved":false,"context_lines":[{"line_number":9641,"context_line":""},{"line_number":9642,"context_line":"        :return: A dict of trait names mapped to boolean values or None."},{"line_number":9643,"context_line":"        \"\"\""},{"line_number":9644,"context_line":"        traits \u003d self._get_cpu_feature_traits()"},{"line_number":9645,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self.supports_amd_sev"},{"line_number":9646,"context_line":"        return traits"},{"line_number":9647,"context_line":""},{"line_number":9648,"context_line":"    def _get_cpu_feature_traits(self):"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_f9a06e44","line":9645,"range":{"start_line":9644,"start_character":0,"end_line":9645,"end_character":61},"in_reply_to":"bfb3d3c7_55b2a44a","updated":"2019-05-30 10:42:55.000000000","message":"Possibly feels awkward because the SEV bit is positioned in the call graph as an \"aunt\" or \"uncle\" of _get_cpu_feature_traits(), rather than as a sibling?  If in the feature we add other things here, we can make them all siblings by calling extra methods.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5102b798e3c1cb885883d9e4de2e5d209d7a6d54","unresolved":false,"context_lines":[{"line_number":9641,"context_line":""},{"line_number":9642,"context_line":"        :return: A dict of trait names mapped to boolean values or None."},{"line_number":9643,"context_line":"        \"\"\""},{"line_number":9644,"context_line":"        traits \u003d self._get_cpu_feature_traits()"},{"line_number":9645,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self.supports_amd_sev"},{"line_number":9646,"context_line":"        return traits"},{"line_number":9647,"context_line":""},{"line_number":9648,"context_line":"    def _get_cpu_feature_traits(self):"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_91e81a7c","line":9645,"range":{"start_line":9644,"start_character":0,"end_line":9645,"end_character":61},"in_reply_to":"bfb3d3c7_f9a06e44","updated":"2019-05-30 22:26:00.000000000","message":"yeah, what you said.","commit_id":"d2c2de87a70b71769a4a61f5039674a6e109240f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5102b798e3c1cb885883d9e4de2e5d209d7a6d54","unresolved":false,"context_lines":[{"line_number":682,"context_line":"            LOG.debug(\"%s does not exist\", SEV_KERNEL_PARAM_FILE)"},{"line_number":683,"context_line":"            return False"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":686,"context_line":"            contents \u003d f.read()"},{"line_number":687,"context_line":"            LOG.debug(\"%s contains [%s]\", SEV_KERNEL_PARAM_FILE, contents)"},{"line_number":688,"context_line":"            return contents \u003d\u003d \"1\\n\""},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":691,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"}],"source_content_type":"text/x-python","patch_set":21,"id":"bfb3d3c7_b1ebde75","line":688,"range":{"start_line":685,"start_character":1,"end_line":688,"end_character":36},"updated":"2019-05-30 22:26:00.000000000","message":"Any need to trap OSError here?","commit_id":"1ccccb3d2d236c13c9bca91cdbfed5461e43dfae"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"e4fa19b751f2a8a095055d39638465c8554da35c","unresolved":false,"context_lines":[{"line_number":682,"context_line":"            LOG.debug(\"%s does not exist\", SEV_KERNEL_PARAM_FILE)"},{"line_number":683,"context_line":"            return False"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":686,"context_line":"            contents \u003d f.read()"},{"line_number":687,"context_line":"            LOG.debug(\"%s contains [%s]\", SEV_KERNEL_PARAM_FILE, contents)"},{"line_number":688,"context_line":"            return contents \u003d\u003d \"1\\n\""},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":691,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"}],"source_content_type":"text/x-python","patch_set":21,"id":"bfb3d3c7_ed573625","line":688,"range":{"start_line":685,"start_character":1,"end_line":688,"end_character":36},"in_reply_to":"bfb3d3c7_b1ebde75","updated":"2019-05-31 08:31:00.000000000","message":"Hmm, well if the file exists it\u0027s 0444:\n\nhttps://github.com/torvalds/linux/blob/c5b440951a19fdd068090d38dcbe72ea28e5e0d0/arch/x86/kvm/svm.c#L380\n\nso if it\u0027s not readable then I would expect something is so badly broken with the kernel that all bets are off anyway.  But maybe there is another scenario you are thinking of?","commit_id":"1ccccb3d2d236c13c9bca91cdbfed5461e43dfae"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"97dad36a8b61fec059060eeb0059f77924ea5cc2","unresolved":false,"context_lines":[{"line_number":682,"context_line":"            LOG.debug(\"%s does not exist\", SEV_KERNEL_PARAM_FILE)"},{"line_number":683,"context_line":"            return False"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":686,"context_line":"            contents \u003d f.read()"},{"line_number":687,"context_line":"            LOG.debug(\"%s contains [%s]\", SEV_KERNEL_PARAM_FILE, contents)"},{"line_number":688,"context_line":"            return contents \u003d\u003d \"1\\n\""},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":691,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fb8cfa7_2de1b9ff","line":688,"range":{"start_line":685,"start_character":1,"end_line":688,"end_character":36},"in_reply_to":"bfb3d3c7_ed573625","updated":"2019-05-31 17:42:59.000000000","message":"Nothing specific, no, just safety, basically to avoid blowing up the driver if we can\u0027t open or read the file. But it\u0027s probably okay to blow up, as you say, because \"all bets are off\".","commit_id":"1ccccb3d2d236c13c9bca91cdbfed5461e43dfae"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"87c3914b013911165ce0139b7c06295638ebda97","unresolved":false,"context_lines":[{"line_number":699,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":700,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":701,"context_line":"            return"},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"        domain_caps \u003d self._host.get_domain_capabilities()"},{"line_number":704,"context_line":"        for arch in domain_caps:"},{"line_number":705,"context_line":"            for machine_type in domain_caps[arch]:"},{"line_number":706,"context_line":"                LOG.debug(\"Checking SEV support for arch %s \""}],"source_content_type":"text/x-python","patch_set":24,"id":"7faddb67_6805fec1","line":703,"range":{"start_line":702,"start_character":0,"end_line":703,"end_character":58},"updated":"2019-07-10 11:41:54.000000000","message":"this function is broken by the way.\n\ni tried to used it for my video model traits\n\nhttps://review.opendev.org/#/c/666915/2/nova/virt/libvirt/driver.py@9666\n\nbut if you have an emulator that does not support q35 and the image does not set one then _get_domain_capabilities explode becasue fo the defult we set here\nhttps://github.com/openstack/nova/blob/de31466fdb09dd367b23660f71b4ca06f83271a2/nova/virt/libvirt/host.py#L744-L745\n\nwe need to rework get_domain_capabilities to not default to q35 and for arch that dont have a defualt iterate over all the machine types instead.\n\ni belive its my qemu-system-sparc emulator that is causing it to explode but several of the other ones i have installed also break. so i think we should fix that in a sperate patch below this one so that we can share the fix otherwise im going to end up breaking your code by either changi its interface or proposing a revert of get_domain_capabilities until it actully works for all architectures.","commit_id":"8802b78217d77cd162dff1ef69ad16b2cdd7d393"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        self._set_multiattach_support()"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        self._host._set_amd_sev_support()"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"        self._check_file_backed_memory_support()"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_12170254","line":542,"range":{"start_line":542,"start_character":19,"end_line":542,"end_character":39},"updated":"2019-08-09 14:45:51.000000000","message":"I really don\u0027t like us using a private method here, and I think we can do this much nicer than we are. Comments in the host.py changes","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"11e9caaad110aa7a285fcbda6e0ea0cc9aa79042","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        self._set_multiattach_support()"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        self._host._set_amd_sev_support()"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"        self._check_file_backed_memory_support()"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_0f7689d9","line":542,"range":{"start_line":542,"start_character":19,"end_line":542,"end_character":39},"in_reply_to":"7faddb67_12170254","updated":"2019-08-16 14:47:58.000000000","message":"Done","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":9646,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self._host.supports_amd_sev"},{"line_number":9647,"context_line":"        return traits"},{"line_number":9648,"context_line":""},{"line_number":9649,"context_line":"    def _get_cpu_feature_traits(self):"},{"line_number":9650,"context_line":"        \"\"\"Get CPU traits of VMs based on guest CPU model config:"},{"line_number":9651,"context_line":"        1. if mode is \u0027host-model\u0027 or \u0027host-passthrough\u0027, use host\u0027s"},{"line_number":9652,"context_line":"        CPU features."}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_4d9e3bb9","line":9649,"range":{"start_line":9649,"start_character":8,"end_line":9649,"end_character":31},"updated":"2019-08-09 14:45:51.000000000","message":"nit: Why the rename? Couldn\u0027t we just report the above as part of this function, since it\u0027s all CPU trait stuff?","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"11e9caaad110aa7a285fcbda6e0ea0cc9aa79042","unresolved":false,"context_lines":[{"line_number":9646,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self._host.supports_amd_sev"},{"line_number":9647,"context_line":"        return traits"},{"line_number":9648,"context_line":""},{"line_number":9649,"context_line":"    def _get_cpu_feature_traits(self):"},{"line_number":9650,"context_line":"        \"\"\"Get CPU traits of VMs based on guest CPU model config:"},{"line_number":9651,"context_line":"        1. if mode is \u0027host-model\u0027 or \u0027host-passthrough\u0027, use host\u0027s"},{"line_number":9652,"context_line":"        CPU features."}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_8f2d9947","line":9649,"range":{"start_line":9649,"start_character":8,"end_line":9649,"end_character":31},"in_reply_to":"7faddb67_4d9e3bb9","updated":"2019-08-16 14:47:58.000000000","message":"Because\n\n1. the existing method is already big enough\n2. the existing method only gets CPU traits based on guest CPU model config, whereas this SEV trait is coming from elsewhere (e.g. it includes logic to check kernel module parameters and libvirt domain capabilities)\n3. Eric already agreed it\u0027s the right thing to do: https://review.opendev.org/#/c/638680/20/nova/virt/libvirt/driver.py@9645\n4. As mentioned in the above link, in the future as CPU traits start coming from other places too, we could split the SEV line out into a separate sibling method, and then each method could be unit-tested separately to avoid multiple unrelated unit tests all testing different chunks of a single large method.","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3418088ea42e360340e0adb125311afe0eb31195","unresolved":false,"context_lines":[{"line_number":9700,"context_line":"            LOG.info(\u0027The current libvirt hypervisor %(virt_type)s \u0027"},{"line_number":9701,"context_line":"                     \u0027does not support reporting CPU traits.\u0027,"},{"line_number":9702,"context_line":"                     {\u0027virt_type\u0027: CONF.libvirt.virt_type})"},{"line_number":9703,"context_line":"            return"},{"line_number":9704,"context_line":""},{"line_number":9705,"context_line":"        caps \u003d deepcopy(self._host.get_capabilities())"},{"line_number":9706,"context_line":"        if cpu.mode in (\u0027host-model\u0027, \u0027host-passthrough\u0027):"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_0b514862","line":9703,"range":{"start_line":9703,"start_character":12,"end_line":9703,"end_character":18},"updated":"2019-08-22 06:49:05.000000000","message":"you should be careful this, it return None. so the code may blow up at line 9683","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"63b7cd493d6f7c710c5a3a4f052ef2391b492390","unresolved":false,"context_lines":[{"line_number":9700,"context_line":"            LOG.info(\u0027The current libvirt hypervisor %(virt_type)s \u0027"},{"line_number":9701,"context_line":"                     \u0027does not support reporting CPU traits.\u0027,"},{"line_number":9702,"context_line":"                     {\u0027virt_type\u0027: CONF.libvirt.virt_type})"},{"line_number":9703,"context_line":"            return"},{"line_number":9704,"context_line":""},{"line_number":9705,"context_line":"        caps \u003d deepcopy(self._host.get_capabilities())"},{"line_number":9706,"context_line":"        if cpu.mode in (\u0027host-model\u0027, \u0027host-passthrough\u0027):"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_a92ef989","line":9703,"range":{"start_line":9703,"start_character":12,"end_line":9703,"end_character":18},"in_reply_to":"7faddb67_0b514862","updated":"2019-08-22 11:50:00.000000000","message":"Good catch!  Will fix.","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"986f42f469b306d8ee5b1ab43a978fe0d7223d9b","unresolved":false,"context_lines":[{"line_number":9700,"context_line":"            LOG.info(\u0027The current libvirt hypervisor %(virt_type)s \u0027"},{"line_number":9701,"context_line":"                     \u0027does not support reporting CPU traits.\u0027,"},{"line_number":9702,"context_line":"                     {\u0027virt_type\u0027: CONF.libvirt.virt_type})"},{"line_number":9703,"context_line":"            return"},{"line_number":9704,"context_line":""},{"line_number":9705,"context_line":"        caps \u003d deepcopy(self._host.get_capabilities())"},{"line_number":9706,"context_line":"        if cpu.mode in (\u0027host-model\u0027, \u0027host-passthrough\u0027):"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_7ab9a1c9","line":9703,"range":{"start_line":9703,"start_character":12,"end_line":9703,"end_character":18},"in_reply_to":"7faddb67_a92ef989","updated":"2019-08-22 12:55:47.000000000","message":"Done","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ff209f663141524a6b47b413619061a17c38aef1","unresolved":false,"context_lines":[{"line_number":9667,"context_line":""},{"line_number":9668,"context_line":"        :return: A dict of trait names mapped to boolean values or None."},{"line_number":9669,"context_line":"        \"\"\""},{"line_number":9670,"context_line":"        traits \u003d self._get_cpu_feature_traits() or {}"},{"line_number":9671,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self._host.supports_amd_sev"},{"line_number":9672,"context_line":"        return traits"},{"line_number":9673,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_c0229f54","line":9670,"range":{"start_line":9670,"start_character":22,"end_line":9670,"end_character":45},"updated":"2019-08-30 09:32:03.000000000","message":"aside: We should just modify this to always return a dict, even if it\u0027s empty","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"68039a54f1374d01d0c720569e134de310314398","unresolved":false,"context_lines":[{"line_number":9667,"context_line":""},{"line_number":9668,"context_line":"        :return: A dict of trait names mapped to boolean values or None."},{"line_number":9669,"context_line":"        \"\"\""},{"line_number":9670,"context_line":"        traits \u003d self._get_cpu_feature_traits() or {}"},{"line_number":9671,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self._host.supports_amd_sev"},{"line_number":9672,"context_line":"        return traits"},{"line_number":9673,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_3adcf016","line":9670,"range":{"start_line":9670,"start_character":22,"end_line":9670,"end_character":45},"in_reply_to":"7faddb67_161ec16f","updated":"2019-09-01 14:00:14.000000000","message":"Done in https://review.opendev.org/#/c/679568/","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"9bae205cbde98f2ff010014e6a14821730b2a748","unresolved":false,"context_lines":[{"line_number":9667,"context_line":""},{"line_number":9668,"context_line":"        :return: A dict of trait names mapped to boolean values or None."},{"line_number":9669,"context_line":"        \"\"\""},{"line_number":9670,"context_line":"        traits \u003d self._get_cpu_feature_traits() or {}"},{"line_number":9671,"context_line":"        traits[ot.HW_CPU_X86_AMD_SEV] \u003d self._host.supports_amd_sev"},{"line_number":9672,"context_line":"        return traits"},{"line_number":9673,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_161ec16f","line":9670,"range":{"start_line":9670,"start_character":22,"end_line":9670,"end_character":45},"in_reply_to":"7faddb67_c0229f54","updated":"2019-08-30 12:29:59.000000000","message":"Good idea, \u003e\u003e/dev/followup","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2d6b458d1d79e8f8a5351e613eab2daccfb6df9f","unresolved":false,"context_lines":[{"line_number":1063,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1064,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":1065,"context_line":"        # supported."},{"line_number":1066,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":1067,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":1068,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":1069,"context_line":"            return"},{"line_number":1070,"context_line":""},{"line_number":1071,"context_line":"        domain_caps \u003d self.get_domain_capabilities()"},{"line_number":1072,"context_line":"        for arch in domain_caps:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7faddb67_bfe4f93c","line":1069,"range":{"start_line":1066,"start_character":2,"end_line":1069,"end_character":18},"updated":"2019-07-19 15:58:19.000000000","message":"i do not have sev support in my devstack vm but if i comment out this if i still get the same traceback\nhttp://paste.openstack.org/show/754594/\n\nso we still need https://review.opendev.org/#/c/670189/ to make self.get_domain_capabilities() not explode if you have emultors installed that dont have a defualt set in code and dont support q35","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"689133bfd8b92c6c44b5b265c6bdada97745aa05","unresolved":false,"context_lines":[{"line_number":1063,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1064,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":1065,"context_line":"        # supported."},{"line_number":1066,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":1067,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":1068,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":1069,"context_line":"            return"},{"line_number":1070,"context_line":""},{"line_number":1071,"context_line":"        domain_caps \u003d self.get_domain_capabilities()"},{"line_number":1072,"context_line":"        for arch in domain_caps:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7faddb67_b8f7f7d4","line":1069,"range":{"start_line":1066,"start_character":2,"end_line":1069,"end_character":18},"in_reply_to":"7faddb67_bfe4f93c","updated":"2019-07-24 11:02:00.000000000","message":"This is now rebased on your patch https://review.opendev.org/#/c/670189/ which fixes get_domain_capabilities().","commit_id":"632523f44c94dd335b8d0568731b075c07e15732"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6965db4403d7e2a5ff647469061480585166f5f0","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"        except IOError:"},{"line_number":1157,"context_line":"            return False"},{"line_number":1158,"context_line":""},{"line_number":1159,"context_line":"    def _kernel_supports_amd_sev(self):"},{"line_number":1160,"context_line":"        if not os.path.exists(SEV_KERNEL_PARAM_FILE):"},{"line_number":1161,"context_line":"            LOG.debug(\"%s does not exist\", SEV_KERNEL_PARAM_FILE)"},{"line_number":1162,"context_line":"            return False"},{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"        with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":1165,"context_line":"            contents \u003d f.read()"},{"line_number":1166,"context_line":"            LOG.debug(\"%s contains [%s]\", SEV_KERNEL_PARAM_FILE, contents)"},{"line_number":1167,"context_line":"            return contents \u003d\u003d \"1\\n\""},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1170,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":1171,"context_line":"        # supported."},{"line_number":1172,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":1173,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":1174,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":1175,"context_line":"            return"},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"        domain_caps \u003d self.get_domain_capabilities()"},{"line_number":1178,"context_line":"        for arch in domain_caps:"},{"line_number":1179,"context_line":"            for machine_type in domain_caps[arch]:"},{"line_number":1180,"context_line":"                LOG.debug(\"Checking SEV support for arch %s \""},{"line_number":1181,"context_line":"                          \"and machine type %s\", arch, machine_type)"},{"line_number":1182,"context_line":"                for feature in domain_caps[arch][machine_type].features:"},{"line_number":1183,"context_line":"                    feature_is_sev \u003d isinstance("},{"line_number":1184,"context_line":"                        feature, vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":1185,"context_line":"                    if (feature_is_sev and feature.supported):"},{"line_number":1186,"context_line":"                        LOG.info(\"AMD SEV support detected\")"},{"line_number":1187,"context_line":"                        self.supports_amd_sev \u003d True"},{"line_number":1188,"context_line":"                        return"},{"line_number":1189,"context_line":""},{"line_number":1190,"context_line":"        LOG.info(\"No AMD SEV support detected for any (arch, machine_type)\")"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_ad100f51","line":1190,"range":{"start_line":1159,"start_character":0,"end_line":1190,"end_character":76},"updated":"2019-08-09 14:45:51.000000000","message":"Realistically, is this going to change during runtime? Instead of having a variable that we have to remember to set, can we use a property instead and just cache the result?\n\n  @property\n  def supports_amd_sev(self):\n      if self.__supports_amd_sev:\n          return self.__supports_amd_sev|\n\n      self.__supports_amd_sev \u003d False\n\n      # all of the above, optionally setting the variable to True","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"11e9caaad110aa7a285fcbda6e0ea0cc9aa79042","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"        except IOError:"},{"line_number":1157,"context_line":"            return False"},{"line_number":1158,"context_line":""},{"line_number":1159,"context_line":"    def _kernel_supports_amd_sev(self):"},{"line_number":1160,"context_line":"        if not os.path.exists(SEV_KERNEL_PARAM_FILE):"},{"line_number":1161,"context_line":"            LOG.debug(\"%s does not exist\", SEV_KERNEL_PARAM_FILE)"},{"line_number":1162,"context_line":"            return False"},{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"        with open(SEV_KERNEL_PARAM_FILE) as f:"},{"line_number":1165,"context_line":"            contents \u003d f.read()"},{"line_number":1166,"context_line":"            LOG.debug(\"%s contains [%s]\", SEV_KERNEL_PARAM_FILE, contents)"},{"line_number":1167,"context_line":"            return contents \u003d\u003d \"1\\n\""},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1170,"context_line":"        # Check to see if AMD SEV (Secure Encrypted Virtualization) is"},{"line_number":1171,"context_line":"        # supported."},{"line_number":1172,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":1173,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"},{"line_number":1174,"context_line":"            self.supports_amd_sev \u003d False"},{"line_number":1175,"context_line":"            return"},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"        domain_caps \u003d self.get_domain_capabilities()"},{"line_number":1178,"context_line":"        for arch in domain_caps:"},{"line_number":1179,"context_line":"            for machine_type in domain_caps[arch]:"},{"line_number":1180,"context_line":"                LOG.debug(\"Checking SEV support for arch %s \""},{"line_number":1181,"context_line":"                          \"and machine type %s\", arch, machine_type)"},{"line_number":1182,"context_line":"                for feature in domain_caps[arch][machine_type].features:"},{"line_number":1183,"context_line":"                    feature_is_sev \u003d isinstance("},{"line_number":1184,"context_line":"                        feature, vconfig.LibvirtConfigDomainCapsFeatureSev)"},{"line_number":1185,"context_line":"                    if (feature_is_sev and feature.supported):"},{"line_number":1186,"context_line":"                        LOG.info(\"AMD SEV support detected\")"},{"line_number":1187,"context_line":"                        self.supports_amd_sev \u003d True"},{"line_number":1188,"context_line":"                        return"},{"line_number":1189,"context_line":""},{"line_number":1190,"context_line":"        LOG.info(\"No AMD SEV support detected for any (arch, machine_type)\")"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_6f005d67","line":1190,"range":{"start_line":1159,"start_character":0,"end_line":1190,"end_character":76},"in_reply_to":"7faddb67_ad100f51","updated":"2019-08-16 14:47:58.000000000","message":"Nice idea - done!","commit_id":"14f378b4712e373c8664554be9cfc91bac66ee2c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab7eb5fd4240d1373da1804cdea9d7bd16757089","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        would affect the support, nova-compute should be restarted"},{"line_number":1180,"context_line":"        anyway."},{"line_number":1181,"context_line":"        \"\"\""},{"line_number":1182,"context_line":"        if self._supports_amd_sev:"},{"line_number":1183,"context_line":"            return self._supports_amd_sev"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_d0b00d43","line":1186,"range":{"start_line":1182,"start_character":8,"end_line":1186,"end_character":37},"updated":"2019-08-16 19:16:03.000000000","message":"This is weird.\n\nSo if we cached `True` we\u0027ll just return it.\n\nBut if we cached `False` we\u0027ll go rediscover (and still return `False` if that\u0027s what we figure out).\n\nDid you mean for the init to be None and check `is None` here?","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"1a790e25f5034c6328145a901518a4297b4efc48","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        would affect the support, nova-compute should be restarted"},{"line_number":1180,"context_line":"        anyway."},{"line_number":1181,"context_line":"        \"\"\""},{"line_number":1182,"context_line":"        if self._supports_amd_sev:"},{"line_number":1183,"context_line":"            return self._supports_amd_sev"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_ab8c0280","line":1186,"range":{"start_line":1182,"start_character":8,"end_line":1186,"end_character":37},"in_reply_to":"7faddb67_ab45e245","updated":"2019-08-16 20:50:00.000000000","message":"Done","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"3c5cd07771b45d2c1aa10a61657f38ebeec5c1eb","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        would affect the support, nova-compute should be restarted"},{"line_number":1180,"context_line":"        anyway."},{"line_number":1181,"context_line":"        \"\"\""},{"line_number":1182,"context_line":"        if self._supports_amd_sev:"},{"line_number":1183,"context_line":"            return self._supports_amd_sev"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_d22c879a","line":1186,"range":{"start_line":1182,"start_character":8,"end_line":1186,"end_character":37},"in_reply_to":"7faddb67_d0b00d43","updated":"2019-08-19 09:17:58.000000000","message":"Good spot indeed. Whoops","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"3669c3caaf12b05ed6c6e595f38e625e631c75f0","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        would affect the support, nova-compute should be restarted"},{"line_number":1180,"context_line":"        anyway."},{"line_number":1181,"context_line":"        \"\"\""},{"line_number":1182,"context_line":"        if self._supports_amd_sev:"},{"line_number":1183,"context_line":"            return self._supports_amd_sev"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_ab45e245","line":1186,"range":{"start_line":1182,"start_character":8,"end_line":1186,"end_character":37},"in_reply_to":"7faddb67_d0b00d43","updated":"2019-08-16 20:32:43.000000000","message":"Yeah exactly, good spot.  Will fix ...","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8b6c2994b9559a8badf9a384fe7755277bffdf64","unresolved":false,"context_lines":[{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1190,"context_line":""},{"line_number":1191,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_dadb4e7a","line":1188,"updated":"2019-08-16 17:01:22.000000000","message":"nit: I\u0027d personally have rolled this and \u0027_kernel_supports_amd_sev\u0027 into the above since it\u0027s pretty tightly coupled and reading it as one flow is easier (for me, anyway)","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"3669c3caaf12b05ed6c6e595f38e625e631c75f0","unresolved":false,"context_lines":[{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1190,"context_line":""},{"line_number":1191,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_0b3d16ba","line":1188,"in_reply_to":"7faddb67_dadb4e7a","updated":"2019-08-16 20:32:43.000000000","message":"That makes some of the functional tests significantly harder.  I really need a way in those to say \"recalculate the SEV support regardless of what is currently cached\".\n\nAdditionally (but not nearly as significantly), my style preference is the opposite of yours.  I\u0027m a huge believer in the single responsibility principle of keeping functions as small as possible.  Do one thing well.  In this case, \"caching\" is one thing, and \"calculate SEV support\" is another.  I\u0027m going to make a fallacious argument based on a wild guess to back this up: maybe if I hadn\u0027t separated them out, Eric would have had less chance of spotting the stupid bug immediately above this.","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8b6c2994b9559a8badf9a384fe7755277bffdf64","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"                        self._supports_amd_sev \u003d True"},{"line_number":1207,"context_line":"                        return"},{"line_number":1208,"context_line":""},{"line_number":1209,"context_line":"        LOG.info(\"No AMD SEV support detected for any (arch, machine_type)\")"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_bab0d241","line":1209,"updated":"2019-08-16 17:01:22.000000000","message":"Does this warrant an info-level log, I wonder? debug might be more appropriate, given that there\u0027s a large swathe of people that won\u0027t be able to do anything about this","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab7eb5fd4240d1373da1804cdea9d7bd16757089","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"                        self._supports_amd_sev \u003d True"},{"line_number":1207,"context_line":"                        return"},{"line_number":1208,"context_line":""},{"line_number":1209,"context_line":"        LOG.info(\"No AMD SEV support detected for any (arch, machine_type)\")"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_f0498931","line":1209,"in_reply_to":"7faddb67_bab0d241","updated":"2019-08-16 19:16:03.000000000","message":"It should happen just once, on compute startup, right? In which case it\u0027s not awful to have it at info level.\n\nWhat some might object to is there being anything \"AMD\" in the logs if they\u0027re on a definitely-not-AMD setup. Be like, \"Duh, of course you didn\u0027t find AMD SEV. You also didn\u0027t find Street Fighter II.\"","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"3669c3caaf12b05ed6c6e595f38e625e631c75f0","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"                        self._supports_amd_sev \u003d True"},{"line_number":1207,"context_line":"                        return"},{"line_number":1208,"context_line":""},{"line_number":1209,"context_line":"        LOG.info(\"No AMD SEV support detected for any (arch, machine_type)\")"}],"source_content_type":"text/x-python","patch_set":41,"id":"7faddb67_0b6676ee","line":1209,"in_reply_to":"7faddb67_f0498931","updated":"2019-08-16 20:32:43.000000000","message":"Yeah, should be just once on startup.  But fair point, I\u0027ll change to debug.","commit_id":"5111ef7472faeffea8a2a32ab6173dbfe5b322a7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5aa3bda58429dcd0dc2c440dc7caa0e1d299cbca","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        would affect the support, nova-compute should be restarted"},{"line_number":1180,"context_line":"        anyway."},{"line_number":1181,"context_line":"        \"\"\""},{"line_number":1182,"context_line":"        if self._supports_amd_sev is not None:"},{"line_number":1183,"context_line":"            return self._supports_amd_sev"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"}],"source_content_type":"text/x-python","patch_set":42,"id":"7faddb67_8b64a6ba","line":1186,"range":{"start_line":1182,"start_character":0,"end_line":1186,"end_character":37},"updated":"2019-08-16 20:47:06.000000000","message":"or the usual pattern:\n\n if self._supports_amd_sev is None:\n     self._set_amd_sev_support()\n return self._supports_amd_sev","commit_id":"3d4c36715d1deb82a242ba9efac61260184659c0"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"87c8c2804e4a0c780105e7f53e971a733594d480","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        would affect the support, nova-compute should be restarted"},{"line_number":1180,"context_line":"        anyway."},{"line_number":1181,"context_line":"        \"\"\""},{"line_number":1182,"context_line":"        if self._supports_amd_sev is not None:"},{"line_number":1183,"context_line":"            return self._supports_amd_sev"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        self._set_amd_sev_support()"},{"line_number":1186,"context_line":"        return self._supports_amd_sev"},{"line_number":1187,"context_line":""},{"line_number":1188,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1189,"context_line":"        self._supports_amd_sev \u003d False"}],"source_content_type":"text/x-python","patch_set":42,"id":"7faddb67_4bb6aefb","line":1186,"range":{"start_line":1182,"start_character":0,"end_line":1186,"end_character":37},"in_reply_to":"7faddb67_8b64a6ba","updated":"2019-08-16 20:51:21.000000000","message":"Doh, that would be much nicer. Fixing in next patch set.","commit_id":"3d4c36715d1deb82a242ba9efac61260184659c0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5aa3bda58429dcd0dc2c440dc7caa0e1d299cbca","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"                        self._supports_amd_sev \u003d True"},{"line_number":1207,"context_line":"                        return"},{"line_number":1208,"context_line":""},{"line_number":1209,"context_line":"        LOG.debug(\"No AMD SEV support detected for any (arch, machine_type)\")"}],"source_content_type":"text/x-python","patch_set":42,"id":"7faddb67_ab688287","line":1209,"range":{"start_line":1209,"start_character":12,"end_line":1209,"end_character":17},"updated":"2019-08-16 20:47:06.000000000","message":"I guess I was more suggesting something like \"if AMD, log this (at info level), else don\u0027t log anything\". But that might be way harder to do. This is fine.","commit_id":"3d4c36715d1deb82a242ba9efac61260184659c0"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"466d9c9798cc4e56df0ad31ad7f6b01c4aadf5ed","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"            self._set_amd_sev_support()"},{"line_number":1184,"context_line":"        return self._supports_amd_sev"},{"line_number":1185,"context_line":""},{"line_number":1186,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1187,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_d650c2d7","line":1186,"range":{"start_line":1186,"start_character":8,"end_line":1186,"end_character":28},"updated":"2019-08-21 16:56:26.000000000","message":"style nit: should have said this earlier, but \u0027_get_amd_sev_support\u0027 that returned the value, which you set above, would make more sense to me.","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"9bae205cbde98f2ff010014e6a14821730b2a748","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"            self._set_amd_sev_support()"},{"line_number":1184,"context_line":"        return self._supports_amd_sev"},{"line_number":1185,"context_line":""},{"line_number":1186,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1187,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_51e1a32a","line":1186,"range":{"start_line":1186,"start_character":8,"end_line":1186,"end_character":28},"in_reply_to":"7faddb67_a0cbe36f","updated":"2019-08-30 12:29:59.000000000","message":"I see how this would make this code ever so slightly cleaner, but it would make the corresponding tests uglier, as they need to be able to *force* recalculating and setting the value even if it was previously calculated and set.","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"986f42f469b306d8ee5b1ab43a978fe0d7223d9b","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"            self._set_amd_sev_support()"},{"line_number":1184,"context_line":"        return self._supports_amd_sev"},{"line_number":1185,"context_line":""},{"line_number":1186,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1187,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_fa9b5161","line":1186,"range":{"start_line":1186,"start_character":8,"end_line":1186,"end_character":28},"in_reply_to":"7faddb67_d650c2d7","updated":"2019-08-22 12:55:47.000000000","message":"That makes less sense to me because the name implies it\u0027s a getter whereas it\u0027s actually a setter.  supports_amd_sev above is the getter.","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ff209f663141524a6b47b413619061a17c38aef1","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"            self._set_amd_sev_support()"},{"line_number":1184,"context_line":"        return self._supports_amd_sev"},{"line_number":1185,"context_line":""},{"line_number":1186,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1187,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_a0cbe36f","line":1186,"range":{"start_line":1186,"start_character":8,"end_line":1186,"end_character":28},"in_reply_to":"7faddb67_fa9b5161","updated":"2019-08-30 09:32:03.000000000","message":"Ah, I meant return the value from this and actually set the value in \u0027supports_amd_sev\u0027 (i.e. the \"main\" function\"). The setter-getter idea doesn\u0027t really map here since our getter is already technically a setter (line 1182-1183)","commit_id":"fbb7c39f7591be7b8f4a190c1680155f477f9410"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"db8d4ba11fd48999e44b785e7a76b1b634e1b95a","unresolved":false,"context_lines":[{"line_number":1183,"context_line":"            self._set_amd_sev_support()"},{"line_number":1184,"context_line":"        return self._supports_amd_sev"},{"line_number":1185,"context_line":""},{"line_number":1186,"context_line":"    def _set_amd_sev_support(self):"},{"line_number":1187,"context_line":"        self._supports_amd_sev \u003d False"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"        if not self._kernel_supports_amd_sev():"}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_60964b4c","line":1186,"updated":"2019-08-30 09:35:30.000000000","message":"Per comments from PS49, I\u0027d rather this didn\u0027t have side effects and simply returned the value, but that\u0027s personal preference and we can address that in a follow-up if we want","commit_id":"dc1a2880c6277a14f0d04bc64474f2546f3077fb"}]}
