pvSCSI: add new device assignment mode
PATCH 1/2 pvSCSI: add new device assignment mode
Attached is patch for pvSCSI driver.
SCSI command emulation on backend driver is bypassed when "host" mode is specified.
Signed-off-by Tomonari Horikoshi <[email protected]>
Signed-off-by Jun Kamada <[email protected]>
-----
Jun Kamada
drivers/xen/scsiback/common.h +3 -0
@@ -86,6 +86,8 @@ struct vscsibk_info {unsigned int evtchn;unsigned int irq; +int feature; +struct vscsiif_back_ring ring;struct vm_struct *ring_area;grant_handle_t shmem_handle;
@@ -143,6 +145,7 @@ typedef struct {#define VSCSIIF_TIMEOUT (900*HZ) +#define VSCSI_TYPE_HOST 1irqreturn_t scsiback_intr (int ,void *,struct pt_regs *); int scsiback_init_sring(struct vscsibk_info *info,
drivers/xen/scsiback/scsiback.c +10 -2
@@ -232,7 +232,9 @@ static void scsiback_cmd_done(struct reqscsiback_print_status (sense_buffer, errors, pending_req); } -scsiback_rsp_emulation (pending_req); +/* The Host mode is through as for Emulation. */ +if (pending_req->info->feature !=VSCSI_TYPE_HOST ) +scsiback_rsp_emulation (pending_req);scsiback_fast_flush_area (pending_req);scsiback_do_resp_with_sense (sense_buffer, errors, resid, pending_req);
@@ -616,7 +618,13 @@ static int scsiback_do_cmd_fn(struct vsc }if (pending_req->act ==VSCSIIF_ACT_SCSI_CDB ) { -scsiback_req_emulation_or_cmdexec (pending_req); + +/* The Host mode is through as for Emulation. */ +if (info->feature ==VSCSI_TYPE_HOST ) +scsiback_cmd_exec (pending_req); +else +scsiback_req_emulation_or_cmdexec (pending_req); + }else if (pending_req->act ==VSCSIIF_ACT_SCSI_RESET ) {scsiback_device_reset_exec (pending_req); }else {
drivers/xen/scsiback/xenbus.c +10 -0
@@ -301,6 +301,7 @@ static int scsiback_probe(struct xenbus_ const struct xenbus_device_id *id) {int err; +unsigned val =0 ;struct backend_info *be =kzalloc (sizeof (struct backend_info ),GFP_KERNEL );
@@ -325,8 +326,17 @@ static int scsiback_probe(struct xenbus_ be->info->dev = dev; be->info->irq =0 ; + be->info->feature =0 ;/*default not HOSTMODE.*/ scsiback_init_translation_table (be->info); + + err =xenbus_scanf (XBT_NIL , dev->nodename, +"feature-host" ,"%d" , &val); +if (XENBUS_EXIST_ERR (err)) + val =0 ; + +if (val) + be->info->feature =VSCSI_TYPE_HOST ; err =xenbus_switch_state (dev, XenbusStateInitWait);if (err)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel