)]}'
{
  "commit": "fa4478d5c8b74a5f0c8b93cc00590ec007be5016",
  "tree": "7dd064b6cceff7e91f6e43ac67aa8ca99d5c93dc",
  "parents": [
    "4513eafe928ff47486f4167c28d364c72b5ff7e3"
  ],
  "author": {
    "name": "Paolo Bonzini",
    "email": "pbonzini@redhat.com",
    "time": "Tue May 08 16:51:46 2012 +0200"
  },
  "committer": {
    "name": "Kevin Wolf",
    "email": "kwolf@redhat.com",
    "time": "Thu May 10 10:32:12 2012 +0200"
  },
  "message": "block: wait for job callback in block_job_cancel_sync\n\nThe limitation on not having I/O after cancellation cannot really be\nkept.  Even streaming has a very small race window where you could\ncancel a job and have it report completion.  If this window is hit,\nbdrv_change_backing_file() will yield and possibly cause accesses to\ndangling pointers etc.\n\nSo, let\u0027s just assume that we cannot know exactly what will happen\nafter the coroutine has set busy to false.  We can set a very lax\ncondition:\n\n- if we cancel the job, the coroutine won\u0027t set it to false again\n(and hence will not call co_sleep_ns again).\n\n- block_job_cancel_sync will wait for the coroutine to exit, which\npretty much ensures no race.\n\nInstead, we track the coroutine that executes the job and put very\nstrict conditions on what to do while it is quiescent (busy \u003d false).\nFirst of all, the coroutine must never set busy \u003d false while the job\nhas been cancelled.  Second, the coroutine can be reentered arbitrarily\nwhile it is quiescent, so you cannot really do anything but co_sleep_ns at\nthat time.  This condition is obeyed by the block_job_sleep_ns function.\n\nSigned-off-by: Paolo Bonzini \u003cpbonzini@redhat.com\u003e\nSigned-off-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f9a11aa7a5243600cfb999446fc1e95c364da62c",
      "old_mode": 33188,
      "old_path": "block.c",
      "new_id": "2978135469a2c822392be39e4835ececd596c355",
      "new_mode": 33188,
      "new_path": "block.c"
    },
    {
      "type": "modify",
      "old_id": "b279acda7b1ae89518a6dc8b7840ca6c87f2e12e",
      "old_mode": 33188,
      "old_path": "block/stream.c",
      "new_id": "930e3cf37b10ef001a220aebcc449eb67ce05727",
      "new_mode": 33188,
      "new_path": "block/stream.c"
    },
    {
      "type": "modify",
      "old_id": "3bf23670b7e93f507a891e1c999f99ec4242ef16",
      "old_mode": 33188,
      "old_path": "block_int.h",
      "new_id": "b80e66db6ef64e71f44156bc5fae1e00d5a39dab",
      "new_mode": 33188,
      "new_path": "block_int.h"
    }
  ]
}
