)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8338,"name":"Eric Blake","email":"eblake@redhat.com","username":"eblake"},"change_message_id":"67e27a8d713b700ca6c7f22033e28e627c04a11c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"(wait_for_job logic)."},{"line_number":12,"context_line":"But in fact, at least for libvirt 1.3.3.2 and libvirt-python-1.2.17,"},{"line_number":13,"context_line":"we are not guaranteed to catch a job in such a state,"},{"line_number":14,"context_line":"before it dissapears and libvirt call returns empty result."},{"line_number":15,"context_line":"Which is represented in get_job_info() by"},{"line_number":16,"context_line":"BlockDeviceJobInfo(job\u003d0,bandwidth\u003d0,cur\u003d0,end\u003d0)."},{"line_number":17,"context_line":"Such result doesn\u0027t match wait_for_job finish criteria"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a98d1f4_3f3c232f","line":14,"updated":"2016-09-28 13:01:57.000000000","message":"Up to here is definitely true. Libvirt queries job state from qemu, and qemu quits reporting job state when the job is complete, which means it is common for libvirt to return an empty result (no job status available)","commit_id":"02c1c3807e71730594b25d79bfd2fd4019848f84"},{"author":{"_account_id":8338,"name":"Eric Blake","email":"eblake@redhat.com","username":"eblake"},"change_message_id":"67e27a8d713b700ca6c7f22033e28e627c04a11c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"we are not guaranteed to catch a job in such a state,"},{"line_number":14,"context_line":"before it dissapears and libvirt call returns empty result."},{"line_number":15,"context_line":"Which is represented in get_job_info() by"},{"line_number":16,"context_line":"BlockDeviceJobInfo(job\u003d0,bandwidth\u003d0,cur\u003d0,end\u003d0)."},{"line_number":17,"context_line":"Such result doesn\u0027t match wait_for_job finish criteria"},{"line_number":18,"context_line":"(effective since I45ac06eae0b1949f746dae305469718649bfcf23 is merged)."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a98d1f4_5f772f02","line":16,"updated":"2016-09-28 13:01:57.000000000","message":"This part sounds like Nova\u0027s bug for creating a state object in default state when libvirt has nothing to report.  Maybe you could make the default state for the object be cur\u003d-1/end\u003d-1, so that if cur and end are \u003e\u003d0 then you know the answer came from libvirt, and if they remain \u003c 0 you know that it was default-constructed because the job had no status and is therefore done.","commit_id":"02c1c3807e71730594b25d79bfd2fd4019848f84"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":8338,"name":"Eric Blake","email":"eblake@redhat.com","username":"eblake"},"change_message_id":"67e27a8d713b700ca6c7f22033e28e627c04a11c","unresolved":false,"context_lines":[{"line_number":17456,"context_line":""},{"line_number":17457,"context_line":"        domain.blockJobInfo(\u0027vda\u0027, flags\u003d0).AndReturn("},{"line_number":17458,"context_line":"            {\u0027type\u0027: 3, \u0027cur\u0027: 1, \u0027end\u0027: 1000})"},{"line_number":17459,"context_line":"        domain.blockJobInfo(\u0027vda\u0027, flags\u003d0).AndReturn({})"},{"line_number":17460,"context_line":""},{"line_number":17461,"context_line":"        self.mox.ReplayAll()"},{"line_number":17462,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a98d1f4_5f580f57","line":17459,"updated":"2016-09-28 13:01:57.000000000","message":"This change looks like it is emulating the fact that libvirt returns an empty struct when the job is complete, to make sure the rest of the code base handles the empty struct (in addition to a struct with len\u003d\u003dend) as a sign of completion. So it looks correct.","commit_id":"02c1c3807e71730594b25d79bfd2fd4019848f84"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":8338,"name":"Eric Blake","email":"eblake@redhat.com","username":"eblake"},"change_message_id":"67e27a8d713b700ca6c7f22033e28e627c04a11c","unresolved":false,"context_lines":[{"line_number":2090,"context_line":"                              instance\u003dinstance)"},{"line_number":2091,"context_line":""},{"line_number":2092,"context_line":"                while dev.wait_for_job(wait_for_job_clean\u003dTrue,"},{"line_number":2093,"context_line":"                                       abort_on_error\u003dTrue):"},{"line_number":2094,"context_line":"                    LOG.debug(\u0027waiting for blockRebase job completion\u0027,"},{"line_number":2095,"context_line":"                              instance\u003dinstance)"},{"line_number":2096,"context_line":"                    time.sleep(0.5)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a98d1f4_e21f8259","line":2093,"updated":"2016-09-28 13:01:57.000000000","message":"From just this diffstat, I don\u0027t know if wait_for_job() is doing the right thing with wait_for_job_clean\u003dTrue. If you are waiting for libvirt events, the receipt of BLOCK_JOB_COMPLETED would be a good thing to end the loop; otherwise you are polling until either len\u003d\u003dend or until there is no job status at all.  If that\u0027s what the wait_for_job_clean\u003dTrue parameter controls, then this patch is fine.","commit_id":"02c1c3807e71730594b25d79bfd2fd4019848f84"}]}
