ia64/linux-2.6.18-xen.hg

diff drivers/xen/scsiback/scsiback.c @ 794:be85b1d7a52b

pvSCSI: add new device assignment mode

Add a new device assignment mode, which assigns whole HBA
(SCSI host) to guest domain. Current implementation requires SCSI
command emulation on backend driver, and it causes limitations for
some SCSI commands. (Please see
"http://www.xen.org/files/xensummit_tokyo/24_Hitoshi%20Matsumoto_en.pdf"
for detail about why we need the new assignment mode.

SCSI command emulation on backend driver is bypassed when "host" mode
is specified.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 17 11:17:11 2009 +0000 (2009-02-17)
parents 2fa1d9446f2f
children
line diff
     1.1 --- a/drivers/xen/scsiback/scsiback.c	Fri Feb 06 12:01:56 2009 +0000
     1.2 +++ b/drivers/xen/scsiback/scsiback.c	Tue Feb 17 11:17:11 2009 +0000
     1.3 @@ -232,7 +232,9 @@ static void scsiback_cmd_done(struct req
     1.4  			scsiback_print_status(sense_buffer, errors, pending_req);
     1.5  	}
     1.6  
     1.7 -	scsiback_rsp_emulation(pending_req);
     1.8 +	/* The Host mode is through as for Emulation. */
     1.9 +	if (pending_req->info->feature != VSCSI_TYPE_HOST)
    1.10 +		scsiback_rsp_emulation(pending_req);
    1.11  
    1.12  	scsiback_fast_flush_area(pending_req);
    1.13  	scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_req);
    1.14 @@ -616,7 +618,13 @@ static int scsiback_do_cmd_fn(struct vsc
    1.15  		}
    1.16  
    1.17  		if (pending_req->act == VSCSIIF_ACT_SCSI_CDB) {
    1.18 -			scsiback_req_emulation_or_cmdexec(pending_req);
    1.19 +
    1.20 +			/* The Host mode is through as for Emulation. */
    1.21 +			if (info->feature == VSCSI_TYPE_HOST)
    1.22 +				scsiback_cmd_exec(pending_req);
    1.23 +			else
    1.24 +				scsiback_req_emulation_or_cmdexec(pending_req);
    1.25 +
    1.26  		} else if (pending_req->act == VSCSIIF_ACT_SCSI_RESET) {
    1.27  			scsiback_device_reset_exec(pending_req);
    1.28  		} else {