diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-03-08 13:51:41 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-03-08 13:51:41 +0000 |
commit | 0436c55edf6b357ff56e2a5bf688df8636f83456 (patch) | |
tree | 31c44109513d0c7e8eca8a37279e51da7c0998ac /include | |
parent | 138d2931979cb7ee4a54a434a54088231f6980ff (diff) | |
parent | c715343fd96bcf93263fda38d81af815fdb5a7fa (diff) | |
download | qemu-0436c55edf6b357ff56e2a5bf688df8636f83456.zip qemu-0436c55edf6b357ff56e2a5bf688df8636f83456.tar.gz qemu-0436c55edf6b357ff56e2a5bf688df8636f83456.tar.bz2 |
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
* fix tracing vs -daemonize (Daniel)
* detect invalid CFI configuration (Daniele)
* 32-bit PVH fix (David)
* forward SCSI passthrough host-status to the SCSI HBA (Hannes)
* detect ill-formed id in QMP object-add (Kevin)
* miscellaneous bugfixes and cleanups (Keqian, Kostiantyn, myself, Peng Liang)
* add nodelay option for chardev (myself)
* deprecate -M kernel-irqchip=off on x86 (myself)
* keep .d files (myself)
* Fix -trace file (myself)
# gpg: Signature made Sat 06 Mar 2021 10:43:12 GMT
# 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: (23 commits)
meson: Stop if cfi is enabled with system slirp
trace: skip qemu_set_log_filename if no "-D" option was passed
trace: fix "-trace file=..."
meson: adjust timeouts for some slower tests
build-sys: invoke ninja with -d keepdepfile
qemu-option: do not suggest using the delay option
scsi: move host_status handling into SCSI drivers
scsi: inline sg_io_sense_from_errno() into the callers.
scsi-generic: do not snoop the output of failed commands
scsi: Add mapping for generic SCSI_HOST status to sense codes
scsi: Rename linux-specific SG_ERR codes to generic SCSI_HOST error codes
qemu-config: add error propagation to qemu_config_parse
x86/pvh: extract only 4 bytes of start address for 32 bit kernels
elf_ops: correct loading of 32 bit PVH kernel
lsilogic: Use PCIDevice::exit instead of DeviceState::unrealize
accel: kvm: Add aligment assert for kvm_log_clear_one_slot
accel: kvm: Fix memory waste under mismatch page size
vl.c: do not execute trace_init_backends() before daemonizing
qom: Check for wellformed id in user_creatable_add_type()
chardev: add nodelay option
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/elf_ops.h | 4 | ||||
-rw-r--r-- | include/hw/scsi/scsi.h | 5 | ||||
-rw-r--r-- | include/qemu/config-file.h | 5 | ||||
-rw-r--r-- | include/scsi/utils.h | 27 |
4 files changed, 25 insertions, 16 deletions
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 8e84368..78409ab 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -598,9 +598,7 @@ static int glue(load_elf, SZ)(const char *name, int fd, nhdr = glue(get_elf_note_type, SZ)(nhdr, file_size, ph->p_align, *(uint64_t *)translate_opaque); if (nhdr != NULL) { - bool is64 = - sizeof(struct elf_note) == sizeof(struct elf64_note); - elf_note_fn((void *)nhdr, (void *)&ph->p_align, is64); + elf_note_fn((void *)nhdr, (void *)&ph->p_align, SZ == 64); } data = NULL; } diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 5d992e6..0b726bc 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -27,7 +27,8 @@ struct SCSIRequest { uint32_t refcount; uint32_t tag; uint32_t lun; - uint32_t status; + int16_t status; + int16_t host_status; void *hba_private; size_t resid; SCSICommand cmd; @@ -123,6 +124,7 @@ struct SCSIBusInfo { int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, void *hba_private); void (*transfer_data)(SCSIRequest *req, uint32_t arg); + void (*fail)(SCSIRequest *req); void (*complete)(SCSIRequest *req, size_t resid); void (*cancel)(SCSIRequest *req); void (*change)(SCSIBus *bus, SCSIDevice *dev, SCSISense sense); @@ -177,6 +179,7 @@ void scsi_req_print(SCSIRequest *req); void scsi_req_continue(SCSIRequest *req); void scsi_req_data(SCSIRequest *req, int len); void scsi_req_complete(SCSIRequest *req, int status); +void scsi_req_complete_failed(SCSIRequest *req, int host_status); uint8_t *scsi_req_get_buf(SCSIRequest *req); int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len); void scsi_req_cancel_complete(SCSIRequest *req); diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index 2922610..8d3e53a 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -11,9 +11,10 @@ void qemu_add_drive_opts(QemuOptsList *list); int qemu_global_option(const char *str); void qemu_config_write(FILE *fp); -int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname); +int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname, + Error **errp); -int qemu_read_config_file(const char *filename); +int qemu_read_config_file(const char *filename, Error **errp); /* Parse QDict options as a replacement for a config file (allowing multiple enumerated (0..(n-1)) configuration "sections") */ diff --git a/include/scsi/utils.h b/include/scsi/utils.h index ff7c709..d5c8efa 100644 --- a/include/scsi/utils.h +++ b/include/scsi/utils.h @@ -16,6 +16,22 @@ enum SCSIXferMode { SCSI_XFER_TO_DEV, /* WRITE, MODE_SELECT, ... */ }; +enum SCSIHostStatus { + SCSI_HOST_OK, + SCSI_HOST_NO_LUN, + SCSI_HOST_BUSY, + SCSI_HOST_TIME_OUT, + SCSI_HOST_BAD_RESPONSE, + SCSI_HOST_ABORTED, + SCSI_HOST_ERROR = 0x07, + SCSI_HOST_RESET = 0x08, + SCSI_HOST_TRANSPORT_DISRUPTED = 0xe, + SCSI_HOST_TARGET_FAILURE = 0x10, + SCSI_HOST_RESERVATION_ERROR = 0x11, + SCSI_HOST_ALLOCATION_FAILURE = 0x12, + SCSI_HOST_MEDIUM_ERROR = 0x13, +}; + typedef struct SCSICommand { uint8_t buf[SCSI_CMD_BUF_SIZE]; int len; @@ -123,18 +139,9 @@ int scsi_cdb_length(uint8_t *buf); #ifdef CONFIG_LINUX #define SG_ERR_DRIVER_TIMEOUT 0x06 #define SG_ERR_DRIVER_SENSE 0x08 - -#define SG_ERR_DID_OK 0x00 -#define SG_ERR_DID_NO_CONNECT 0x01 -#define SG_ERR_DID_BUS_BUSY 0x02 -#define SG_ERR_DID_TIME_OUT 0x03 - -#define SG_ERR_DRIVER_SENSE 0x08 - -int sg_io_sense_from_errno(int errno_value, struct sg_io_hdr *io_hdr, - SCSISense *sense); #endif int scsi_sense_from_errno(int errno_value, SCSISense *sense); +int scsi_sense_from_host_status(uint8_t host_status, SCSISense *sense); #endif |