DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: unlink existing file for server mode
@ 2018-02-02  8:39 Zhiyong Yang
       [not found] ` <CGME20180202152959eucas1p29e4663da3740566114fdb82045ee3caf@eucas1p2.samsung.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Zhiyong Yang @ 2018-02-02  8:39 UTC (permalink / raw)
  To: dev; +Cc: yliu, maxime.coquelin, Zhiyong Yang

Vhost-user startup will fail based on server mode, if the specified
socket file has already existed. The patch introduces function
unlink() to remove the possible existing file.

Cc: yliu@fridaylinux.org
Cc: maxime.coquelin@redhat.com

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 lib/librte_vhost/socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 6e3857e7a..324a24f4e 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -315,6 +315,7 @@ vhost_user_start_server(struct vhost_user_socket *vsocket)
 	int fd = vsocket->socket_fd;
 	const char *path = vsocket->path;
 
+	unlink(path);
 	ret = bind(fd, (struct sockaddr *)&vsocket->un, sizeof(vsocket->un));
 	if (ret < 0) {
 		RTE_LOG(ERR, VHOST_CONFIG,
-- 
2.13.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] vhost: unlink existing file for server mode
       [not found] ` <CGME20180202152959eucas1p29e4663da3740566114fdb82045ee3caf@eucas1p2.samsung.com>
@ 2018-02-02 15:29   ` Ilya Maximets
  2018-02-02 15:38     ` Richardson, Bruce
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Maximets @ 2018-02-02 15:29 UTC (permalink / raw)
  To: Zhiyong Yang, dev; +Cc: yliu, maxime.coquelin

Oh.

It's such a game: twice a year someone sends this patch to mail list.

I have another one for you:
* Find all the patches equal to this one in archives.
* Read all the discussions.
* Come back if you have some new ideas, not already discussed many times here.

Sorry for my sarcasm.
NACK for this, as usual.

Best regards, Ilya Maximets.

