[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: Rationalise #includes



# HG changeset patch
# User Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
# Date 1323712120 0
# Node ID 27328e5242ba7f5510d9acd9151f2abacd41791f
# Parent  839104611fd8cbd10fd2d8075f0777cc4b392689
libxl: Rationalise #includes

libxl_internal.h now #includes libxl.h and various system headers.

This
 1. makes the order of header inclusion more predictable
 2. explicitly allows libxl_internal.h to use objects defined in libxl.h
 3. removes the need for individual files to include these headers

Also
 - remove some unnecessary #includes of libxl_utils.h,
   flexarray.h, etc. in some libxl*.c files,
 - include libxl_osdeps.h at the top of libxl_internal.h
 - add missing includes of libxl_osdeps.h to a couple of files
 - change libxl.h to libxl_internal.h in a couple of files

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl.c       Mon Dec 12 17:48:40 2011 +0000
@@ -31,10 +31,7 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include "libxl.h"
-#include "libxl_utils.h"
 #include "libxl_internal.h"
-#include "flexarray.h"
 
 #define PAGE_TO_MEMKB(pages) ((pages) * 4)
 #define BACKEND_STRING_SIZE 5
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c       Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_blktap2.c       Mon Dec 12 17:48:40 2011 +0000
@@ -12,7 +12,6 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl.h"
 #include "libxl_osdeps.h"
 #include "libxl_internal.h"
 
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c    Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_bootloader.c    Mon Dec 12 17:48:40 2011 +0000
@@ -14,7 +14,6 @@
 
 #include "libxl_osdeps.h"
 
-#include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <termios.h>
@@ -22,11 +21,8 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
 
-#include "flexarray.h"
-
 #define XENCONSOLED_BUF_SIZE 16
 #define BOOTLOADER_BUF_SIZE 4096
 #define BOOTLOADER_TIMEOUT 1
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_cpuid.c
--- a/tools/libxl/libxl_cpuid.c Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_cpuid.c Mon Dec 12 17:48:40 2011 +0000
@@ -10,10 +10,6 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include <string.h>
-
-#include "libxl.h"
-#include "libxl_osdeps.h"
 #include "libxl_internal.h"
 
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_create.c        Mon Dec 12 17:48:40 2011 +0000
@@ -26,10 +26,8 @@
 #include <xc_dom.h>
 #include <xenguest.h>
 #include <assert.h>
-#include "libxl.h"
-#include "libxl_utils.h"
+
 #include "libxl_internal.h"
-#include "flexarray.h"
 
 void libxl_domain_config_dispose(libxl_domain_config *d_config)
 {
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_device.c        Mon Dec 12 17:48:40 2011 +0000
@@ -24,7 +24,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
 
 char *libxl__device_frontend_path(libxl__gc *gc, libxl__device *device)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_dm.c    Mon Dec 12 17:48:40 2011 +0000
@@ -24,10 +24,8 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <assert.h>
-#include "libxl_utils.h"
+
 #include "libxl_internal.h"
-#include "libxl.h"
-#include "flexarray.h"
 
 static const char *libxl_tapif_script(libxl__gc *gc)
 {
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_dom.c   Mon Dec 12 17:48:40 2011 +0000
@@ -32,7 +32,6 @@
 
 #include <xen/hvm/hvm_info_table.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
 
 libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c  Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_exec.c  Mon Dec 12 17:48:40 2011 +0000
@@ -28,7 +28,6 @@
 #include <signal.h> /* for SIGKILL */
 #include <fcntl.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
 
 static int call_waitpid(pid_t (*waitpid_cb)(pid_t, int *, int), pid_t pid, int 
*status, int options)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_flask.c
--- a/tools/libxl/libxl_flask.c Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_flask.c Mon Dec 12 17:48:40 2011 +0000
@@ -7,13 +7,14 @@
  *  as published by the Free Software Foundation.
  */
 
+#include "libxl_osdeps.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include <xenctrl.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c      Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_internal.c      Mon Dec 12 17:48:40 2011 +0000
@@ -16,8 +16,6 @@
 #include "libxl_osdeps.h"
 
 #include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -25,9 +23,7 @@
 #include <sys/mman.h>
 #include <unistd.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
-#include "libxl_utils.h"
 
 int libxl__error_set(libxl__gc *gc, int code)
 {
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_internal.h      Mon Dec 12 17:48:40 2011 +0000
@@ -17,14 +17,19 @@
 #ifndef LIBXL_INTERNAL_H
 #define LIBXL_INTERNAL_H
 
+#include "libxl_osdeps.h"
+
 #include <stdint.h>
 #include <stdarg.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <xs.h>
 #include <xenctrl.h>
 #include "xentoollog.h"
 
+#include "libxl.h"
+
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define _hidden __attribute__((visibility("hidden")))
 #define _protected __attribute__((visibility("protected")))
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c  Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_json.c  Mon Dec 12 17:48:40 2011 +0000
@@ -12,6 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h"
+
 #include <assert.h>
 #include <string.h>
 #include <math.h>
@@ -19,7 +21,6 @@
 #include <yajl/yajl_parse.h>
 #include <yajl/yajl_gen.h>
 
-#include <libxl.h>
 #include "libxl_internal.h"
 
 /* #define DEBUG_ANSWER */
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c     Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_noblktap2.c     Mon Dec 12 17:48:40 2011 +0000
@@ -12,8 +12,6 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl.h"
-#include "libxl_osdeps.h"
 #include "libxl_internal.h"
 
 int libxl__blktap_enabled(libxl__gc *gc)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_nocpuid.c
--- a/tools/libxl/libxl_nocpuid.c       Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_nocpuid.c       Mon Dec 12 17:48:40 2011 +0000
@@ -10,7 +10,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl.h"
+#include "libxl_internal.h"
 
 void libxl_cpuid_destroy(libxl_cpuid_policy_list *p_cpuid_list)
 {
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_paths.c
--- a/tools/libxl/libxl_paths.c Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_paths.c Mon Dec 12 17:48:40 2011 +0000
@@ -12,7 +12,7 @@
  * GNU Lesser General Public License for more details.
  */
 
-#include "libxl.h"
+#include "libxl_internal.h"
 #include "_libxl_paths.h"
 
 const char *libxl_sbindir_path(void)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c   Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_pci.c   Mon Dec 12 17:48:40 2011 +0000
@@ -17,7 +17,6 @@
 #include "libxl_osdeps.h"
 
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -27,15 +26,11 @@
 #include <sys/stat.h>
 #include <signal.h>
 #include <unistd.h> /* for write, unlink and close */
-#include <stdint.h>
 #include <inttypes.h>
 #include <dirent.h>
 #include <assert.h>
 
-#include "libxl.h"
-#include "libxl_utils.h"
 #include "libxl_internal.h"
-#include "flexarray.h"
 
 #define PCI_BDF                "%04x:%02x:%02x.%01x"
 #define PCI_BDF_SHORT          "%02x:%02x.%01x"
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c   Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_qmp.c   Mon Dec 12 17:48:40 2011 +0000
@@ -18,6 +18,8 @@
  * Specification, see in the QEMU repository.
  */
 
+#include "libxl_osdeps.h"
+
 #include <unistd.h>
 #include <sys/un.h>
 #include <sys/queue.h>
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_utils.c Mon Dec 12 17:48:40 2011 +0000
@@ -28,7 +28,6 @@
 #include <unistd.h>
 #include <assert.h>
 
-#include "libxl_utils.h"
 #include "libxl_internal.h"
 
 struct schedid_name {
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_uuid.c
--- a/tools/libxl/libxl_uuid.c  Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_uuid.c  Mon Dec 12 17:48:40 2011 +0000
@@ -12,8 +12,12 @@
  * GNU Lesser General Public License for more details.
  */
 
+#include "libxl_osdeps.h"
+
 #include <libxl_uuid.h>
 
+#include "libxl_internal.h"
+
 #if defined(__linux__)
 
 int libxl_uuid_is_nil(libxl_uuid *uuid)
diff -r 839104611fd8 -r 27328e5242ba tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c        Mon Dec 12 17:48:40 2011 +0000
+++ b/tools/libxl/libxl_xshelp.c        Mon Dec 12 17:48:40 2011 +0000
@@ -21,7 +21,6 @@
 #include <stdarg.h>
 #include <inttypes.h>
 
-#include "libxl.h"
 #include "libxl_internal.h"
 
 char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array, int 
length)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.