summary refs log tree commit diff stats
path: root/hw/scsi/scsi-generic.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-10-01 12:23:19 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-10-01 12:23:19 +0100
commit37a712a0f969ca2df7f01182409a6c4825cebfb5 (patch)
tree6eeb0b7f0bde4c8a0f8e1115b990530c5c62e9fe /hw/scsi/scsi-generic.c
parentcbba3dc6ea3fc9aa66e9f9eb41051536e3ad7cd0 (diff)
parent37aeb7a28ddbf52dd25dd53ae1b8391bc2287858 (diff)
downloadfocaccia-qemu-37a712a0f969ca2df7f01182409a6c4825cebfb5.tar.gz
focaccia-qemu-37a712a0f969ca2df7f01182409a6c4825cebfb5.zip
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
* SCSI fix (Dmitry, Li Feng, Li Qiang)
* memory API fixes (Eduardo)
* removal of deprecated '-numa node', 'cpu-add', '-smp' (Igor)
* ACPI fix for VMBus (Jon)
* relocatable install (myself)
* always remove docker containers (myself)
* serial cleanups (Philippe)
* vmware cpuid leaf for tsc and apic frequency (Sunil)
* KVM_FEATURE_ASYNC_PF_INT support (Vitaly)
* i386 XSAVE bugfix (Xiaoyao)
* QOM developer documentation in docs/devel (Eduardo)
* new checkpatch tests (Dov)
* x86_64 syscall fix (Douglas)
* interrupt-based APF fix (Vitaly)
* always create kvmclock (Vitaly)
* fix bios-tables-test (Eduardo)
* KVM PV features cleanup (myself)
* CAN FD (Pavel)

meson:
* fixes (Marc-André, Max, Stefan, Alexander, myself)
* moved libmpathpersist, cocoa, malloc tests (myself)
* support for 0.56 introspected test dependencies (myself)

# gpg: Signature made Wed 30 Sep 2020 18:11:45 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream: (86 commits)
  hw/net/can: Correct Kconfig dependencies
  hw/net/can: Documentation for CTU CAN FD IP open hardware core emulation.
  hw/net/can: CTU CAN FD IP open hardware core emulation.
  hw/net/can/ctucafd: Add CTU CAN FD core register definitions.
  net/can: Add can_dlc2len and can_len2dlc for CAN FD.
  hw/net/can: sja1000 ignore CAN FD frames
  net/can: Initial host SocketCan support for CAN FD.
  target/i386: kvm: do not use kvm_check_extension to find paravirtual capabilities
  bios-tables-test: Remove kernel-irqchip=off option
  target/i386: always create kvmclock device
  target/i386: Fix VM migration when interrupt based APF is enabled
  helper_syscall x86_64: clear exception_is_int
  checkpatch: Detect '%#' or '%0#' in printf-style format strings
  typedefs: Restrict PCMachineState to 'hw/i386/pc.h'
  hw/xen: Split x86-specific declaration from generic hardware ones
  stubs: Split accelerator / hardware related stubs
  sysemu/xen: Add missing 'exec/cpu-common.h' header for ram_addr_t type
  hw/i386/xen: Rename X86/PC specific function as xen_hvm_init_pc()
  docs: Move object.h overview doc comment to qom.rst
  docs: Create docs/devel/qom.rst
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/scsi/scsi-generic.c')
-rw-r--r--hw/scsi/scsi-generic.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 86ed0a3822..2cb23ca891 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -162,7 +162,8 @@ static void scsi_handle_inquiry_reply(SCSIGenericReq *r, SCSIDevice *s)
         }
     }
 
-    if (s->type == TYPE_DISK && (r->req.cmd.buf[1] & 0x01)) {
+    if ((s->type == TYPE_DISK || s->type == TYPE_ZBC) &&
+        (r->req.cmd.buf[1] & 0x01)) {
         page = r->req.cmd.buf[2];
         if (page == 0xb0) {
             uint32_t max_transfer =
@@ -299,10 +300,11 @@ static void scsi_read_complete(void * opaque, int ret)
     }
     blk_set_guest_block_size(s->conf.blk, s->blocksize);
 
-    /* Patch MODE SENSE device specific parameters if the BDS is opened
+    /*
+     * Patch MODE SENSE device specific parameters if the BDS is opened
      * readonly.
      */
-    if ((s->type == TYPE_DISK || s->type == TYPE_TAPE) &&
+    if ((s->type == TYPE_DISK || s->type == TYPE_TAPE || s->type == TYPE_ZBC) &&
         blk_is_read_only(s->conf.blk) &&
         (r->req.cmd.buf[0] == MODE_SENSE ||
          r->req.cmd.buf[0] == MODE_SENSE_10) &&
@@ -617,7 +619,7 @@ static void scsi_generic_read_device_identification(SCSIDevice *s)
 void scsi_generic_read_device_inquiry(SCSIDevice *s)
 {
     scsi_generic_read_device_identification(s);
-    if (s->type == TYPE_DISK) {
+    if (s->type == TYPE_DISK || s->type == TYPE_ZBC) {
         scsi_generic_set_vpd_bl_emulation(s);
     } else {
         s->needs_vpd_bl_emulation = false;