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

2013-03-18 Thread Asias He
On Mon, Mar 18, 2013 at 11:30:57AM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 18, 2013 at 05:14:33PM +0800, Asias He wrote: > > On Mon, Mar 18, 2013 at 10:19:00AM +0200, Michael S. Tsirkin wrote: > > > On Fri, Mar 15, 2013 at 09:14:07AM +0800, Asias He wrote: > > > > Currently, vs->vs_endpoint

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

2013-03-18 Thread Michael S. Tsirkin
On Mon, Mar 18, 2013 at 05:14:33PM +0800, Asias He wrote: > On Mon, Mar 18, 2013 at 10:19:00AM +0200, Michael S. Tsirkin wrote: > > On Fri, Mar 15, 2013 at 09:14:07AM +0800, Asias He wrote: > > > Currently, vs->vs_endpoint is used indicate if the endpoint is setup or > > > not. It is set or cleared

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

2013-03-18 Thread Asias He
On Mon, Mar 18, 2013 at 10:19:00AM +0200, Michael S. Tsirkin wrote: > On Fri, Mar 15, 2013 at 09:14:07AM +0800, Asias He wrote: > > 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() u

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

2013-03-18 Thread Michael S. Tsirkin
On Fri, Mar 15, 2013 at 09:14:07AM +0800, Asias He wrote: > 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_handl

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

2013-03-14 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