Re: [PATCH V2 3/3] tcm_vhost: Use vq->private_data to indicate if the endpoint is setup

2013-03-14 Thread Asias He
On Thu, Mar 14, 2013 at 09:37:23AM +0100, Paolo Bonzini wrote: > Il 14/03/2013 03:07, Asias He ha scritto: > > On Wed, Mar 13, 2013 at 09:56:41AM +0100, Paolo Bonzini wrote: > >> Il 13/03/2013 08:34, Asias He ha scritto: > >>> Currently, vs->vs_endpoint is used indicate if the endpoint is setup or

Re: [PATCH V2 3/3] tcm_vhost: Use vq->private_data to indicate if the endpoint is setup

2013-03-14 Thread Paolo Bonzini
Il 14/03/2013 03:07, Asias He ha scritto: > On Wed, Mar 13, 2013 at 09:56:41AM +0100, Paolo Bonzini wrote: >> Il 13/03/2013 08:34, Asias He ha scritto: >>> Currently, vs->vs_endpoint is used indicate if the endpoint is setup or >>> not. It is set or cleared in vhost_scsi_set_endpoint() or >>> vhost

Re: [PATCH V2 3/3] tcm_vhost: Use vq->private_data to indicate if the endpoint is setup

2013-03-13 Thread Asias He
On Wed, Mar 13, 2013 at 09:56:41AM +0100, Paolo Bonzini wrote: > Il 13/03/2013 08:34, Asias He ha scritto: > > Currently, vs->vs_endpoint is used indicate if the endpoint is setup or > > not. It is set or cleared in vhost_scsi_set_endpoint() or > > vhost_scsi_clear_endpoint() under the vs->dev.mute

Re: [PATCH V2 3/3] tcm_vhost: Use vq->private_data to indicate if the endpoint is setup

2013-03-13 Thread Paolo Bonzini
Il 13/03/2013 08:34, Asias He ha scritto: > Currently, vs->vs_endpoint is used indicate if the endpoint is setup or > not. It is set or cleared in vhost_scsi_set_endpoint() or > vhost_scsi_clear_endpoint() under the vs->dev.mutex lock. However, when > we check it in vhost_scsi_handle_vq(), we ignor

[PATCH V2 3/3] tcm_vhost: Use vq->private_data to indicate if the endpoint is setup

2013-03-13 Thread Asias He
Currently, vs->vs_endpoint is used indicate if the endpoint is setup or not. It is set or cleared in vhost_scsi_set_endpoint() or vhost_scsi_clear_endpoint() under the vs->dev.mutex lock. However, when we check it in vhost_scsi_handle_vq(), we ignored the lock, this is wrong. Instead of using the