)]}'
{
  "commit": "ca66df878ef7fd6f5fdaedcebbbadcf12b60bc08",
  "tree": "75c0c90373c497659cdafc31559043203a6738dc",
  "parents": [
    "4382f167cfbc21a49424e6dd9347681008363128"
  ],
  "author": {
    "name": "Stefan Hajnoczi",
    "email": "stefanha@redhat.com",
    "time": "Tue May 16 15:02:22 2023 -0400"
  },
  "committer": {
    "name": "Kevin Wolf",
    "email": "kwolf@redhat.com",
    "time": "Tue May 30 17:32:02 2023 +0200"
  },
  "message": "virtio-scsi: stop using aio_disable_external() during unplug\n\nThis patch is part of an effort to remove the aio_disable_external()\nAPI because it does not fit in a multi-queue block layer world where\nmany AioContexts may be submitting requests to the same disk.\n\nThe SCSI emulation code is already in good shape to stop using\naio_disable_external(). It was only used by commit 9c5aad84da1c\n(\"virtio-scsi: fixed virtio_scsi_ctx_check failed when detaching scsi\ndisk\") to ensure that virtio_scsi_hotunplug() works while the guest\ndriver is submitting I/O.\n\nEnsure virtio_scsi_hotunplug() is safe as follows:\n\n1. qdev_simple_device_unplug_cb() -\u003e qdev_unrealize() -\u003e\n   device_set_realized() calls qatomic_set(\u0026dev-\u003erealized, false) so\n   that future scsi_device_get() calls return NULL because they exclude\n   SCSIDevices with realized\u003dfalse.\n\n   That means virtio-scsi will reject new I/O requests to this\n   SCSIDevice with VIRTIO_SCSI_S_BAD_TARGET even while\n   virtio_scsi_hotunplug() is still executing. We are protected against\n   new requests!\n\n2. scsi_qdev_unrealize() already contains a call to\n   scsi_device_purge_requests() so that in-flight requests are cancelled\n   synchronously. This ensures that no in-flight requests remain once\n   qdev_simple_device_unplug_cb() returns.\n\nThanks to these two conditions we don\u0027t need aio_disable_external()\nanymore.\n\nCc: Zhengui Li \u003clizhengui@huawei.com\u003e\nReviewed-by: Paolo Bonzini \u003cpbonzini@redhat.com\u003e\nReviewed-by: Daniil Tatianin \u003cd-tatianin@yandex-team.ru\u003e\nSigned-off-by: Stefan Hajnoczi \u003cstefanha@redhat.com\u003e\nReviewed-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\nMessage-Id: \u003c20230516190238.8401-5-stefanha@redhat.com\u003e\nSigned-off-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ae314af3de371e19ffd021cd79e286820556e5f5",
      "old_mode": 33188,
      "old_path": "hw/scsi/virtio-scsi.c",
      "new_id": "c1a7ea9ae272af95cba8943cc45c95d9e04f891f",
      "new_mode": 33188,
      "new_path": "hw/scsi/virtio-scsi.c"
    }
  ]
}
