• Wanlong Gao's avatar
    virtio-scsi: redo allocation of target data · 5c370194
    Wanlong Gao authored
    virtio_scsi_target_state is now empty.  We will find new uses for it in
    the next few patches, so this patch does not drop it completely.
    
    And as James suggested, we use entries target_alloc and target_destroy
    in the host template to allocate and destroy the virtio_scsi_target_state
    of each target, attach this struct to scsi_target->hostdata. Now
    we can get at it from the sdev with scsi_target(sdev)->hostdata.
    No messing around with fixed size arrays and bulk memory allocation
    and no need to pass in the maximum target size as a parameter because
    everything should now happen dynamically.
    
    Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
    Cc: linux-scsi@vger.kernel.org
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
    Reviewed-by: default avatarAsias He <asias@redhat.com>
    Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
    5c370194
virtio_scsi.c 19.1 KB