)]}'
{
  "commit": "bfa36802d1704fc413c590ebdcc4e5ae0eacf439",
  "tree": "e2a89c971e65e7c35a5ba1fc68fa11c1a19307f2",
  "parents": [
    "52bff01f64eec017ffb0d5903a0ee1d67ca7a548"
  ],
  "author": {
    "name": "Stefan Hajnoczi",
    "email": "stefanha@redhat.com",
    "time": "Mon Jan 22 12:26:25 2024 -0500"
  },
  "committer": {
    "name": "Kevin Wolf",
    "email": "kwolf@redhat.com",
    "time": "Thu Feb 08 09:37:33 2024 +0100"
  },
  "message": "virtio-blk: avoid using ioeventfd state in irqfd conditional\n\nRequests that complete in an IOThread use irqfd to notify the guest\nwhile requests that complete in the main loop thread use the traditional\nqdev irq code path. The reason for this conditional is that the irq code\npath requires the BQL:\n\n  if (s-\u003eioeventfd_started \u0026\u0026 !s-\u003eioeventfd_disabled) {\n      virtio_notify_irqfd(vdev, req-\u003evq);\n  } else {\n      virtio_notify(vdev, req-\u003evq);\n  }\n\nThere is a corner case where the conditional invokes the irq code path\ninstead of the irqfd code path:\n\n  static void virtio_blk_stop_ioeventfd(VirtIODevice *vdev)\n  {\n      ...\n      /*\n       * Set -\u003eioeventfd_started to false before draining so that host notifiers\n       * are not detached/attached anymore.\n       */\n      s-\u003eioeventfd_started \u003d false;\n\n      /* Wait for virtio_blk_dma_restart_bh() and in flight I/O to complete */\n      blk_drain(s-\u003econf.conf.blk);\n\nDuring blk_drain() the conditional produces the wrong result because\nioeventfd_started is false.\n\nUse qemu_in_iothread() instead of checking the ioeventfd state.\n\nCc: qemu-stable@nongnu.org\nBuglink: https://issues.redhat.com/browse/RHEL-15394\nSigned-off-by: Stefan Hajnoczi \u003cstefanha@redhat.com\u003e\nMessage-ID: \u003c20240122172625.415386-1-stefanha@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": "4ca5e632ea080df220482d890e83f0e331165816",
      "old_mode": 33188,
      "old_path": "hw/block/virtio-blk.c",
      "new_id": "738cb2ac367d1349dbc67ba53f7bcf799a590e40",
      "new_mode": 33188,
      "new_path": "hw/block/virtio-blk.c"
    }
  ]
}
