diff options
author | Daniel Henrique Barboza <danielhb413@gmail.com> | 2018-06-27 14:24:30 -0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-06-29 13:02:50 +0200 |
commit | 0a96ca2437646bad197b0108c5f4a93e7ead05a9 (patch) | |
tree | 55870f81c3c2329c66373bea713f2465cd141050 /blockdev.c | |
parent | 2ad9b50f713053dcd6c44b2b5e3bbdb0cfe8a52d (diff) | |
download | qemu-0a96ca2437646bad197b0108c5f4a93e7ead05a9.zip |
hw/scsi: cleanups before VPD BL emulation
To add support for the emulation of Block Limits VPD page
for passthrough devices, a few adjustments in the current code
base is required to avoid repetition and improve clarity.
In scsi-generic.c, detach the Inquiry handling from
scsi_read_complete and put it into a new function called
scsi_handle_inquiry_reply. This change aims to avoid
cluttering of scsi_read_complete when we more logic in the
Inquiry response handling is added in the next patches,
centralizing the changes in the new function.
In scsi-disk.c, take the build of all emulated VPD pages
from scsi_disk_emulate_inquiry and make it available to
other files into a non-static function called
scsi_disk_emulate_vpd_page. Making it public will allow
the future VPD BL emulation code for passthrough devices
to use it from scsi-generic.c, avoiding copy/pasting this
code solely for that purpose. It also has the advantage of
providing emulation of all VPD pages in case we need to
emulate other pages in other scenarios. As a bonus,
scsi_disk_emulate_inquiry got tidier.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20180627172432.11120-2-danielhb413@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'blockdev.c')
0 files changed, 0 insertions, 0 deletions