WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xs.h cannot include xenctrl.h

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xs.h cannot include xenctrl.h
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Tue, 11 Oct 2005 11:02:11 -0500
Delivery-date: Tue, 11 Oct 2005 15:59:48 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050912)
xs.h is LGPL. xenctrl.h is GPL. If xs.h includes xenctrl.h it implicitly makes xs.h GPL'd. The following patches remove the xenctrl.h dependency in xs.h.

There's a hack to work around the problem of Xen's {u,s}{8,16,32,64} type usage. It would be nicer to have a common types header file in xen/include/public. Is there a right way to do this?

Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

Regards,

Anthony Liguori
# HG changeset patch
# User Anthony Liguori <anthony@xxxxxxxxxxxxx>
# Node ID 18897c2522a91e0c8c2486f0bb6fc70670d81a86
# Parent  4e335372ace84b605cebc36a42610caadb09a4d8
Having xs.h include xs_lib.h and then include xenctrl.h implicitly makes xs.h
GPL (instead of the intended LGPL) b/c of the nature of the GPL.

xs_lib.h only needs xenctrl.h for the xen type declarations.  Change the
xen types to be declared under a guard to avoid redefining in multiple places.

Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

diff -r 4e335372ace8 -r 18897c2522a9 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Tue Oct 11 15:23:19 2005 +0100
+++ b/tools/libxc/xenctrl.h     Tue Oct 11 10:44:33 2005 -0500
@@ -9,16 +9,22 @@
 #ifndef XENCTRL_H
 #define XENCTRL_H
 
+#ifndef _XEN_TYPES_
+#define _XEN_TYPES_
+
 #include <stdint.h>
 
-typedef uint8_t            u8;
-typedef uint16_t           u16;
-typedef uint32_t           u32;
-typedef uint64_t           u64;
-typedef int8_t             s8;
-typedef int16_t            s16;
-typedef int32_t            s32;
-typedef int64_t            s64;
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
+
+#endif
 
 #include <sys/ptrace.h>
 #include <xen/xen.h>
diff -r 4e335372ace8 -r 18897c2522a9 tools/xenstore/xs_lib.h
--- a/tools/xenstore/xs_lib.h   Tue Oct 11 15:23:19 2005 +0100
+++ b/tools/xenstore/xs_lib.h   Tue Oct 11 10:44:33 2005 -0500
@@ -22,8 +22,25 @@
 
 #include <stdbool.h>
 #include <limits.h>
-#include <xenctrl.h>
 #include <errno.h>
+
+#ifndef _XEN_TYPES_
+#define _XEN_TYPES_
+
+#include <stdint.h>
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
+
+#endif
+
 #include <xen/io/xs_wire.h>
 
 /* Bitmask of permissions. */
# HG changeset patch
# User Anthony Liguori <anthony@xxxxxxxxxxxxx>
# Node ID 50540a0583f3d7837e4eb5ea9843f53636b58f29
# Parent  18897c2522a91e0c8c2486f0bb6fc70670d81a86
Fix up a few more places where headers need to be explicit.

diff -r 18897c2522a9 -r 50540a0583f3 tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c Tue Oct 11 10:44:33 2005 -0500
+++ b/tools/xenstore/xenstored_domain.c Tue Oct 11 10:51:26 2005 -0500
@@ -36,6 +36,7 @@
 #include "xenstored_watch.h"
 #include "xenstored_test.h"
 
+#include <xenctrl.h>
 #include <xen/linux/evtchn.h>
 
 static int *xc_handle;
diff -r 18897c2522a9 -r 50540a0583f3 tools/xenstore/xs_lib.h
--- a/tools/xenstore/xs_lib.h   Tue Oct 11 10:44:33 2005 -0500
+++ b/tools/xenstore/xs_lib.h   Tue Oct 11 10:51:26 2005 -0500
@@ -41,6 +41,7 @@
 
 #endif
 
+#include <xen/xen.h>
 #include <xen/io/xs_wire.h>
 
 /* Bitmask of permissions. */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>