xs.h cannot include xenctrl.h
PATCH 1/1 xs.h cannot include xenctrl.h
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?
Regards,
Anthony Liguori
# HG changeset patch
# User Anthony Liguori <[email protected]>
# 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.
tools/libxc/xenctrl.h +14 -8
@@ -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>
tools/xenstore/xs_lib.h +18 -1
@@ -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 <[email protected]>
# Node ID 50540a0583f3d7837e4eb5ea9843f53636b58f29 # Parent 18897c2522a91e0c8c2486f0bb6fc70670d81a86 Fix up a few more places where headers need to be explicit.
tools/xenstore/xenstored_domain.c +1 -0
@@ -36,6 +36,7 @@#include "xenstored_watch.h" #include "xenstored_test.h" +#include <xenctrl.h> #include <xen/linux/evtchn.h> static int *xc_handle;
tools/xenstore/xs_lib.h +1 -0
@@ -41,6 +41,7 @@#endif +#include <xen/xen.h> #include <xen/io/xs_wire.h> /* Bitmask of permissions. */
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Anthony Liguori
xs.his LGPL.xenctrl.his GPL. Ifxs.hincludesxenctrl.hit implicitly makesxs.hGPL'd. The following patches remove thexenctrl.hdependency inxs.h.
Why not just make all headers LGPL (or less restrictive, e.g. BSD)? Don't many of these headers need to be referenced from OSes where software is typically BSD-licensed, anyway?
(BSD without the advertising clause is compatible with GPL and LGPL.)
Signature · 1 line
David Hopwood <[email protected]>
Quoted 10 lines · David Hopwood
Quoted 3 lines · Anthony Liguori
xs.his LGPL.xenctrl.his GPL. Ifxs.hincludesxenctrl.hit implicitly makesxs.hGPL'd. The following patches remove thexenctrl.hdependency inxs.h.Why not just make all headers LGPL (or less restrictive, e.g. BSD)? Don't many of these headers need to be referenced from OSes where software is typically BSD-licensed, anyway?
(BSD without the advertising clause is compatible with GPL and LGPL.)
libxenctrl is GPL. Anything that includes the header file ought also to be linking with libxenctrl, so just changing the header file license is something of a hack.
Getting rid of the dependency is the right answer I think.
-- Keir