)]}'
{
  "commit": "7e573b660fefdebd21cb755d0d34bb5942fd3af3",
  "tree": "737fde9bfdd10a3427e725f8143462da8a214ed7",
  "parents": [
    "ba20257d9b45c28f23a66b3f79bebffd6322ff76"
  ],
  "author": {
    "name": "Fabiano Rosas",
    "email": "farosas@suse.de",
    "time": "Wed Jun 03 16:38:13 2026 -0300"
  },
  "committer": {
    "name": "Kevin Wolf",
    "email": "kwolf@redhat.com",
    "time": "Wed Jun 10 12:12:48 2026 +0200"
  },
  "message": "qed: Don\u0027t try to flush during incoming migration\n\nIt\u0027s not possible to access the image file while there is an incoming\nmigration in progress, the QEMU process doesn\u0027t hold any locks to the\nstorage at this point so nodes are inactive. Attempting to flush leads\nto an assert at bdrv_co_write_req_prepare():\n\n   assert(!(bs-\u003eopen_flags \u0026 BDRV_O_INACTIVE))\n\nThe issue is reproducible by running iotest 181 on a host under cpu\nload. The migration must coincide with the header already containing\nthe QED_F_NEED_CHECK flag.\n\nThe sequence of events is as follows, with the respective call stacks\nreferenced below:\n\nDuring block device init, bdrv_qed_attach_aio_context() starts the\n\u0027need_check\u0027 timer. The timer will not fire during incoming migration\nas it uses QEMU_CLOCK_VIRTUAL (to avoid this very issue, as the code\ncomment indicates).                                                   (0)\n\nHowever, there\u0027s still bdrv_qed_drain_begin() which uses the fact that\nthe timer is live to decide whether to start the\nqed_need_check_timer_entry() directly.                                (1)\n\nThe qed_need_check_timer_entry() eventually calls into\nqed_write_header() -\u003e bdrv_co_pwrite() leading to the assert.         (2)\n\nSkip creating the \u0027need_check\u0027 timer whenever the image is inactive.\n\nThe stacks:\n\n(0) \u003d\u003d issues timer_mod \u003d\u003d\n #6  in qed_start_need_check_timer       at ../block/qed.c:340\n #7  in bdrv_qed_attach_aio_context      at ../block/qed.c:373\n #8  in bdrv_qed_do_open                 at ../block/qed.c:556\n #9  in bdrv_qed_open_entry              at ../block/qed.c:582\n #10 in coroutine_trampoline             at ../util/coroutine-ucontext.c:175\n #0  in qemu_coroutine_switch\u003c+120\u003e      at ../util/coroutine-ucontext.c:321\n #1  in qemu_aio_coroutine_enter\u003c+356\u003e   at ../util/qemu-coroutine.c:293\n #2  in aio_co_enter\u003c+179\u003e               at ../util/async.c:710\n #3  in aio_co_wake\u003c+53\u003e                 at ../util/async.c:695\n #4  in thread_pool_co_cb\u003c+47\u003e           at ../util/thread-pool.c:283\n #5  in thread_pool_completion_bh\u003c+241\u003e  at ../util/thread-pool.c:202\n #6  in aio_bh_call\u003c+109\u003e                at ../util/async.c:173\n #7  in aio_bh_poll\u003c+299\u003e                at ../util/async.c:220\n #8  in aio_poll\u003c+690\u003e                   at ../util/aio-posix.c:745\n #9  in bdrv_qed_open\u003c+392\u003e              at ../block/qed.c:607\n #10 in bdrv_open_driver\u003c+327\u003e           at ../block.c:1678\n #11 in bdrv_open_common\u003c+1619\u003e          at ../block.c:2008\n #12 in bdrv_open_inherit\u003c+2556\u003e         at ../block.c:4191\n #13 in bdrv_open\u003c+118\u003e                  at ../block.c:4286\n #14 in blk_new_open\u003c+199\u003e               at ../block/block-backend.c:458\n #15 in blockdev_init\u003c+2011\u003e             at ../blockdev.c:612\n #16 in drive_new\u003c+3008\u003e                 at ../blockdev.c:1008\n #17 in drive_init_func\u003c+51\u003e             at ../system/vl.c:662\n #18 in qemu_opts_foreach\u003c+227\u003e          at ../util/qemu-option.c:1148\n #19 in configure_blockdev\u003c+350\u003e         at ../system/vl.c:721\n #20 in qemu_create_early_backends\u003c+343\u003e at ../system/vl.c:2076\n #21 in qemu_init\u003c+12483\u003e                at ../system/vl.c:3778\n #22 in main\u003c+46\u003e                        at ../system/main.c:71\n\n(1) \u003d\u003d sees timer_pending \u003d\u003d\n #6  in bdrv_qed_drain_begin             at ../block/qed.c:391\n #7  in bdrv_do_drained_begin            at ../block/io.c:366\n #8  in bdrv_do_drained_begin_quiesce    at ../block/io.c:386\n #9  in bdrv_child_cb_drained_begin      at ../block.c:1207\n #10 in bdrv_parent_drained_begin_single at ../block/io.c:133\n #11 in bdrv_parent_drained_begin        at ../block/io.c:64\n #12 in bdrv_do_drained_begin            at ../block/io.c:364\n #13 in bdrv_drained_begin               at ../block/io.c:393\n #14 in blk_drain                        at ../block/block-backend.c:2101\n #15 in blk_unref                        at ../block/block-backend.c:544\n #16 in bdrv_open_inherit                at ../block.c:4197\n #17 in bdrv_open                        at ../block.c:4286\n #18 in blk_new_open                     at ../block/block-backend.c:458\n #19 in blockdev_init                    at ../blockdev.c:612\n #20 in drive_new                        at ../blockdev.c:1008\n #21 in drive_init_func                  at ../system/vl.c:662\n #22 in qemu_opts_foreach                at ../util/qemu-option.c:1148\n #23 in configure_blockdev               at ../system/vl.c:721\n #24 in qemu_create_early_backends       at ../system/vl.c:2076\n #25 in qemu_init                        at ../system/vl.c:3778\n #26 in main                             at ../system/main.c:71\n\n(2) \u003d\u003d crashes \u003d\u003d\n #5  in __assert_fail (assertion\u003d\"!(bs-\u003eopen_flags \u0026 BDRV_O_INACTIVE)\", file\u003d\"../block/io.c\", line\u003d1977\n #6  in bdrv_co_write_req_prepare  at ../block/io.c:1977\n #7  in bdrv_aligned_pwritev       at ../block/io.c:2099\n #8  in bdrv_co_pwritev_part       at ../block/io.c:2316\n #9  in bdrv_co_pwritev            at ../block/io.c:2233\n #10 in bdrv_co_pwrite             at ../include/block/block_int-io.h:77\n #11 in qed_write_header           at ../block/qed.c:128\n #12 in qed_need_check_timer       at ../block/qed.c:305\n #13 in qed_need_check_timer_entry at ../block/qed.c:319\n\nNote that this issue is not exactly the same as what\u0027s been reported\nin Gitlab, but given how easily this reproduces, I imagine it has to\nbe happening in that setup as well.\n\nLink: https://gitlab.com/qemu-project/qemu/-/work_items/3515\nSigned-off-by: Fabiano Rosas \u003cfarosas@suse.de\u003e\nMessage-ID: \u003c20260603193813.2327596-1-farosas@suse.de\u003e\nReviewed-by: Stefan Hajnoczi \u003cstefanha@redhat.com\u003e\nReviewed-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\nSigned-off-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "da23a83d623a2e84dc2b10f79e672354b183b02b",
      "old_mode": 33188,
      "old_path": "block/qed.c",
      "new_id": "0eccfa21c98b6af6b95a51363eeae8f5d8f73526",
      "new_mode": 33188,
      "new_path": "block/qed.c"
    }
  ]
}
