device: 0.944 register: 0.799 graphic: 0.720 performance: 0.719 ppc: 0.566 files: 0.508 peripherals: 0.485 PID: 0.442 kernel: 0.423 semantic: 0.414 TCG: 0.382 virtual: 0.381 user-level: 0.376 architecture: 0.371 hypervisor: 0.368 vnc: 0.344 boot: 0.311 VMM: 0.307 debug: 0.303 socket: 0.300 risc-v: 0.273 network: 0.256 arm: 0.216 i386: 0.151 assembly: 0.103 mistranslation: 0.092 permissions: 0.059 x86: 0.038 KVM: 0.005 virtio-blk: BDRV_REQ_REGISTERED_BUF optimization hint crashes on macOS Description of problem: When using QEMU 7.2.0 on macOS with the virtio-blk drive, the process will exit and QMP shows a `BLOCK_IO_ERROR` event. This appears to be caused by this line: https://gitlab.com/qemu-project/qemu/-/blob/master/hw/block/virtio-blk.c#L405 introduced in https://gitlab.com/qemu-project/qemu/-/commit/baf422684d73c7bf38e2c18815e18d44fcf395b6 Commenting that line out fixes the issue. Steps to reproduce: 1. Run the QEMU command above with a Ubuntu 22.04 server ISO image. 2. Follow the installer and try to get to the end. 3. The process will crash before you can finish installing. Additional information: Following event appears on QMP: ``` { data = { action = report; device = "drive437EC806-41A4-4CCE-A747-713352E7C27C"; "node-name" = "#block785"; nospace = 0; operation = write; reason = "Invalid argument"; }; event = "BLOCK_IO_ERROR"; timestamp = { microseconds = 808474; seconds = 1671867673; }; } ```