diff mbox

vhost-scsi: return -ENOENT when no matching tcm_vhost_tpg found

Message ID 1369731284-4139-1-git-send-email-wenchaolinux@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wenchao Xia May 28, 2013, 8:54 a.m. UTC
ioctl for VHOST_SCSI_SET_ENDPOINT report file exist errori, when I forget
to set it correctly in configfs, make user confused. Actually it fail
to find a matching one, so change the error value.

Signed-off-by: Wenchao Xia <wenchaolinux@gmail.com>
---
 drivers/vhost/scsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Asias He May 28, 2013, 9:25 a.m. UTC | #1
On Tue, May 28, 2013 at 04:54:44PM +0800, Wenchao Xia wrote:
> ioctl for VHOST_SCSI_SET_ENDPOINT report file exist errori, when I forget
> to set it correctly in configfs, make user confused. Actually it fail
> to find a matching one, so change the error value.
> 
> Signed-off-by: Wenchao Xia <wenchaolinux@gmail.com>

Acked-by: Asias He <asias@redhat.com>

BTW, It would be nice to print more informative info in qemu when wwpn
is not available as well.

> ---
>  drivers/vhost/scsi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 7014202..6325b1d 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1219,7 +1219,7 @@ static int vhost_scsi_set_endpoint(
>  		}
>  		ret = 0;
>  	} else {
> -		ret = -EEXIST;
> +		ret = -ENOENT;
>  	}
>  
>  	/*
> -- 
> 1.7.1
>
Wenchao Xia June 12, 2013, 1:39 a.m. UTC | #2
cc to Greg for 3.9.

> On Tue, May 28, 2013 at 04:54:44PM +0800, Wenchao Xia wrote:
>> ioctl for VHOST_SCSI_SET_ENDPOINT report file exist errori, when I forget
>> to set it correctly in configfs, make user confused. Actually it fail
>> to find a matching one, so change the error value.
>>
>> Signed-off-by: Wenchao Xia <wenchaolinux@gmail.com>
>
> Acked-by: Asias He <asias@redhat.com>
>
> BTW, It would be nice to print more informative info in qemu when wwpn
> is not available as well.
>
>> ---
>>   drivers/vhost/scsi.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
>> index 7014202..6325b1d 100644
>> --- a/drivers/vhost/scsi.c
>> +++ b/drivers/vhost/scsi.c
>> @@ -1219,7 +1219,7 @@ static int vhost_scsi_set_endpoint(
>>   		}
>>   		ret = 0;
>>   	} else {
>> -		ret = -EEXIST;
>> +		ret = -ENOENT;
>>   	}
>>
>>   	/*
>> --
>> 1.7.1
>>
>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman June 12, 2013, 3:03 a.m. UTC | #3
On Wed, Jun 12, 2013 at 09:39:50AM +0800, wenchao wrote:
> cc to Greg for 3.9.

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 7014202..6325b1d 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1219,7 +1219,7 @@  static int vhost_scsi_set_endpoint(
 		}
 		ret = 0;
 	} else {
-		ret = -EEXIST;
+		ret = -ENOENT;
 	}
 
 	/*