On 02.02.2018 11:39, Zhiyong Yang wrote:
> Vhost-user startup will fail based on server mode, if the specified
> socket file has already existed. The patch introduces function
> unlink() to remove the possible existing file.
> 
> Cc: yliu@fridaylinux.org
> Cc: maxime.coquelin@redhat.com
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
>  lib/librte_vhost/socket.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
> index 6e3857e7a..324a24f4e 100644
> --- a/lib/librte_vhost/socket.c
> +++ b/lib/librte_vhost/socket.c
> @@ -315,6 +315,7 @@ vhost_user_start_server(struct vhost_user_socket *vsocket)
>  	int fd = vsocket->socket_fd;
>  	const char *path = vsocket->path;
>  
> +	unlink(path);
>  	ret = bind(fd, (struct sockaddr *)&vsocket->un, sizeof(vsocket->un));
>  	if (ret < 0) {
>  		RTE_LOG(ERR, VHOST_CONFIG,
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] vhost: unlink existing file for server mode
  2018-02-02 15:29   ` [dpdk-dev] " Ilya Maximets
@ 2018-02-02 15:38     ` Richardson, Bruce
  2018-02-02 15:47       ` Ilya Maximets
  0 siblings, 1 reply; 4+ messages in thread
From: Richardson, Bruce @ 2018-02-02 15:38 UTC (permalink / raw)
  To: Ilya Maximets, Yang, Zhiyong, dev; +Cc: yliu, maxime.coquelin



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ilya Maximets
> Sent: Friday, February 2, 2018 3:30 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
> Cc: yliu@fridaylinux.org; maxime.coquelin@redhat.com
> Subject: Re: [dpdk-dev] vhost: unlink existing file for server mode
> 
> Oh.
> 
> It's such a game: twice a year someone sends this patch to mail list.
> 
> I have another one for you:
> * Find all the patches equal to this one in archives.
> * Read all the discussions.
> * Come back if you have some new ideas, not already discussed many times
> here.
> 
> Sorry for my sarcasm.
> NACK for this, as usual.
> 
> Best regards, Ilya Maximets.

Surely the fact of repeated patches is an indication that this should be
explicitly called out at appropriately places in the code via comments.
Far easier to provide people the info in the code they are changing than
expecting them to trawl through historical mailing list entries.

Regards,
/Bruce

> 
> On 02.02.2018 11:39, Zhiyong Yang wrote:
> > Vhost-user startup will fail based on server mode, if the specified
> > socket file has already existed. The patch introduces function
> > unlink() to remove the possible existing file.
> >
> > Cc: yliu@fridaylinux.org
> > Cc: maxime.coquelin@redhat.com
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > ---
> >  lib/librte_vhost/socket.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
> > index 6e3857e7a..324a24f4e 100644
> > --- a/lib/librte_vhost/socket.c
> > +++ b/lib/librte_vhost/socket.c
> > @@ -315,6 +315,7 @@ vhost_user_start_server(struct vhost_user_socket
> *vsocket)
> >  	int fd = vsocket->socket_fd;
> >  	const char *path = vsocket->path;
> >
> > +	unlink(path);
> >  	ret = bind(fd, (struct sockaddr *)&vsocket->un, sizeof(vsocket-
> >un));
> >  	if (ret < 0) {
> >  		RTE_LOG(ERR, VHOST_CONFIG,
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] vhost: unlink existing file for server mode
  2018-02-02 15:38     ` Richardson, Bruce
@ 2018-02-02 15:47       ` Ilya Maximets
  0 siblings, 0 replies; 4+ messages in thread
From: Ilya Maximets @ 2018-02-02 15:47 UTC (permalink / raw)
  To: Richardson, Bruce, Yang, Zhiyong, dev; +Cc: yliu, maxime.coquelin

On 02.02.2018 18:38, Richardson, Bruce wrote:
> 
> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ilya Maximets
>> Sent: Friday, February 2, 2018 3:30 PM
>> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
>> Cc: yliu@fridaylinux.org; maxime.coquelin@redhat.com
>> Subject: Re: [dpdk-dev] vhost: unlink existing file for server mode
>>
>> Oh.
>>
>> It's such a game: twice a year someone sends this patch to mail list.
>>
>> I have another one for you:
>> * Find all the patches equal to this one in archives.
>> * Read all the discussions.
>> * Come back if you have some new ideas, not already discussed many times
>> here.
>>
>> Sorry for my sarcasm.
>> NACK for this, as usual.
>>
>> Best regards, Ilya Maximets.
> 
> Surely the fact of repeated patches is an indication that this should be
> explicitly called out at appropriately places in the code via comments.
> Far easier to provide people the info in the code they are changing than
> expecting them to trawl through historical mailing list entries.
> 
> Regards,
> /Bruce
> 

Yes, you're right. We just discussed the situation locally in the office
and came to the exactly same conclusion. We definitely need the comment
here to prevent future unlink related patches.

>>
>> On 02.02.2018 11:39, Zhiyong Yang wrote:
>>> Vhost-user startup will fail based on server mode, if the specified
>>> socket file has already existed. The patch introduces function
>>> unlink() to remove the possible existing file.
>>>
>>> Cc: yliu@fridaylinux.org
>>> Cc: maxime.coquelin@redhat.com
>>>
>>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
>>> ---
>>>  lib/librte_vhost/socket.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
>>> index 6e3857e7a..324a24f4e 100644
>>> --- a/lib/librte_vhost/socket.c
>>> +++ b/lib/librte_vhost/socket.c
>>> @@ -315,6 +315,7 @@ vhost_user_start_server(struct vhost_user_socket
>> *vsocket)
>>>  	int fd = vsocket->socket_fd;
>>>  	const char *path = vsocket->path;
>>>
>>> +	unlink(path);
>>>  	ret = bind(fd, (struct sockaddr *)&vsocket->un, sizeof(vsocket-
>>> un));
>>>  	if (ret < 0) {
>>>  		RTE_LOG(ERR, VHOST_CONFIG,
>>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-02 15:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02  8:39 [dpdk-dev] [PATCH] vhost: unlink existing file for server mode Zhiyong Yang
     [not found] ` <CGME20180202152959eucas1p29e4663da3740566114fdb82045ee3caf@eucas1p2.samsung.com>
2018-02-02 15:29   ` [dpdk-dev] " Ilya Maximets
2018-02-02 15:38     ` Richardson, Bruce
2018-02-02 15:47       ` Ilya Maximets

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).