From: Paolo Bonzini Date: Mon, 18 Apr 2011 12:29:16 +0000 (+0200) Subject: scsi-generic: Handle queue full X-Git-Tag: v0.15.0-rc0~237^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2e7cc4d604206ce15d298686c0ffd77dcedc33a2;p=qemu.git scsi-generic: Handle queue full The sg driver currently has a hardcoded limit of commands it can handle simultaneously. When this limit is reached the driver will return -EDOM. So we need to capture this to enable proper return values here. Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini Reviewed-by: Christoph Hellwig --- diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 579bab9e7..767060641 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -124,6 +124,9 @@ static void scsi_command_complete(void *opaque, int ret) if (ret != 0) { switch (ret) { + case -EDOM: + r->req.status = TASK_SET_FULL; + break; case -EINVAL: r->req.status = CHECK_CONDITION; scsi_set_sense(s, SENSE_CODE(INVALID_FIELD));