diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2022-08-30 08:38:27 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2022-09-27 07:32:30 +0200 |
commit | 12b69878fc7b4b92b1bbd3959f2c3d4c717881fb (patch) | |
tree | 63dc05ce5fb3aba25dffc251980849270a09da7e /include | |
parent | cea5aa85691d7f26b7ea995417d41a32802691b7 (diff) | |
download | qemu-12b69878fc7b4b92b1bbd3959f2c3d4c717881fb.zip qemu-12b69878fc7b4b92b1bbd3959f2c3d4c717881fb.tar.gz qemu-12b69878fc7b4b92b1bbd3959f2c3d4c717881fb.tar.bz2 |
usb/msd: add usb_msd_fatal_error() and fix guest-triggerable assert
Add handler for fatal errors. Moves device into error state where it
stops responding until the guest resets it.
Guest can send illegal requests where scsi command and usb packet
transfer directions are inconsistent. Use the new usb_msd_fatal_error()
function instead of assert() in that case.
Reported-by: Qiang Liu <cyruscyliu@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Qiang Liu <cyruscyliu@gmail.com>
Message-Id: <20220830063827.813053-3-kraxel@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/usb/msd.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/usb/msd.h b/include/hw/usb/msd.h index 54e9f38..f9fd862 100644 --- a/include/hw/usb/msd.h +++ b/include/hw/usb/msd.h @@ -40,6 +40,7 @@ struct MSDState { bool removable; bool commandlog; SCSIDevice *scsi_dev; + bool needs_reset; }; typedef struct MSDState MSDState; |