)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cd806602e5b17f89eea7e05b9beb880c39a50158","unresolved":false,"context_lines":[{"line_number":15,"context_line":"devices, even if guest or host have no iommu device."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Add a class to create required elements and modify existing ones for SEV."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ia78458ac698f66d297cb91bcab663fcf123c5442"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_2dc2845a","line":18,"updated":"2019-02-12 14:29:05.000000000","message":"commit message needs to be tagged with\n\nblueprint: amd-sev-libvirt-support","commit_id":"89419f1a3983c6edeea217c9720e903b782e2e63"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"6e937272bb7d48f4ddce3415e9f4576ccc268280","unresolved":false,"context_lines":[{"line_number":15,"context_line":"devices, even if guest or host have no iommu device."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Add a class to create required elements and modify existing ones for SEV."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ia78458ac698f66d297cb91bcab663fcf123c5442"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9fdfeff1_7132a6f4","line":18,"in_reply_to":"9fdfeff1_2dc2845a","updated":"2019-02-12 15:02:57.000000000","message":"Done","commit_id":"89419f1a3983c6edeea217c9720e903b782e2e63"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"3b632de748f9d5eb541aae09575a19b5b6fde01b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"AMD SEV requires to set several attributes to enable it:"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":" - launchSecurity"},{"line_number":12,"context_line":" - memtune with hard_limit"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"In addition to that, it requires to enable iommu driver for all virtio"},{"line_number":15,"context_line":"devices, even if guest or host have no iommu device."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Add a class to create required elements and modify existing ones for SEV."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"blueprint: amd-sev-libvirt-support"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5fc1f717_ea3055eb","line":17,"range":{"start_line":12,"start_character":0,"end_line":17,"end_character":73},"updated":"2019-03-19 18:10:16.000000000","message":"IIUC, this now only deals with launchSecurity, not memtune or iommu stuff, so the commit message should be updated.","commit_id":"55aa03792ff38e645c6efce18c9bef267f721690"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"b46cf22523b6e92ec27752e7129fbae3ad00e162","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Boris Bobrov \u003cbreton@cynicmansion.ru\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-06-01 10:29:41 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add configs for AMD SEV"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"AMD SEV requires to set several attributes to enable it:"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fb8cfa7_ad3277a6","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":11},"updated":"2019-06-03 11:18:22.000000000","message":"\"Add \u003claunchSecurity\u003e element to guest config for AMD SEV\"","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"dadf4f50675e6c871ec95ee9abfa523a971b405e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Boris Bobrov \u003cbreton@cynicmansion.ru\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-06-01 10:29:41 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add configs for AMD SEV"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"AMD SEV requires to set several attributes to enable it:"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fb8cfa7_b6a07fa7","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":11},"in_reply_to":"9fb8cfa7_ad3277a6","updated":"2019-06-03 17:45:03.000000000","message":"Done","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"b46cf22523b6e92ec27752e7129fbae3ad00e162","unresolved":false,"context_lines":[{"line_number":9,"context_line":"AMD SEV requires to set several attributes to enable it:"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":" - launchSecurity"},{"line_number":12,"context_line":" - memoryBacking with \u003clocked /\u003e element"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"In addition to that, it requires to enable iommu driver for all virtio"},{"line_number":15,"context_line":"devices, even if guest or host have no iommu device."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Add required bits for the launchSecurity element"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fb8cfa7_ad3b579a","line":15,"range":{"start_line":12,"start_character":0,"end_line":15,"end_character":52},"updated":"2019-06-03 11:18:22.000000000","message":"This is no longer relevant to this commit message, so you can just get rid of it.","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"dadf4f50675e6c871ec95ee9abfa523a971b405e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"AMD SEV requires to set several attributes to enable it:"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":" - launchSecurity"},{"line_number":12,"context_line":" - memoryBacking with \u003clocked /\u003e element"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"In addition to that, it requires to enable iommu driver for all virtio"},{"line_number":15,"context_line":"devices, even if guest or host have no iommu device."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Add required bits for the launchSecurity element"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fb8cfa7_76aa0786","line":15,"range":{"start_line":12,"start_character":0,"end_line":15,"end_character":52},"in_reply_to":"9fb8cfa7_ad3b579a","updated":"2019-06-03 17:45:03.000000000","message":"Done","commit_id":"d70f677e785422126e7f2e1167116438b779da20"}],"nova/tests/unit/virt/libvirt/test_config.py":[{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"b46cf22523b6e92ec27752e7129fbae3ad00e162","unresolved":false,"context_lines":[{"line_number":2204,"context_line":"        xml \u003d obj.to_xml()"},{"line_number":2205,"context_line":"        launch_security_expected \u003d \"\"\""},{"line_number":2206,"context_line":"            \u003claunchSecurity type\u003d\"sev\"\u003e"},{"line_number":2207,"context_line":"              \u003cpolicy\u003e0x0037\u003c/policy\u003e"},{"line_number":2208,"context_line":"              \u003ccbitpos\u003e47\u003c/cbitpos\u003e"},{"line_number":2209,"context_line":"              \u003creducedPhysBits\u003e1\u003c/reducedPhysBits\u003e"},{"line_number":2210,"context_line":"            \u003c/launchSecurity\u003e\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_0d738382","line":2207,"range":{"start_line":2207,"start_character":22,"end_line":2207,"end_character":28},"updated":"2019-06-03 11:18:22.000000000","message":"0x0033 - this is why CI is failing.","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"dadf4f50675e6c871ec95ee9abfa523a971b405e","unresolved":false,"context_lines":[{"line_number":2204,"context_line":"        xml \u003d obj.to_xml()"},{"line_number":2205,"context_line":"        launch_security_expected \u003d \"\"\""},{"line_number":2206,"context_line":"            \u003claunchSecurity type\u003d\"sev\"\u003e"},{"line_number":2207,"context_line":"              \u003cpolicy\u003e0x0037\u003c/policy\u003e"},{"line_number":2208,"context_line":"              \u003ccbitpos\u003e47\u003c/cbitpos\u003e"},{"line_number":2209,"context_line":"              \u003creducedPhysBits\u003e1\u003c/reducedPhysBits\u003e"},{"line_number":2210,"context_line":"            \u003c/launchSecurity\u003e\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_16ff0bab","line":2207,"range":{"start_line":2207,"start_character":22,"end_line":2207,"end_character":28},"in_reply_to":"9fb8cfa7_0d738382","updated":"2019-06-03 17:45:03.000000000","message":"Done","commit_id":"d70f677e785422126e7f2e1167116438b779da20"}],"nova/virt/libvirt/config.py":[{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"34baaa321ef737effe0038095b0dce41315ffcb2","unresolved":false,"context_lines":[{"line_number":2269,"context_line":""},{"line_number":2270,"context_line":"        self.cbitpos \u003d None"},{"line_number":2271,"context_line":"        self.reduced_phys_bits \u003d None"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"    def format_dom(self):"},{"line_number":2274,"context_line":"        root \u003d super(LibvirtConfigGuestSEVLaunchSecurity, self).format_dom()"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_17246aae","line":2272,"updated":"2019-02-12 16:42:26.000000000","message":"I think you also need a parse_dom() here.","commit_id":"8b7c533eb3ebd9e3eed44663a147e01a31f336ce"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"34baaa321ef737effe0038095b0dce41315ffcb2","unresolved":false,"context_lines":[{"line_number":2289,"context_line":"        return root"},{"line_number":2290,"context_line":""},{"line_number":2291,"context_line":""},{"line_number":2292,"context_line":"class LibvirtConfigGuestSEV(object):"},{"line_number":2293,"context_line":""},{"line_number":2294,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2295,"context_line":"        super(LibvirtConfigGuestSEV, self).__init__(**kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_57d8b279","line":2292,"range":{"start_line":2292,"start_character":28,"end_line":2292,"end_character":34},"updated":"2019-02-12 16:42:26.000000000","message":"ICBW but this doesn\u0027t look consistent with the rest of config.py.  The existing design is described in a docstring at the top:\n\n\u003e Classes to represent the configuration of various libvirt objects and support conversion to/from XML. These classes are solely concerned by providing direct Object \u003c-\u003e XML document conversions. No policy or operational decisions should be made by code in these classes. Such policy belongs in the \u0027designer.py\u0027 module which provides simplified helpers for populating up config object instances.\n\nSo decisions such as \"we need to make sure every device is virtio\" belong in the driver, not here.\n\nIIUC this is why every LibvirtConfig* class in config.py corresponds to a chunk of XML, handles the parsing of XML via parse_dom(), and the generation of XML via format_dom().  Consequently they all inherit from LibvirtConfigObject, and all have a \"root_name\".","commit_id":"8b7c533eb3ebd9e3eed44663a147e01a31f336ce"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"34baaa321ef737effe0038095b0dce41315ffcb2","unresolved":false,"context_lines":[{"line_number":2298,"context_line":"        self.cbitpos \u003d None"},{"line_number":2299,"context_line":"        self.reduced_phys_bits \u003d None"},{"line_number":2300,"context_line":""},{"line_number":2301,"context_line":"    def _format_memtune(self):"},{"line_number":2302,"context_line":"        memtune \u003d LibvirtConfigGuestMemoryTune()"},{"line_number":2303,"context_line":"        memtune.hard_limit \u003d self.memtune_limit"},{"line_number":2304,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_37908e43","line":2301,"updated":"2019-02-12 16:42:26.000000000","message":"I don\u0027t think this is necessary here since it\u0027s not parsing or generating XML.  Later we can add logic to driver.py which sets the hard limit correctly in the SEV case.","commit_id":"8b7c533eb3ebd9e3eed44663a147e01a31f336ce"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"34baaa321ef737effe0038095b0dce41315ffcb2","unresolved":false,"context_lines":[{"line_number":2304,"context_line":""},{"line_number":2305,"context_line":"        return memtune"},{"line_number":2306,"context_line":""},{"line_number":2307,"context_line":"    def _set_iommu_attr(self, root):"},{"line_number":2308,"context_line":"        # sev requires to set iommu attribute to \"on\" for all virtio devices"},{"line_number":2309,"context_line":"        # there are several ways to detect that device is virtio"},{"line_number":2310,"context_line":"        devices_path_with_virtio \u003d ["}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_97bffaa8","line":2307,"updated":"2019-02-12 16:42:26.000000000","message":"Again this is operational logic which IIUC doesn\u0027t belong in this class.  We can add it to driver.py later.","commit_id":"8b7c533eb3ebd9e3eed44663a147e01a31f336ce"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"34baaa321ef737effe0038095b0dce41315ffcb2","unresolved":false,"context_lines":[{"line_number":2318,"context_line":"                    driver \u003d etree.Element(\u0027driver\u0027, iommu\u003d\u0027on\u0027)"},{"line_number":2319,"context_line":"                    device.append(driver)"},{"line_number":2320,"context_line":""},{"line_number":2321,"context_line":"    def get_features(self):"},{"line_number":2322,"context_line":"        features \u003d []"},{"line_number":2323,"context_line":""},{"line_number":2324,"context_line":"        launch_security \u003d LibvirtConfigGuestSEVLaunchSecurity()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_1786aa14","line":2321,"updated":"2019-02-12 16:42:26.000000000","message":"I don\u0027t think there is anywhere natural we could introduce a caller of this method from within the existing design of the code.","commit_id":"8b7c533eb3ebd9e3eed44663a147e01a31f336ce"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"34baaa321ef737effe0038095b0dce41315ffcb2","unresolved":false,"context_lines":[{"line_number":2321,"context_line":"    def get_features(self):"},{"line_number":2322,"context_line":"        features \u003d []"},{"line_number":2323,"context_line":""},{"line_number":2324,"context_line":"        launch_security \u003d LibvirtConfigGuestSEVLaunchSecurity()"},{"line_number":2325,"context_line":"        launch_security.cbitpos \u003d self.cbitpos"},{"line_number":2326,"context_line":"        launch_security.reduced_phys_bits \u003d self.reduced_phys_bits"},{"line_number":2327,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_37064ed0","line":2324,"updated":"2019-02-12 16:42:26.000000000","message":"Based on my above comment, I think LibvirtConfigGuestSEVLaunchSecurity should be consumed by LibvirtConfigGuest, since \u003claunchSecurity\u003e is a top-level element under \u003cdomain\u003e.  That goes for both LibvirtConfigGuestSEVLaunchSecurity.format_dom() and LibvirtConfigGuestSEVLaunchSecurity.parse_dom() (which is currently missing).","commit_id":"8b7c533eb3ebd9e3eed44663a147e01a31f336ce"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"b46cf22523b6e92ec27752e7129fbae3ad00e162","unresolved":false,"context_lines":[{"line_number":2524,"context_line":"        root.append(perfs)"},{"line_number":2525,"context_line":""},{"line_number":2526,"context_line":"    def _format_sev(self, root):"},{"line_number":2527,"context_line":"        # memtune is required for sev, but is formatted in another method"},{"line_number":2528,"context_line":"        if self.launch_security is not None:"},{"line_number":2529,"context_line":"            root.append(self.launch_security.format_dom())"},{"line_number":2530,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_2df527cc","line":2527,"range":{"start_line":2527,"start_character":10,"end_line":2527,"end_character":17},"updated":"2019-06-03 11:18:22.000000000","message":"This comment is out of date: put \u0027\u003clocked/\u003e\u0027 instead of \u0027memtune\u0027.  If you are gonna mention that then you should probably also mention the iommu bits.","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"dadf4f50675e6c871ec95ee9abfa523a971b405e","unresolved":false,"context_lines":[{"line_number":2524,"context_line":"        root.append(perfs)"},{"line_number":2525,"context_line":""},{"line_number":2526,"context_line":"    def _format_sev(self, root):"},{"line_number":2527,"context_line":"        # memtune is required for sev, but is formatted in another method"},{"line_number":2528,"context_line":"        if self.launch_security is not None:"},{"line_number":2529,"context_line":"            root.append(self.launch_security.format_dom())"},{"line_number":2530,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_36f80fc3","line":2527,"range":{"start_line":2527,"start_character":10,"end_line":2527,"end_character":17},"in_reply_to":"9fb8cfa7_2df527cc","updated":"2019-06-03 17:45:03.000000000","message":"i just removed the comment completely, since it duplicates similar config in driver.py","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"605042ead20f77328f7446eb89eb6a69bc076b2c","unresolved":false,"context_lines":[{"line_number":2524,"context_line":"        root.append(perfs)"},{"line_number":2525,"context_line":""},{"line_number":2526,"context_line":"    def _format_sev(self, root):"},{"line_number":2527,"context_line":"        # memtune is required for sev, but is formatted in another method"},{"line_number":2528,"context_line":"        if self.launch_security is not None:"},{"line_number":2529,"context_line":"            root.append(self.launch_security.format_dom())"},{"line_number":2530,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_d68e532d","line":2527,"range":{"start_line":2527,"start_character":10,"end_line":2527,"end_character":17},"in_reply_to":"9fb8cfa7_36f80fc3","updated":"2019-06-03 17:45:54.000000000","message":"*similar comment","commit_id":"d70f677e785422126e7f2e1167116438b779da20"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cd3eb9576f341375dfc416004bf71dc374ec4c69","unresolved":false,"context_lines":[{"line_number":2501,"context_line":"    def __init__(self, **kwargs):"},{"line_number":2502,"context_line":"        super(LibvirtConfigGuestSEVLaunchSecurity, self).__init__("},{"line_number":2503,"context_line":"            root_name\u003d\u0027launchSecurity\u0027, **kwargs)"},{"line_number":2504,"context_line":""},{"line_number":2505,"context_line":"        self.cbitpos \u003d None"},{"line_number":2506,"context_line":"        self.reduced_phys_bits \u003d None"},{"line_number":2507,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"7faddb67_6c6724b9","line":2504,"updated":"2019-07-30 20:12:48.000000000","message":"nit: why not use\n\n self.cbitpos \u003d kwargs.pop(\u0027cbitpos\u0027, None)\n self.reduced_phys_bits \u003d kwargs.pop(\u0027reduced_phys_bits\u0027, None)\n\nso you can initialize with one LOC?\n\n(I see some of the objects above do this and some don\u0027t, so it\u0027s not like you\u0027re breaking precedent either way.)","commit_id":"5a675a649886921702abaf0b83fd2cecc927e337"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"17442d2a394724b2bd198dc300d02904671d2955","unresolved":false,"context_lines":[{"line_number":1591,"context_line":"                self.net_type \u003d\u003d \"vhostuser\"):"},{"line_number":1592,"context_line":""},{"line_number":1593,"context_line":"            drv_elem \u003d etree.Element(\"driver\")"},{"line_number":1594,"context_line":"            if self.driver_name:"},{"line_number":1595,"context_line":"                if self.net_type !\u003d \"vhostuser\":"},{"line_number":1596,"context_line":"                    # For vhostuser interface we should not set the driver"},{"line_number":1597,"context_line":"                    # name."},{"line_number":1598,"context_line":"                    drv_elem.set(\"name\", self.driver_name)"}],"source_content_type":"text/x-python","patch_set":35,"id":"7faddb67_ff722ead","line":1595,"range":{"start_line":1594,"start_character":31,"end_line":1595,"end_character":18},"updated":"2019-08-09 15:27:20.000000000","message":"nit: and","commit_id":"3867179a7b4f7ad34c6384357879e3b27f89df37"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"850896e2e792b77059e961fcf86b909c1f222cce","unresolved":false,"context_lines":[{"line_number":1591,"context_line":"                self.net_type \u003d\u003d \"vhostuser\"):"},{"line_number":1592,"context_line":""},{"line_number":1593,"context_line":"            drv_elem \u003d etree.Element(\"driver\")"},{"line_number":1594,"context_line":"            if self.driver_name:"},{"line_number":1595,"context_line":"                if self.net_type !\u003d \"vhostuser\":"},{"line_number":1596,"context_line":"                    # For vhostuser interface we should not set the driver"},{"line_number":1597,"context_line":"                    # name."},{"line_number":1598,"context_line":"                    drv_elem.set(\"name\", self.driver_name)"}],"source_content_type":"text/x-python","patch_set":35,"id":"7faddb67_4b76c4a6","line":1595,"range":{"start_line":1594,"start_character":31,"end_line":1595,"end_character":18},"in_reply_to":"7faddb67_ff722ead","updated":"2019-08-15 18:24:11.000000000","message":"Done","commit_id":"3867179a7b4f7ad34c6384357879e3b27f89df37"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"088d607ad27253c0b60e600d98702c36aad29c2c","unresolved":false,"context_lines":[{"line_number":989,"context_line":""},{"line_number":990,"context_line":"        dev.set(\"type\", self.source_type)"},{"line_number":991,"context_line":"        dev.set(\"device\", self.source_device)"},{"line_number":992,"context_line":"        if (self.driver_name is not None or"},{"line_number":993,"context_line":"            self.driver_format is not None or"},{"line_number":994,"context_line":"            self.driver_cache is not None or"},{"line_number":995,"context_line":"            self.driver_discard is not None or"},{"line_number":996,"context_line":"            self.driver_iommu):"},{"line_number":997,"context_line":"            drv \u003d etree.Element(\"driver\")"},{"line_number":998,"context_line":"            if self.driver_name is not None:"},{"line_number":999,"context_line":"                drv.set(\"name\", self.driver_name)"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_60a3ab44","line":996,"range":{"start_line":992,"start_character":0,"end_line":996,"end_character":31},"updated":"2019-08-30 09:56:24.000000000","message":"nit:\n\n    if any((self.driver_name, self.driver_format, self.driver_cache,\n            self.driver_discard, self.driver_iommu)):","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"d5245beba97340911fbe0b93a0dcea9413d868ab","unresolved":false,"context_lines":[{"line_number":989,"context_line":""},{"line_number":990,"context_line":"        dev.set(\"type\", self.source_type)"},{"line_number":991,"context_line":"        dev.set(\"device\", self.source_device)"},{"line_number":992,"context_line":"        if (self.driver_name is not None or"},{"line_number":993,"context_line":"            self.driver_format is not None or"},{"line_number":994,"context_line":"            self.driver_cache is not None or"},{"line_number":995,"context_line":"            self.driver_discard is not None or"},{"line_number":996,"context_line":"            self.driver_iommu):"},{"line_number":997,"context_line":"            drv \u003d etree.Element(\"driver\")"},{"line_number":998,"context_line":"            if self.driver_name is not None:"},{"line_number":999,"context_line":"                drv.set(\"name\", self.driver_name)"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_acaafcce","line":996,"range":{"start_line":992,"start_character":0,"end_line":996,"end_character":31},"in_reply_to":"7faddb67_60a3ab44","updated":"2019-08-30 13:51:04.000000000","message":"Nice, done.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a34a9fe49fde77978dc32bfb5e4a179d789c56e4","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"                drv.set(\"discard\", self.driver_discard)"},{"line_number":1006,"context_line":"            if self.driver_io is not None:"},{"line_number":1007,"context_line":"                drv.set(\"io\", self.driver_io)"},{"line_number":1008,"context_line":"            if self.driver_iommu:"},{"line_number":1009,"context_line":"                drv.set(\"iommu\", \"on\")"},{"line_number":1010,"context_line":"            dev.append(drv)"},{"line_number":1011,"context_line":""},{"line_number":1012,"context_line":"        if self.source_type \u003d\u003d \"file\":"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_10324ca8","line":1009,"range":{"start_line":1008,"start_character":12,"end_line":1009,"end_character":38},"updated":"2019-08-30 05:24:52.000000000","message":"I guess this is the case why we can\u0027t put the iommu into the base class.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"d5245beba97340911fbe0b93a0dcea9413d868ab","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"                drv.set(\"discard\", self.driver_discard)"},{"line_number":1006,"context_line":"            if self.driver_io is not None:"},{"line_number":1007,"context_line":"                drv.set(\"io\", self.driver_io)"},{"line_number":1008,"context_line":"            if self.driver_iommu:"},{"line_number":1009,"context_line":"                drv.set(\"iommu\", \"on\")"},{"line_number":1010,"context_line":"            dev.append(drv)"},{"line_number":1011,"context_line":""},{"line_number":1012,"context_line":"        if self.source_type \u003d\u003d \"file\":"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_8cdb807b","line":1009,"range":{"start_line":1008,"start_character":12,"end_line":1009,"end_character":38},"in_reply_to":"7faddb67_10324ca8","updated":"2019-08-30 13:51:04.000000000","message":"Sorry, not sure I understand?","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"088d607ad27253c0b60e600d98702c36aad29c2c","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                self.driver_cache \u003d c.get(\u0027cache\u0027)"},{"line_number":1088,"context_line":"                self.driver_discard \u003d c.get(\u0027discard\u0027)"},{"line_number":1089,"context_line":"                self.driver_io \u003d c.get(\u0027io\u0027)"},{"line_number":1090,"context_line":"                self.driver_iommu \u003d (c.get(\u0027iommu\u0027, \u0027\u0027) \u003d\u003d \"on\")"},{"line_number":1091,"context_line":"            elif c.tag \u003d\u003d \u0027source\u0027:"},{"line_number":1092,"context_line":"                if self.source_type \u003d\u003d \u0027file\u0027:"},{"line_number":1093,"context_line":"                    self.source_path \u003d c.get(\u0027file\u0027)"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_e06c7b08","line":1090,"range":{"start_line":1090,"start_character":36,"end_line":1090,"end_character":37},"updated":"2019-08-30 09:56:24.000000000","message":"nit: unnecessary","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"d5245beba97340911fbe0b93a0dcea9413d868ab","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                self.driver_cache \u003d c.get(\u0027cache\u0027)"},{"line_number":1088,"context_line":"                self.driver_discard \u003d c.get(\u0027discard\u0027)"},{"line_number":1089,"context_line":"                self.driver_io \u003d c.get(\u0027io\u0027)"},{"line_number":1090,"context_line":"                self.driver_iommu \u003d (c.get(\u0027iommu\u0027, \u0027\u0027) \u003d\u003d \"on\")"},{"line_number":1091,"context_line":"            elif c.tag \u003d\u003d \u0027source\u0027:"},{"line_number":1092,"context_line":"                if self.source_type \u003d\u003d \u0027file\u0027:"},{"line_number":1093,"context_line":"                    self.source_path \u003d c.get(\u0027file\u0027)"}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_cc78987f","line":1090,"range":{"start_line":1090,"start_character":36,"end_line":1090,"end_character":37},"in_reply_to":"7faddb67_e06c7b08","updated":"2019-08-30 13:51:04.000000000","message":"Done","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0f172744f0caf4c83ee7988e24ba520e97531943","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"        if self.cpu is not None:"},{"line_number":2695,"context_line":"            root.append(self.cpu.format_dom())"},{"line_number":2696,"context_line":""},{"line_number":2697,"context_line":"        self._format_devices(root)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"        self._format_idmaps(root)"},{"line_number":2700,"context_line":""},{"line_number":2701,"context_line":"        self._format_perf_events(root)"},{"line_number":2702,"context_line":""},{"line_number":2703,"context_line":"        self._format_sev(root)"},{"line_number":2704,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_b07ed818","line":2701,"range":{"start_line":2697,"start_character":8,"end_line":2701,"end_character":38},"updated":"2019-08-30 05:38:41.000000000","message":"Can we use check the self.launch_security early? Then we pass the sev_enabled flat to tose format method, then those config object can enable the iommu. Then this patch will become simple https://review.opendev.org/#/c/644565/46/nova/virt/libvirt/driver.py, we needn\u0027t check the sev everywhere, just have one on/off trigger in the beginning in the guest config object.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"76d38393ccbe3c26e59c4e4e41b42ab407ef0c3d","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"        if self.cpu is not None:"},{"line_number":2695,"context_line":"            root.append(self.cpu.format_dom())"},{"line_number":2696,"context_line":""},{"line_number":2697,"context_line":"        self._format_devices(root)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"        self._format_idmaps(root)"},{"line_number":2700,"context_line":""},{"line_number":2701,"context_line":"        self._format_perf_events(root)"},{"line_number":2702,"context_line":""},{"line_number":2703,"context_line":"        self._format_sev(root)"},{"line_number":2704,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_90de2368","line":2701,"range":{"start_line":2697,"start_character":8,"end_line":2701,"end_character":38},"in_reply_to":"7faddb67_0b7f6c17","updated":"2019-09-02 01:13:34.000000000","message":"oh, good, I saw you use the designer","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"bb3d93bdea5692b5417c0d63205c980679ff8cc4","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"        if self.cpu is not None:"},{"line_number":2695,"context_line":"            root.append(self.cpu.format_dom())"},{"line_number":2696,"context_line":""},{"line_number":2697,"context_line":"        self._format_devices(root)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"        self._format_idmaps(root)"},{"line_number":2700,"context_line":""},{"line_number":2701,"context_line":"        self._format_perf_events(root)"},{"line_number":2702,"context_line":""},{"line_number":2703,"context_line":"        self._format_sev(root)"},{"line_number":2704,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_d537ade2","line":2701,"range":{"start_line":2697,"start_character":8,"end_line":2701,"end_character":38},"in_reply_to":"7faddb67_8ccf0056","updated":"2019-09-01 16:11:00.000000000","message":"Eric agreed with this:\n\nhttp://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-08-30.log.html#t2019-08-30T14:09:25\n\nSo I\u0027ve changed https://review.opendev.org/#/c/644565/ to use this approach from PS48 onwards.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"16a072ff2aba6a2a48e7580b516818403a0233da","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"        if self.cpu is not None:"},{"line_number":2695,"context_line":"            root.append(self.cpu.format_dom())"},{"line_number":2696,"context_line":""},{"line_number":2697,"context_line":"        self._format_devices(root)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"        self._format_idmaps(root)"},{"line_number":2700,"context_line":""},{"line_number":2701,"context_line":"        self._format_perf_events(root)"},{"line_number":2702,"context_line":""},{"line_number":2703,"context_line":"        self._format_sev(root)"},{"line_number":2704,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_0b7f6c17","line":2701,"range":{"start_line":2697,"start_character":8,"end_line":2701,"end_character":38},"in_reply_to":"7faddb67_8ccf0056","updated":"2019-09-02 01:09:27.000000000","message":"Oh...my fault, I replied late. Just want to say maybe designer also a good idea.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"71292514dfd1c47e6d22a493dac4172c14925ed6","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"        if self.cpu is not None:"},{"line_number":2695,"context_line":"            root.append(self.cpu.format_dom())"},{"line_number":2696,"context_line":""},{"line_number":2697,"context_line":"        self._format_devices(root)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"        self._format_idmaps(root)"},{"line_number":2700,"context_line":""},{"line_number":2701,"context_line":"        self._format_perf_events(root)"},{"line_number":2702,"context_line":""},{"line_number":2703,"context_line":"        self._format_sev(root)"},{"line_number":2704,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_f01210b4","line":2701,"range":{"start_line":2697,"start_character":8,"end_line":2701,"end_character":38},"in_reply_to":"7faddb67_b07ed818","updated":"2019-08-30 06:03:46.000000000","message":"Maybe it isn\u0027t good to hide this logic inside format method. Or we add another method called \u0027enable_iommu\u0027 for LibvirtConfigGuest, then it iterates all the devices to enable iommu.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"change_message_id":"d5245beba97340911fbe0b93a0dcea9413d868ab","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"        if self.cpu is not None:"},{"line_number":2695,"context_line":"            root.append(self.cpu.format_dom())"},{"line_number":2696,"context_line":""},{"line_number":2697,"context_line":"        self._format_devices(root)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"        self._format_idmaps(root)"},{"line_number":2700,"context_line":""},{"line_number":2701,"context_line":"        self._format_perf_events(root)"},{"line_number":2702,"context_line":""},{"line_number":2703,"context_line":"        self._format_sev(root)"},{"line_number":2704,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"7faddb67_8ccf0056","line":2701,"range":{"start_line":2697,"start_character":8,"end_line":2701,"end_character":38},"in_reply_to":"7faddb67_f01210b4","updated":"2019-08-30 13:51:04.000000000","message":"I think your suggestion to have a single piece of code which checks for sev_enabled and then enables IOMMU might be a good one.  I already proposed this in June:\n\n  http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-06-20.log.html#t2019-06-20T14:01:19\n\nwhere I highlighted a theoretical issue with that approach:\n\n  http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-06-20.log.html#t2019-06-20T14:04:44\n\nHowever I never got feedback on whether we should worry about that issue.  So I would appreciate hearing opinions now.\n\n\u003e Can we use check the self.launch_security early? Then we pass the sev_enabled flat to tose format method, then those config object can enable the iommu.\n\nNo, I think that\u0027s wrong.  It\u0027s clearly stated at the top of config.py that it should not make any policy decisions:\n\n    \"\"\"\n    Configuration for libvirt objects.\n\n    Classes to represent the configuration of various libvirt objects\n    and support conversion to/from XML. These classes are solely concerned\n    by providing direct Object \u003c-\u003e XML document conversions. No policy or\n    operational decisions should be made by code in these classes. Such\n    policy belongs in the \u0027designer.py\u0027 module which provides simplified\n    helpers for populating up config object instances.\n    \"\"\"\n\nAnother minor issue with calling _format_sev() earlier would be that then the \u003claunchSecurity\u003e stuff would appear near the top of the domain, and that is inconsistent with the ordering in the various docs (and maybe even the way libvirt normalises the ordering) which all put it near the bottom.\n\n\u003e Maybe it isn\u0027t good to hide this logic inside format method. Or we add another method called \u0027enable_iommu\u0027 for LibvirtConfigGuest, then it iterates all the devices to enable iommu.\n\nAs per the above comment, I think designer.py is the right place to do this.  I am happy to do it, but first I want to make sure we all agree it\u0027s the right approach.","commit_id":"fe7dd7df1c2df74a3b94014040dbd87350d7d12d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"efa48127d66bbe1f28fb8e56444df469bcbdc918","unresolved":false,"context_lines":[{"line_number":1603,"context_line":"            if self.vhost_tx_queue_size is not None:"},{"line_number":1604,"context_line":"                drv_elem.set(\u0027tx_queue_size\u0027, str(self.vhost_tx_queue_size))"},{"line_number":1605,"context_line":""},{"line_number":1606,"context_line":"            if (drv_elem.get(\u0027name\u0027) or drv_elem.get(\u0027queues\u0027) or"},{"line_number":1607,"context_line":"                drv_elem.get(\u0027rx_queue_size\u0027) or"},{"line_number":1608,"context_line":"                drv_elem.get(\u0027tx_queue_size\u0027) or"},{"line_number":1609,"context_line":"                drv_elem.get(\u0027iommu\u0027)):"},{"line_number":1610,"context_line":"                # Append the driver element into the dom only if name"},{"line_number":1611,"context_line":"                # or queues or tx/rx or iommu attributes are set."},{"line_number":1612,"context_line":"                dev.append(drv_elem)"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_4093f64e","line":1609,"range":{"start_line":1606,"start_character":0,"end_line":1609,"end_character":39},"updated":"2019-09-02 10:16:10.000000000","message":"This could have been replaced with \u0027any\u0027 too","commit_id":"3941679aac721b46fe1b1d810fbce60f730c3294"}]}
