)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ccdfbfecbf621440b4093337e2e99b890623b930","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"103a85e7_7c73f579","updated":"2025-07-15 13:32:59.000000000","message":"I\u0027m OK with the direction. I have some comments inline and I will check the logs from a CI job to see the effect once it is available.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"209057e280ebb6b63d8365626904b895df9098bd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"abdccf74_a71268a9","updated":"2025-07-16 12:34:21.000000000","message":"Looked at the compute logs form the CI to see the patch in effect.\n\nI see two things\n1. In some cases we still log the XML piece we add and then log the diff as well which feels a bit redunant\n2. We might want to pretty-print the XML before diffing to generate a nicer diff\n\n```\nJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]: DEBUG nova.virt.libvirt.migration [None req-818d5485-4f72-446f-9fb6-cb0e050c1d4a tempest-LiveAutoBlockMigrationV225Test-1693809554 tempest-LiveAutoBlockMigrationV225Test-1693809554-project-admin] [instance: 17e2a60b-5419-4f4a-8b86-6da6d2258ca7] Updating guest XML with vif config: \u003cinterface type\u003d\"ethernet\"\u003e\n10596\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]:   \u003cmac address\u003d\"fa:16:3e:b1:ef:6c\"/\u003e\n10597\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]:   \u003cmodel type\u003d\"virtio\"/\u003e\n10598\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]:   \u003cdriver name\u003d\"qemu\"/\u003e\n10599\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]:   \u003cmtu size\u003d\"1372\"/\u003e\n10600\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]:   \u003ctarget dev\u003d\"tapc2cf374f-ff\"/\u003e\n10601\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]: \u003c/interface\u003e\n10602\tJul 15 12:48:19.218031 np0e0ee6ad2fb14 nova-compute[85757]:  {{(pid\u003d85757) _update_vif_xml /opt/stack/nova/nova/virt/libvirt/migration.py:563}}\n10603\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: DEBUG nova.virt.libvirt.migration [None req-818d5485-4f72-446f-9fb6-cb0e050c1d4a tempest-LiveAutoBlockMigrationV225Test-1693809554 tempest-LiveAutoBlockMigrationV225Test-1693809554-project-admin] XML changed by _update_vif_xml.\n10604\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: Diff:\n10605\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: --- a/_update_vif_xml_before\n10606\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: +++ b/_update_vif_xml_after\n10607\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: @@ -73,15 +73,8 @@\n10608\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]:        \u003caddress type\u003d\"pci\" domain\u003d\"0x0000\" bus\u003d\"0x00\" slot\u003d\"0x04\" function\u003d\"0x0\"/\u003e\n10609\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]:      \u003c/disk\u003e\n10610\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]:      \u003ccontroller type\u003d\"usb\" index\u003d\"0\" model\u003d\"none\"/\u003e\n10611\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -    \u003cinterface type\u003d\"ethernet\"\u003e\n10612\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -      \u003cmac address\u003d\"fa:16:3e:b1:ef:6c\"/\u003e\n10613\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -      \u003ctarget dev\u003d\"tapc2cf374f-ff\"/\u003e\n10614\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -      \u003cmodel type\u003d\"virtio\"/\u003e\n10615\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -      \u003cdriver name\u003d\"qemu\"/\u003e\n10616\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -      \u003cmtu size\u003d\"1372\"/\u003e\n10617\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -      \u003caddress type\u003d\"pci\" domain\u003d\"0x0000\" bus\u003d\"0x00\" slot\u003d\"0x03\" function\u003d\"0x0\"/\u003e\n10618\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -    \u003c/interface\u003e\n10619\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: -    \u003cserial type\u003d\"pty\"\u003e\n10620\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: +    \u003cinterface type\u003d\"ethernet\"\u003e\u003cmac address\u003d\"fa:16:3e:b1:ef:6c\"/\u003e\u003cmodel type\u003d\"virtio\"/\u003e\u003cdriver name\u003d\"qemu\"/\u003e\u003cmtu size\u003d\"1372\"/\u003e\u003ctarget dev\u003d\"tapc2cf374f-ff\"/\u003e\u003caddress type\u003d\"pci\" domain\u003d\"0x0000\" bus\u003d\"0x00\" slot\u003d\"0x03\" function\u003d\"0x0\"/\u003e\n10621\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]: +    \u003c/interface\u003e\u003cserial type\u003d\"pty\"\u003e\n10622\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]:        \u003clog file\u003d\"/opt/stack/data/nova/instances/17e2a60b-5419-4f4a-8b86-6da6d2258ca7/console.log\" append\u003d\"off\"/\u003e\n10623\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]:        \u003ctarget type\u003d\"isa-serial\" port\u003d\"0\"\u003e\n10624\tJul 15 12:48:19.219088 np0e0ee6ad2fb14 nova-compute[85757]:          \u003cmodel name\u003d\"isa-serial\"/\u003e\n```","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"ce7c9c29e80a1d2c5443b3d3ac69f5518843d156","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"bd35cc87_5760918a","in_reply_to":"abdccf74_a71268a9","updated":"2025-07-17 16:31:31.000000000","message":"yep i saw the issue with not pritty printing.that why is set workflow -1 but i actully also was wondering about that duplication.\n\ni look into adressign that.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"}],"nova/virt/libvirt/migration.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ccdfbfecbf621440b4093337e2e99b890623b930","unresolved":true,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def log_xml_diff(func):"},{"line_number":59,"context_line":"    \"\"\"A decorator that logs the XML diff if the XML document is changed"},{"line_number":60,"context_line":"    by the decorated function."},{"line_number":61,"context_line":"    \"\"\""},{"line_number":62,"context_line":"    def wrapper(xml_doc, *args, **kwargs):"},{"line_number":63,"context_line":"        # Convert the initial xml_doc to a string for comparison"}],"source_content_type":"text/x-python","patch_set":1,"id":"a1b70743_18637161","line":60,"updated":"2025-07-15 13:32:59.000000000","message":"nit: I would note here that the decorator assumes that decorated func\u0027s first positional parameter is an XML document considered as the based of the diff, and the return value of the func is another XML document considered as the new XML for the diff.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"99cc7c24bf41a71bd98be1e6b04487f1b0e96dd3","unresolved":true,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def log_xml_diff(func):"},{"line_number":59,"context_line":"    \"\"\"A decorator that logs the XML diff if the XML document is changed"},{"line_number":60,"context_line":"    by the decorated function."},{"line_number":61,"context_line":"    \"\"\""},{"line_number":62,"context_line":"    def wrapper(xml_doc, *args, **kwargs):"},{"line_number":63,"context_line":"        # Convert the initial xml_doc to a string for comparison"}],"source_content_type":"text/x-python","patch_set":1,"id":"2e828c08_7a0b4a2c","line":60,"in_reply_to":"a1b70743_18637161","updated":"2025-07-15 16:53:06.000000000","message":"ya i can add a note to that effect. it was true of all but one of the function which i updated to follwo that patteren.\n\ni considered doing something more elaberate but this was ok.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ccdfbfecbf621440b4093337e2e99b890623b930","unresolved":true,"context_lines":[{"line_number":82,"context_line":"                tofile\u003df\u0027b/{func.__name__}_after\u0027,"},{"line_number":83,"context_line":"            )"},{"line_number":84,"context_line":"            LOG.debug("},{"line_number":85,"context_line":"                f\"XML changed by {func.__name__}.\\nDiff:\\n{\u0027\u0027.join(diff)}\")"},{"line_number":86,"context_line":"        return updated_xml_doc"},{"line_number":87,"context_line":"    return wrapper"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"f0a8d8c6_742d664f","line":85,"updated":"2025-07-15 13:32:59.000000000","message":"I\u0027m not sure we are supposed to have f strings in LOG statements. I think the reason to use a string and *args passed to LOG is that it only does the string formatting if the log level is enabled.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"209057e280ebb6b63d8365626904b895df9098bd","unresolved":true,"context_lines":[{"line_number":82,"context_line":"                tofile\u003df\u0027b/{func.__name__}_after\u0027,"},{"line_number":83,"context_line":"            )"},{"line_number":84,"context_line":"            LOG.debug("},{"line_number":85,"context_line":"                f\"XML changed by {func.__name__}.\\nDiff:\\n{\u0027\u0027.join(diff)}\")"},{"line_number":86,"context_line":"        return updated_xml_doc"},{"line_number":87,"context_line":"    return wrapper"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ea4dea50_d92dc0fc","line":85,"in_reply_to":"9564047c_0f2564b6","updated":"2025-07-16 12:34:21.000000000","message":"Yeah you are right that the heavy lifting is already happened at that point. You can ignore my comment here.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"ce7c9c29e80a1d2c5443b3d3ac69f5518843d156","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                tofile\u003df\u0027b/{func.__name__}_after\u0027,"},{"line_number":83,"context_line":"            )"},{"line_number":84,"context_line":"            LOG.debug("},{"line_number":85,"context_line":"                f\"XML changed by {func.__name__}.\\nDiff:\\n{\u0027\u0027.join(diff)}\")"},{"line_number":86,"context_line":"        return updated_xml_doc"},{"line_number":87,"context_line":"    return wrapper"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7699be14_596f4a0a","line":85,"in_reply_to":"ea4dea50_d92dc0fc","updated":"2025-07-17 16:31:31.000000000","message":"Acknowledged","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"99cc7c24bf41a71bd98be1e6b04487f1b0e96dd3","unresolved":true,"context_lines":[{"line_number":82,"context_line":"                tofile\u003df\u0027b/{func.__name__}_after\u0027,"},{"line_number":83,"context_line":"            )"},{"line_number":84,"context_line":"            LOG.debug("},{"line_number":85,"context_line":"                f\"XML changed by {func.__name__}.\\nDiff:\\n{\u0027\u0027.join(diff)}\")"},{"line_number":86,"context_line":"        return updated_xml_doc"},{"line_number":87,"context_line":"    return wrapper"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9564047c_0f2564b6","line":85,"in_reply_to":"f0a8d8c6_742d664f","updated":"2025-07-15 16:53:06.000000000","message":"hum i thought that we avopid doign present interpolation organically because of translation not performance.\n\nwe have already compute the diff at this point which is arguab the more expensive operation.\n\nif that the reason that fells like an unnecessary micro optimisation.\ni can modify it to use a format sormat string and pass extra opts but i think fstring would actually be better long term.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"99cc7c24bf41a71bd98be1e6b04487f1b0e96dd3","unresolved":true,"context_lines":[{"line_number":91,"context_line":"                          get_vif_config\u003dNone, new_resources\u003dNone):"},{"line_number":92,"context_line":"    xml_doc \u003d etree.fromstring(guest.get_xml_desc(dump_migratable\u003dTrue))"},{"line_number":93,"context_line":"    LOG.debug(\u0027get_updated_guest_xml input xml\u003d%s\u0027,"},{"line_number":94,"context_line":"              etree.tostring(xml_doc, encoding\u003d\u0027unicode\u0027, pretty_print\u003dTrue))"},{"line_number":95,"context_line":"    xml_doc \u003d _update_graphics_xml(xml_doc, migrate_data)"},{"line_number":96,"context_line":"    xml_doc \u003d _update_serial_xml(xml_doc, migrate_data)"},{"line_number":97,"context_line":"    xml_doc \u003d _update_volume_xml("}],"source_content_type":"text/x-python","patch_set":1,"id":"9ea1b7ad_4cca25c4","line":94,"updated":"2025-07-15 16:53:06.000000000","message":"for example here all the heavy work is in the call to etree.toostring\n\nso defering rendering of the final string does not save much.","commit_id":"89c0ca48567117238a203db49ae3384a8d8bc662"}]}
