Skip to contentSkip to conversation

vhost-net: comment use of invalid fd when setting vhost backend

PATCH In review Chris Wright 2 participants 3 messages Dec 22, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-net: comment use of invalid fd when setting vhost backend

This looks like an error case, but it's just a special case to shutdown the backend. Clarify with a comment.

---
 drivers/vhost/net.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/vhost/net.c +1 -0
index 22d5fef..cc92086 100644
@@ -465,6 +465,7 @@ static struct socket *get_tun_socket(int fd)
 static struct socket *get_socket(int fd)
 {
 	struct socket *sock;
+	/* special case to disable backend */
 	if (fd == -1)
 		return NULL;
 	sock = get_raw_socket(fd);
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Chris Wright

This looks like an error case, but it's just a special case to shutdown the backend. Clarify with a comment.

Quoted 16 lines
---
 drivers/vhost/net.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/vhost/net.c +1 -0
index 22d5fef..cc92086 100644
@@ -465,6 +465,7 @@ static struct socket *get_tun_socket(int fd)
 static struct socket *get_socket(int fd)
 {
 	struct socket *sock;
+	/* special case to disable backend */
 	if (fd == -1)
 		return NULL;
 	sock = get_raw_socket(fd);
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Chris Wright
Quoted 4 lines · Chris Wright

This looks like an error case, but it's just a special case to shutdown the backend. Clarify with a comment.

Quoted 16 lines
---
 drivers/vhost/net.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/vhost/net.c +1 -0
index 22d5fef..cc92086 100644
@@ -465,6 +465,7 @@ static struct socket *get_tun_socket(int fd)
 static struct socket *get_socket(int fd)
 {
 	struct socket *sock;
+	/* special case to disable backend */
 	if (fd == -1)
 		return NULL;
 	sock = get_raw_socket(fd);