linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi
@ 2013-03-07 15:26 Andy King
  2013-03-07 16:58 ` David Howells
  0 siblings, 1 reply; 5+ messages in thread
From: Andy King @ 2013-03-07 15:26 UTC (permalink / raw)
  To: netdev, linux-kernel, virtualization
  Cc: gregkh, davem, dhowells, pv-drivers, Andy King

Split the vSockets header into kernel and UAPI parts.  The former gets the bits
that used to be in __KERNEL__ guards, while the latter gets everything that is
user-visible.  Tested by compiling vsock (+transport) and a simple user-mode
vSockets application.

Reported-by: David Howells <dhowells@redhat.com>
Acked-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Andy King <acking@vmware.com>
---
 include/linux/vm_sockets.h      |   23 +++++++++++++++++++++++
 include/uapi/linux/vm_sockets.h |   23 ++++++++---------------
 2 files changed, 31 insertions(+), 15 deletions(-)
 create mode 100644 include/linux/vm_sockets.h

diff --git a/include/linux/vm_sockets.h b/include/linux/vm_sockets.h
new file mode 100644
index 0000000..0805eec
--- /dev/null
+++ b/include/linux/vm_sockets.h
@@ -0,0 +1,23 @@
+/*
+ * VMware vSockets Driver
+ *
+ * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef _VM_SOCKETS_H
+#define _VM_SOCKETS_H
+
+#include <uapi/linux/vm_sockets.h>
+
+int vm_sockets_get_local_cid(void);
+
+#endif /* _VM_SOCKETS_H */
diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h
index df91301..b4ed5d8 100644
--- a/include/uapi/linux/vm_sockets.h
+++ b/include/uapi/linux/vm_sockets.h
@@ -13,12 +13,10 @@
  * more details.
  */
 
-#ifndef _VM_SOCKETS_H_
-#define _VM_SOCKETS_H_
+#ifndef _UAPI_VM_SOCKETS_H
+#define _UAPI_VM_SOCKETS_H
 
-#if !defined(__KERNEL__)
-#include <sys/socket.h>
-#endif
+#include <linux/socket.h>
 
 /* Option name for STREAM socket buffer size.  Use as the option name in
  * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
@@ -137,14 +135,13 @@
 #define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
 
 /* Address structure for vSockets.   The address family should be set to
- * whatever vmci_sock_get_af_value_fd() returns.  The structure members should
- * all align on their natural boundaries without resorting to compiler packing
- * directives.  The total size of this structure should be exactly the same as
- * that of struct sockaddr.
+ * AF_VSOCK.  The structure members should all align on their natural
+ * boundaries without resorting to compiler packing directives.  The total size
+ * of this structure should be exactly the same as that of struct sockaddr.
  */
 
 struct sockaddr_vm {
-	sa_family_t svm_family;
+	__kernel_sa_family_t svm_family;
 	unsigned short svm_reserved1;
 	unsigned int svm_port;
 	unsigned int svm_cid;
@@ -156,8 +153,4 @@ struct sockaddr_vm {
 
 #define IOCTL_VM_SOCKETS_GET_LOCAL_CID		_IO(7, 0xb9)
 
-#if defined(__KERNEL__)
-int vm_sockets_get_local_cid(void);
-#endif
-
-#endif
+#endif /* _UAPI_VM_SOCKETS_H */
-- 
1.7.4.1


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

* Re: [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi
  2013-03-07 15:26 [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi Andy King
@ 2013-03-07 16:58 ` David Howells
  2013-03-07 23:24   ` Greg KH
  2013-03-08  1:09   ` David Howells
  0 siblings, 2 replies; 5+ messages in thread
From: David Howells @ 2013-03-07 16:58 UTC (permalink / raw)
  To: Andy King
  Cc: dhowells, netdev, linux-kernel, virtualization, gregkh, davem,
	pv-drivers

Andy King <acking@vmware.com> wrote:

> Split the vSockets header into kernel and UAPI parts.  The former gets the bits
> that used to be in __KERNEL__ guards, while the latter gets everything that is
> user-visible.  Tested by compiling vsock (+transport) and a simple user-mode
> vSockets application.
> 
> Reported-by: David Howells <dhowells@redhat.com>
> Acked-by: Dmitry Torokhov <dtor@vmware.com>
> Signed-off-by: Andy King <acking@vmware.com>

Acked-by: David Howells <dhowells@redhat.com>

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

* Re: [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi
  2013-03-07 16:58 ` David Howells
@ 2013-03-07 23:24   ` Greg KH
  2013-03-08  1:09   ` David Howells
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2013-03-07 23:24 UTC (permalink / raw)
  To: David Howells
  Cc: Andy King, netdev, linux-kernel, virtualization, davem, pv-drivers

On Thu, Mar 07, 2013 at 04:58:10PM +0000, David Howells wrote:
> Andy King <acking@vmware.com> wrote:
> 
> > Split the vSockets header into kernel and UAPI parts.  The former gets the bits
> > that used to be in __KERNEL__ guards, while the latter gets everything that is
> > user-visible.  Tested by compiling vsock (+transport) and a simple user-mode
> > vSockets application.
> > 
> > Reported-by: David Howells <dhowells@redhat.com>
> > Acked-by: Dmitry Torokhov <dtor@vmware.com>
> > Signed-off-by: Andy King <acking@vmware.com>
> 
> Acked-by: David Howells <dhowells@redhat.com>

David, is there any rush to get stuff like this into 3.9 for any
uapi-type changes, or can it just wait for 3.10?

thanks,

greg k-h

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

* Re: [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi
  2013-03-07 16:58 ` David Howells
  2013-03-07 23:24   ` Greg KH
@ 2013-03-08  1:09   ` David Howells
  2013-03-08 17:26     ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: David Howells @ 2013-03-08  1:09 UTC (permalink / raw)
  To: Greg KH
  Cc: dhowells, Andy King, netdev, linux-kernel, virtualization, davem,
	pv-drivers

Greg KH <gregkh@linuxfoundation.org> wrote:

> David, is there any rush to get stuff like this into 3.9 for any
> uapi-type changes, or can it just wait for 3.10?

Not especially.  It won't appear in userspace due to the __KERNEL__ guards.

David

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

* Re: [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi
  2013-03-08  1:09   ` David Howells
@ 2013-03-08 17:26     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-03-08 17:26 UTC (permalink / raw)
  To: dhowells; +Cc: gregkh, acking, netdev, linux-kernel, virtualization, pv-drivers

From: David Howells <dhowells@redhat.com>
Date: Fri, 08 Mar 2013 01:09:18 +0000

> Greg KH <gregkh@linuxfoundation.org> wrote:
> 
>> David, is there any rush to get stuff like this into 3.9 for any
>> uapi-type changes, or can it just wait for 3.10?
> 
> Not especially.  It won't appear in userspace due to the __KERNEL__ guards.

I've applied this to net-next, thanks.

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

end of thread, other threads:[~2013-03-08 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07 15:26 [PATCH] VSOCK: Split vm_sockets.h into kernel/uapi Andy King
2013-03-07 16:58 ` David Howells
2013-03-07 23:24   ` Greg KH
2013-03-08  1:09   ` David Howells
2013-03-08 17:26     ` David Miller

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).