tools: shave build yaks
PATCH 1/1 tools: shave build yaks
Clean up a bunch of inconsistency, wierdness, cut-and-paste etc in the tools/ build system. All in all it's a bit of a grab bag of stuff I happened to notice as I was trawling
One specific useful thing which comes out of it is to isolate users of libxl from needing to know about libxenstore or libxenctrl.
PATCH 1/1 libxc: remove dependency on xenstore headers
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718505 0
# Node ID 2114c80da2bd0a0181dba45e53c113e968a37f0e # Parent 317a509c1f243d33327614e480281af21f7c479b
libxc: remove dependency on xenstore headers.
xc_offline_page doesn't really need xs.h.
tools/libxc/Makefile +1 -1
@@ -68,7 +68,7 @@ OSDEP_SRCS-y += xenctrl_ -include $(XEN_TARGET_ARCH)/Makefile CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += $(INCLUDES) -I. -I../xenstore -I../include +CFLAGS += $(INCLUDES) -I. -I../include # Needed for posix_fadvise64() in xc_linux.c CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
tools/libxc/xc_offline_page.c +0 -1
@@ -26,7 +26,6 @@#include <stdlib.h> #include <unistd.h> #include <sys/time.h> -#include <xs.h> #include <xc_core.h> #include "xc_private.h"
PATCH 1/1 tools: libxc: drop rpm.spec
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718505 0
# Node ID 223f61702bda3a85e2b62ef9fdfffacf371aa7d9 # Parent 2114c80da2bd0a0181dba45e53c113e968a37f0e
tools: libxc: drop rpm.spec
Last updated in 2004, doesn't even use the right library names.
tools/libxc/rpm.spec deleted +0 -28
@@ -1,28 +0,0 @@ -Summary: Xen control interface library -Name: xen-internal-library -Version: 1.2 -Release: 1 -License: Xen -Group: Xen -BuildRoot: %{staging} -%description -Library to make it easier to access the Xen control interfaces. - -%pre -%preun -%install -install -m 0755 -d $RPM_BUILD_ROOT/lib -install -m 0755 libxc.a $RPM_BUILD_ROOT/lib/libxc.a -install -m 0755 libxc.so $RPM_BUILD_ROOT/lib/libxc.so -install -m 0755 -d $RPM_BUILD_ROOT/include -install -m 0644 xc.h $RPM_BUILD_ROOT/include/xc.h -%clean -%post -%postun -%files -%defattr(-,root,root) -%dir /lib -/lib/libxc.a -/lib/libxc.so -%dir /include -/include/xc.h
PATCH 1/1 tools: vnet: Remove
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 28f04a6595064dca0062b972aa7ef69db8065c90 # Parent 223f61702bda3a85e2b62ef9fdfffacf371aa7d9
tools: vnet: Remove
Build has been broken since at least 18969:d6889b3b6423 (early 2009) and it has been unhooked from the top level build since forever AFAICT. The last actual development (as opposed to tree wide cleanups and build fixes) appears to have been 11594:6d7bba6443ef in 2006. The functionality of vnet has apparently been superceded by VLANs, ebtables, Ethernet-over-IP etc all of which are well integrated with upstream kernels and distros.
tools/python/xen/xend/XendVnet.py deleted +0 -181
@@ -1,181 +0,0 @@ -#============================================================================ -# This library is free software; you can redistribute it and/or -# modify it under the terms of version 2.1 of the GNU Lesser General Public -# License as published by the Free Software Foundation. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#============================================================================ -# Copyright (C) 2004, 2005 Mike Wray <[email protected]> -# Copyright (C) 2005 XenSource Ltd -#============================================================================ - -"""Handler for vnet operations. -""" - -from xen.util import Brctl -from xen.xend import sxp -from xen.xend.XendError import XendError -from xen.xend.XendLogging import log -from xen.xend.xenstore.xstransact import xstransact - - -def vnet_cmd(cmd): - out = None - try: - try: - out = file("/proc/vnet/policy", "wb") - sxp.show(cmd, out) - except IOError, ex: - raise XendError(str(ex)) - finally: - if out: out.close() - -class XendVnetInfo: - - vifctl_ops = {'up': 'vif.add', 'down': 'vif.del'} - - def __init__(self, dbpath, config=None): - if config: - self.id = str(sxp.child_value(config, 'id')) - self.dbid = self.id.replace(':', '-') - self.dbpath = dbpath + '/' + self.dbid - self.config = config - else: - self.dbpath = dbpath - self.importFromDB() - - self.bridge = sxp.child_value(self.config, 'bridge') - if not self.bridge: - self.bridge = "vnet%s" % self.id - self.vnetif = sxp.child_value(self.config, 'vnetif') - if not self.vnetif: - self.vnetif = "vnif%s" % self.id - - - def exportToDB(self, save=False, sync=False): - to_store = { - 'id' : self.id, - 'dbid' : self.dbid, - 'config' : sxp.to_string(self.config) - } - xstransact.Write(self.dbpath, to_store) - - - def importFromDB(self): - (self.id, self.dbid, c) = xstransact.Gather(self.dbpath, - ('id', str), - ('dbid', str), - ('config', str)) - self.config = sxp.from_string(c) - - - def sxpr(self): - return self.config - - def configure(self): - log.info("Configuring vnet %s", self.id) - val = vnet_cmd(['vnet.add'] + sxp.children(self.config)) - Brctl.bridge_create(self.bridge) - Brctl.vif_bridge_add({'bridge': self.bridge, 'vif': self.vnetif}) - return val - - def delete(self): - log.info("Deleting vnet %s", self.id) - Brctl.vif_bridge_rem({'bridge': self.bridge, 'vif': self.vnetif}) - Brctl.bridge_del(self.bridge) - val = vnet_cmd(['vnet.del', self.id]) - xstransact.Remove(self.dbpath) - return val - - def vifctl(self, op, vif, vmac): - try: - fn = self.vifctl_ops[op] - return vnet_cmd([fn, ['vnet', self.id], ['vif', vif], ['vmac', vmac]]) - except XendError: - log.warning("vifctl failed: op=%s vif=%s mac=%s", op, vif, vmac) - -class XendVnet: - """Index of all vnets. Singleton. - """ - - dbpath = "/vnet" - - def __init__(self): - # Table of vnet info indexed by vnet id. - self.vnet = {} - listing = xstransact.List(self.dbpath) - for entry in listing: - try: - info = XendVnetInfo(self.dbpath + '/' + entry) - self.vnet[info.id] = info - info.configure() - except XendError, ex: - log.warning("Failed to configure vnet %s: %s", str(info.id), str(ex)) - except Exception, ex: - log.exception("Vnet error") - xstransact.Remove(self.dbpath + '/' + entry) - - def vnet_of_bridge(self, bridge): - """Get the vnet for a bridge (if any). - - @param bridge: bridge name - @return vnet or None - """ - for v in self.vnet.values(): - if v.bridge == bridge: - return v - else: - return None - - def vnet_ls(self): - """List all vnet ids. - """ - return self.vnet.keys() - - def vnets(self): - """List all vnets. - """ - return self.vnet.values() - - def vnet_get(self, id): - """Get a vnet. - - @param id vnet id - """ - id = str(id) - return self.vnet.get(id) - - def vnet_create(self, config): - """Create a vnet. - - @param config: config - """ - info = XendVnetInfo(self.dbpath, config=config) - self.vnet[info.id] = info - info.exportToDB() - info.configure() - - def vnet_delete(self, id): - """Delete a vnet. - - @param id: vnet id - """ - info = self.vnet_get(id) - if info: - del self.vnet[id] - info.delete() - -def instance(): - global inst - try: - inst - except: - inst = XendVnet() - return inst
tools/python/xen/xend/server/SrvRoot.py +0 -1
@@ -29,7 +29,6 @@ class SrvRoot(SrvDir): subdirs = [ ('node', 'SrvNode' ), ('domain', 'SrvDomainDir' ), - ('vnet', 'SrvVnetDir' ), ] def __init__(self):
tools/python/xen/xend/server/SrvVnetDir.py deleted +0 -128
128 lines not on this page · raw message
tools/python/xen/xm/main.py +1 -62
99 lines not on this page · raw message
tools/vnet/00INSTALL deleted +0 -55
55 lines not on this page · raw message
tools/vnet/00README deleted +0 -15
@@ -1,15 +0,0 @@ -This directory contains the implementation of vnets: -virtual private networks for virtual machines. - -See 00INSTALL for build instructions, doc/ for more information -and examples/ for example configurations. - -The vnet implementation can be run using a kernel module -or a user-space daemon. The kernel module is in vnet-module/ and the -user-space daemon (varpd) is in vnetd/. The user-space daemon -needs the tun/tap kernel module. Vnets use multicast to find -virtual interfaces and support broadcast. Either implementation can -tunnel multicast packets to other implementations if wide-area -multicast routing is not available. - -Mike Wray <[email protected]>
tools/vnet/Make.env deleted +0 -28
@@ -1,28 +0,0 @@ -# -*- mode: Makefile; -*- - -# Include any local overrides. --include $(VNET_ROOT)/Make.local - -# If building vnets outside the xen source tree, set XEN_ROOT to the -# absolute path of the root of the xen source tree. Edit this file -# or set XEN_ROOT in Make.local, the make command line or -# the environment. For example put this in Make.local: -# export XEN_ROOT = $(shell cd ~/xen-unstable.hg && pwd) - -export XEN_ROOT ?= $(shell cd $(VNET_ROOT)/../.. && pwd) - -export LINUX_SERIES ?= 2.6 - -DISTDIR ?= $(XEN_ROOT)/dist -export DESTDIR ?= $(DISTDIR)/install - -export VNET_MODULE_DIR = $(VNET_ROOT)/vnet-module -export VNETD_DIR = $(VNET_ROOT)/vnetd -export LIBXUTIL_DIR = $(VNET_ROOT)/libxutil - - -export GC_DIR = $(VNET_ROOT)/build/gc -export GC_INCLUDE = $(GC_DIR)/include -export GC_LIB_DIR = $(GC_DIR)/lib -export GC_LIB_A = $(GC_LIB_DIR)/libgc.a -export GC_LIB_SO = $(GC_LIB_DIR)/libgc.so
tools/vnet/Makefile deleted +0 -90
90 lines not on this page · raw message
tools/vnet/doc/Makefile deleted +0 -51
51 lines not on this page · raw message
tools/vnet/doc/man/vn.pod.1 deleted +0 -176
176 lines not on this page · raw message
tools/vnet/doc/vnet-module.txt deleted +0 -72
72 lines not on this page · raw message
tools/vnet/doc/vnet-xend.txt deleted +0 -167
167 lines not on this page · raw message
tools/vnet/examples/Makefile deleted +0 -16
@@ -1,16 +0,0 @@ -# -*- mode: Makefile; -*- -#============================================================================ -XEN_ROOT = $(CURDIR)/../../.. -include $(XEN_ROOT)/tools/Rules.mk - -.PHONY: all -all: - -.PHONY: install -install: - $(INSTALL_DIR) $(XEN_SCRIPT_DIR) - $(INSTALL_PROG) network-vnet $(XEN_SCRIPT_DIR) - $(INSTALL_PROG) vnet-insert $(XEN_SCRIPT_DIR) - -.PHONY: clean -clean:
tools/vnet/examples/network-vnet deleted +0 -10
@@ -1,10 +0,0 @@ -#!/bin/sh -scriptdir=/etc/xen/scripts/ - -case ${1} in - start) - ${scriptdir}/vnet-insert - ;; -esac - -${scriptdir}/network-bridge "$@"
tools/vnet/examples/vnet-insert deleted +0 -28
@@ -1,28 +0,0 @@ -#!/bin/bash - -# Insert the vnet module if it can be found and -# it's not already there. -vnet_insert () { - local module="vnet_module" - local mod_dir=/lib/modules/$(uname -r) - local mod_obj="" - - if lsmod | grep -q ${module} ; then - echo "VNET: ${module} loaded" - return - fi - local mods=$(find ${mod_dir} -name "${module}.*o") - if [[ ${mods} ]] ; then - for mod_obj in ${mods} ; do - break - done - fi - if [ -z "${mod_obj}" ] ; then - echo "VNET: ${module} not found" - exit 1 - fi - echo "VNET: Loading ${module} from ${mod_obj}" - insmod ${mod_obj} "$@" -} - -vnet_insert "$@"
tools/vnet/examples/vnet97.sxp deleted +0 -2
@@ -1,2 +0,0 @@ -# Vnet configuration for a vnet with id 97 and no security. -(vnet (id 97) (bridge vnet97) (vnetif vnif97) (security none))
tools/vnet/examples/vnet98.sxp deleted +0 -2
@@ -1,2 +0,0 @@ -# Vnet configuration for a vnet with id 98 and message authentication. -(vnet (id 98) (bridge vnet98) (vnetif vnif98) (security auth))
tools/vnet/examples/vnet99.sxp deleted +0 -2
@@ -1,2 +0,0 @@ -# Vnet configuration for a vnet with id 99 and message confidentiality. -(vnet (id 99) (bridge vnet99) (vnif vnetif99) (security conf))
tools/vnet/libxutil/Makefile deleted +0 -83
83 lines not on this page · raw message
tools/vnet/libxutil/allocate.c deleted +0 -116
116 lines not on this page · raw message
tools/vnet/libxutil/allocate.h deleted +0 -45
45 lines not on this page · raw message
tools/vnet/libxutil/debug.h deleted +0 -72
72 lines not on this page · raw message
tools/vnet/libxutil/enum.c deleted +0 -61
61 lines not on this page · raw message
tools/vnet/libxutil/enum.h deleted +0 -30
@@ -1,30 +0,0 @@ -/* -* Copyright (C) 2002, 2004 Mike Wray <[email protected]> -* -* This library is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of the -* License, or (at your option) any later version. This library 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this library; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _XUTIL_ENUM_H_ -#define _XUTIL_ENUM_H_ - -/** Mapping of an enum value to a name. */ -typedef struct EnumDef { -int val; -char *name; -}EnumDef ; - -extern int enum_name_to_val (char *name,EnumDef *defs); -extern char *enum_val_to_name (int val,EnumDef *defs); - -#endif /* _XUTIL_ENUM_H_ */
tools/vnet/libxutil/fd_stream.c deleted +0 -184
184 lines not on this page · raw message
tools/vnet/libxutil/fd_stream.h deleted +0 -36
@@ -1,36 +0,0 @@ -/* -* Copyright (C) 2004 Mike Wray <[email protected]> -* -* This library is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This library 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _XMC_FD_STREAM_H_ -#define _XMC_FD_STREAM_H_ - -#ifndef __KERNEL__ -#include "iostream.h" - -/** Data associated with a fd stream. */ -typedef struct FDData { -/** The socket file descriptor. */ -int fd; -}FDData ; - -extern IOStream *fd_stream_new (int fd); -extern int fd_stream_data (IOStream *io,FDData **data); -extern int fd_stream_check (IOStream *io); - -#endif -#endif /* !_XMC_FD_STREAM_H_ */
tools/vnet/libxutil/file_stream.c deleted +0 -220
220 lines not on this page · raw message
tools/vnet/libxutil/file_stream.h deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* Copyright (C) 2001 - 2004 Mike Wray <[email protected]> -* -* This library is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This library 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _XUTIL_FILE_STREAM_H_ -#define _XUTIL_FILE_STREAM_H_ - -#ifndef __KERNEL__ -#include "iostream.h" -#include <stdio.h> - -extern IOStream *file_stream_new (FILE *f); -extern IOStream *file_stream_fopen (const char *file,const char *flags); -extern IOStream *file_stream_fdopen (int fd,const char *flags); -extern IOStream get_stream_stdout (void ); -extern IOStream get_stream_stderr (void ); -extern IOStream get_stream_stdin (void ); - -extern int file_stream_setvbuf (IOStream *io,char *buf,int mode,size_t size); -#endif -#endif /* !_XUTIL_FILE_STREAM_H_ */
tools/vnet/libxutil/gzip_stream.c deleted +0 -174
174 lines not on this page · raw message
tools/vnet/libxutil/gzip_stream.h deleted +0 -30
@@ -1,30 +0,0 @@ -/* -* Copyright (C) 2003 Hewlett-Packard Company. -* -* This library is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This library 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _XUTIL_GZIP_STREAM_H_ -#define _XUTIL_GZIP_STREAM_H_ - -#ifndef __KERNEL__ -#include "iostream.h" -#include "zlib.h" - -extern IOStream *gzip_stream_new (gzFile *f); -extern IOStream *gzip_stream_fopen (const char *file,const char *flags); -extern IOStream *gzip_stream_fdopen (int fd,const char *flags); -#endif -#endif /* !_XUTIL_GZIP_STREAM_H_ */
tools/vnet/libxutil/hash_table.c deleted +0 -658
658 lines not on this page · raw message
tools/vnet/libxutil/hash_table.h deleted +0 -240
126 lines not on this page · raw message
tools/vnet/libxutil/iostream.c deleted +0 -55
55 lines not on this page · raw message
tools/vnet/libxutil/iostream.h deleted +0 -269
269 lines not on this page · raw message
tools/vnet/libxutil/kernel_stream.c deleted +0 -178
178 lines not on this page · raw message
tools/vnet/libxutil/kernel_stream.h deleted +0 -29
Lines of this file are not shown. View the raw message.
tools/vnet/libxutil/lexis.c deleted +0 -94
94 lines not on this page · raw message
tools/vnet/libxutil/lexis.h deleted +0 -128
128 lines not on this page · raw message
tools/vnet/libxutil/mem_stream.c deleted +0 -324
324 lines not on this page · raw message
tools/vnet/libxutil/mem_stream.h deleted +0 -32
Lines of this file are not shown. View the raw message.
tools/vnet/libxutil/socket_stream.c deleted +0 -230
230 lines not on this page · raw message
tools/vnet/libxutil/socket_stream.h deleted +0 -53
53 lines not on this page · raw message
tools/vnet/libxutil/string_stream.c deleted +0 -162
162 lines not on this page · raw message
tools/vnet/libxutil/string_stream.h deleted +0 -45
45 lines not on this page · raw message
tools/vnet/libxutil/sxpr.c deleted +0 -1230
1,230 lines not on this page · raw message
tools/vnet/libxutil/sxpr.h deleted +0 -440
440 lines not on this page · raw message
tools/vnet/libxutil/sxpr_parser.c deleted +0 -1002
1,002 lines not on this page · raw message
tools/vnet/libxutil/sxpr_parser.h deleted +0 -160
160 lines not on this page · raw message
tools/vnet/libxutil/sys_net.c deleted +0 -319
319 lines not on this page · raw message
tools/vnet/libxutil/sys_net.h deleted +0 -78
78 lines not on this page · raw message
tools/vnet/libxutil/sys_string.c deleted +0 -218
218 lines not on this page · raw message
tools/vnet/libxutil/sys_string.h deleted +0 -94
94 lines not on this page · raw message
tools/vnet/libxutil/util.c deleted +0 -106
106 lines not on this page · raw message
tools/vnet/scripts/vn deleted +0 -901
901 lines not on this page · raw message
tools/vnet/vnet-module/00README deleted +0 -39
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/Makefile deleted +0 -71
71 lines not on this page · raw message
tools/vnet/vnet-module/Makefile-2.4 deleted +0 -98
98 lines not on this page · raw message
tools/vnet/vnet-module/Makefile-2.6 deleted +0 -57
57 lines not on this page · raw message
tools/vnet/vnet-module/Makefile.ver deleted +0 -51
51 lines not on this page · raw message
tools/vnet/vnet-module/Makefile.vnet deleted +0 -60
60 lines not on this page · raw message
tools/vnet/vnet-module/esp.c deleted +0 -903
903 lines not on this page · raw message
tools/vnet/vnet-module/esp.h deleted +0 -120
120 lines not on this page · raw message
tools/vnet/vnet-module/etherip.c deleted +0 -467
467 lines not on this page · raw message
tools/vnet/vnet-module/etherip.h deleted +0 -38
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/if_etherip.h deleted +0 -83
83 lines not on this page · raw message
tools/vnet/vnet-module/if_varp.h deleted +0 -105
105 lines not on this page · raw message
tools/vnet/vnet-module/linux/pfkeyv2.h deleted +0 -329
329 lines not on this page · raw message
tools/vnet/vnet-module/random.c deleted +0 -87
87 lines not on this page · raw message
tools/vnet/vnet-module/random.h deleted +0 -28
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/sa.c deleted +0 -756
756 lines not on this page · raw message
tools/vnet/vnet-module/sa.h deleted +0 -215
215 lines not on this page · raw message
tools/vnet/vnet-module/sa_algorithm.c deleted +0 -367
367 lines not on this page · raw message
tools/vnet/vnet-module/sa_algorithm.h deleted +0 -63
63 lines not on this page · raw message
tools/vnet/vnet-module/skb_context.c deleted +0 -92
92 lines not on this page · raw message
tools/vnet/vnet-module/skb_context.h deleted +0 -87
87 lines not on this page · raw message
tools/vnet/vnet-module/skb_util.c deleted +0 -556
556 lines not on this page · raw message
tools/vnet/vnet-module/skb_util.h deleted +0 -154
154 lines not on this page · raw message
tools/vnet/vnet-module/sxpr_util.c deleted +0 -119
119 lines not on this page · raw message
tools/vnet/vnet-module/sxpr_util.h deleted +0 -36
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/timer_util.c deleted +0 -74
74 lines not on this page · raw message
tools/vnet/vnet-module/timer_util.h deleted +0 -41
41 lines not on this page · raw message
tools/vnet/vnet-module/tunnel.c deleted +0 -270
270 lines not on this page · raw message
tools/vnet/vnet-module/tunnel.h deleted +0 -113
113 lines not on this page · raw message
tools/vnet/vnet-module/varp.c deleted +0 -1536
1,536 lines not on this page · raw message
tools/vnet/vnet-module/varp.h deleted +0 -161
161 lines not on this page · raw message
tools/vnet/vnet-module/varp_socket.c deleted +0 -767
767 lines not on this page · raw message
tools/vnet/vnet-module/varp_util.c deleted +0 -77
77 lines not on this page · raw message
tools/vnet/vnet-module/varp_util.h deleted +0 -95
95 lines not on this page · raw message
tools/vnet/vnet-module/vif.c deleted +0 -387
387 lines not on this page · raw message
tools/vnet/vnet-module/vif.h deleted +0 -64
64 lines not on this page · raw message
tools/vnet/vnet-module/vnet.c deleted +0 -699
699 lines not on this page · raw message
tools/vnet/vnet-module/vnet.h deleted +0 -108
108 lines not on this page · raw message
tools/vnet/vnet-module/vnet_dev.c deleted +0 -296
296 lines not on this page · raw message
tools/vnet/vnet-module/vnet_dev.h deleted +0 -27
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/vnet_eval.c deleted +0 -378
378 lines not on this page · raw message
tools/vnet/vnet-module/vnet_eval.h deleted +0 -35
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/vnet_forward.c deleted +0 -389
389 lines not on this page · raw message
tools/vnet/vnet-module/vnet_forward.h deleted +0 -36
Lines of this file are not shown. View the raw message.
tools/vnet/vnet-module/vnet_ioctl.c deleted +0 -509
509 lines not on this page · raw message
tools/vnet/vnet-module/vnet_ioctl.h deleted +0 -25
Lines of this file are not shown. View the raw message.
tools/vnet/vnetd/Makefile deleted +0 -121
121 lines not on this page · raw message
tools/vnet/vnetd/connection.c deleted +0 -412
412 lines not on this page · raw message
tools/vnet/vnetd/connection.h deleted +0 -76
76 lines not on this page · raw message
tools/vnet/vnetd/list.h deleted +0 -284
284 lines not on this page · raw message
tools/vnet/vnetd/select.c deleted +0 -109
109 lines not on this page · raw message
tools/vnet/vnetd/select.h deleted +0 -60
60 lines not on this page · raw message
tools/vnet/vnetd/selector.c deleted +0 -133
133 lines not on this page · raw message
tools/vnet/vnetd/selector.h deleted +0 -62
62 lines not on this page · raw message
tools/vnet/vnetd/skbuff.c deleted +0 -530
530 lines not on this page · raw message
tools/vnet/vnetd/skbuff.h deleted +0 -538
538 lines not on this page · raw message
tools/vnet/vnetd/spinlock.c deleted +0 -65
65 lines not on this page · raw message
tools/vnet/vnetd/spinlock.h deleted +0 -47
47 lines not on this page · raw message
tools/vnet/vnetd/sys_kernel.h deleted +0 -71
71 lines not on this page · raw message
tools/vnet/vnetd/timer.c deleted +0 -157
157 lines not on this page · raw message
tools/vnet/vnetd/vnetd.c deleted +0 -1200
1,200 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
PATCH 1/1 tools: Drop use of $(INCLUDES)
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID fca900cf6e12e1347dc27552140591df20ff5af5 # Parent 28f04a6595064dca0062b972aa7ef69db8065c90
tools: Drop use of $(INCLUDES)
Several places include it in CFLAGS even though it is never defined. A few others use it as nothing more than a gathering point for CFLAGS. Get rid of it.
tools/debugger/gdbsx/xg/Makefile +1 -1
@@ -4,7 +4,7 @@ XG_HDRS := xg_public.h XG_HDRS := xg_public.h XG_OBJS := xg_main.o -CFLAGS += $(INCLUDES) -I. -I../../../include +CFLAGS += -I. -I../../../include .PHONY: all
tools/flask/libflask/Makefile +1 -1
@@ -11,7 +11,7 @@ SRCS += flask_op.c CFLAGS += -Werror CFLAGS += -fno-strict-aliasing -CFLAGS += $(INCLUDES) -I./include -I$(XEN_LIBXC) -I$(XEN_INCLUDE) +CFLAGS += -I./include -I$(XEN_LIBXC) -I$(XEN_INCLUDE) # Get gcc to generate the dependencies for us. CFLAGS += -Wp,-MD,.$(@F).d
tools/libxc/Makefile +1 -1
@@ -68,7 +68,7 @@ OSDEP_SRCS-y += xenctrl_ -include $(XEN_TARGET_ARCH)/Makefile CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += $(INCLUDES) -I. -I../include +CFLAGS += -I. -I../include # Needed for posix_fadvise64() in xc_linux.c CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
tools/misc/Makefile +4 -5
@@ -1,12 +1,11 @@ XEN_ROOT=$(CURDIR)/../.. XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -Werror +CFLAGS += -Werror -INCLUDES += -I $(XEN_XC) -INCLUDES += -I $(XEN_LIBXC) -INCLUDES += -I $(XEN_INCLUDE) -CFLAGS += $(INCLUDES) +CFLAGS += -I $(XEN_XC) +CFLAGS += -I $(XEN_LIBXC) +CFLAGS += -I $(XEN_INCLUDE) HDRS = $(wildcard *.h)
tools/tests/mce-test/tools/Makefile +4 -5
@@ -1,12 +1,11 @@ XEN_ROOT=$(CURDIR)/../../../.. XEN_ROOT=$(CURDIR)/../../../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -Werror +CFLAGS += -Werror -INCLUDES += -I $(XEN_XC) -INCLUDES += -I $(XEN_LIBXC) -INCLUDES += -I $(XEN_INCLUDE) -CFLAGS += $(INCLUDES) +CFLAGS += -I $(XEN_XC) +CFLAGS += -I $(XEN_LIBXC) +CFLAGS += -I $(XEN_INCLUDE) HDRS = $(wildcard *.h)
tools/tests/xen-access/Makefile +4 -5
@@ -1,12 +1,11 @@ XEN_ROOT=$(CURDIR)/../../.. XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -Werror +CFLAGS += -Werror -INCLUDES += -I $(XEN_XC) -INCLUDES += -I $(XEN_LIBXC) -INCLUDES += -I $(XEN_INCLUDE) -CFLAGS += $(INCLUDES) +CFLAGS += -I $(XEN_XC) +CFLAGS += -I $(XEN_LIBXC) +CFLAGS += -I $(XEN_INCLUDE) TARGETS-y := TARGETS-$(CONFIG_X86) += xen-access
PATCH 1/1 tools: vtpm: Use $(BINDIR) rather than a privately defined variable
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID c0d62ae9fdb23008269dce714919fc64b511efe5
# Parent fca900cf6e12e1347dc27552140591df20ff5af5
tools: vtpm: Use $(BINDIR) rather than a privately defined variable
tools/vtpm/Rules.mk +0 -3
@@ -4,9 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk # # Tool definitions # - -# Xen tools installation directory -TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin # General compiler flags CFLAGS = -Werror -g3 -I.
tools/vtpm_manager/Rules.mk +0 -3
@@ -4,9 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk # # Tool definitions # - -# Xen tools installation directory -TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin # General compiler flags CFLAGS = -Werror -g3 -I.
tools/vtpm_manager/manager/Makefile +1 -1
@@ -17,7 +17,7 @@ install: build if [ ! -d "$(DESTDIR)/var/vtpm/socks" ]; \ then mkdir -p $(DESTDIR)/var/vtpm/socks; \ fi - $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR) + $(INSTALL_PROG) $(BIN) $(BINDIR) .PHONY: clean clean:
tools/vtpm_manager/migration/Makefile +2 -2
@@ -20,8 +20,8 @@ build: $(BIND) $(BINC) .PHONY: install install: build - $(INSTALL_PROG) $(BIND) $(TOOLS_INSTALL_DIR) - $(INSTALL_PROG) $(BINC) $(TOOLS_INSTALL_DIR) + $(INSTALL_PROG) $(BIND) $(BINDIR) + $(INSTALL_PROG) $(BINC) $(BINDIR) .PHONY: clean clean:
PATCH 1/1 tools: remove unnecessary uses of -L
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 01bdfd7a7db03dcd0e77dbd241b9398ffd8eec62 # Parent c0d62ae9fdb23008269dce714919fc64b511efe5
tools: remove unnecessary uses of -L.
It's not needed unless you are linking against a library in the current directory.
tools/flask/libflask/Makefile +0 -1
@@ -15,7 +15,6 @@ CFLAGS += -I./include -I$(XEN_LIBXC) - # Get gcc to generate the dependencies for us. CFLAGS += -Wp,-MD,.$(@F).d -LDFLAGS += -L. LIB_OBJS := $(patsubst %.c,%.o,$(SRCS)) PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
tools/flask/utils/Makefile +1 -1
@@ -27,7 +27,7 @@ all: $(CLIENTS) all: $(CLIENTS) $(CLIENTS): flask-%: %.o - $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -lflask $(LDLIBS_libxenctrl) -o $@ .PHONY: clean clean:
tools/libxc/Makefile +2 -4
@@ -76,8 +76,6 @@ CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE # Define this to make it possible to run valgrind on code linked with these # libraries. #CFLAGS += -DVALGRIND -O0 -ggdb3 - -LDFLAGS += -L. CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y)) CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -195,10 +193,10 @@ xc_dom_bzimageloader.opic: CFLAGS += $(c libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l) libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz -lxenctrl $(PTHREAD_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz -L. -lxenctrl $(PTHREAD_LIBS) xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so - $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) -lxenctrl + $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) -L. -lxenctrl -include $(DEPS)
PATCH 1/1 tools: remove unnecessary uses of -I
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 5da1f6fc58ac6b4e3654dbfbc49249fa0a1719a5 # Parent 01bdfd7a7db03dcd0e77dbd241b9398ffd8eec62
tools: remove unnecessary uses of -I.
It's not needed unless you are including headers in the current directory _and_ you can't use "" instead of <> because the headers are to be installed.
tools/debugger/gdbsx/xg/Makefile +1 -1
@@ -4,7 +4,7 @@ XG_HDRS := xg_public.h XG_HDRS := xg_public.h XG_OBJS := xg_main.o -CFLAGS += -I. -I../../../include +CFLAGS += -I../../../include .PHONY: all
tools/firmware/hvmloader/Makefile +1 -1
@@ -26,7 +26,7 @@ SUBDIRS := acpi # The HVM loader is started in 32-bit mode at the address below: LOADADDR = 0x100000 -CFLAGS += $(CFLAGS_include) -I. +CFLAGS += $(CFLAGS_include) SRCS = hvmloader.c mp_tables.c util.c smbios.c SRCS += 32bitbios_support.c smp.c cacheattr.c xenbus.c
tools/firmware/hvmloader/acpi/Makefile +1 -1
@@ -21,7 +21,7 @@ C_SRC = build.c dsdt_anycpu.c dsdt_15cpu C_SRC = build.c dsdt_anycpu.c dsdt_15cpu.c static_tables.c OBJS = $(patsubst %.c,%.o,$(C_SRC)) -CFLAGS += -I. -I.. $(CFLAGS_include) +CFLAGS += $(CFLAGS_include) vpath iasl $(PATH) all: acpi.a
tools/flask/utils/Makefile +0 -1
@@ -11,7 +11,6 @@ BASECFLAGS+= $(PROFILE) #BASECFLAGS+= -I$(XEN_ROOT)/tools BASECFLAGS+= $(CFLAGS_libxenctrl) BASECFLAGS+= -I$(LIBFLASK_ROOT)/include -BASECFLAGS+= -I. CFLAGS += $(BASECFLAGS) LDLIBS += $(PROFILE) -L$(XEN_LIBXC) -L$(LIBFLASK_ROOT)
tools/ocaml/libs/xc/Makefile +1 -1
@@ -2,7 +2,7 @@ XEN_ROOT=$(TOPLEVEL)/../.. XEN_ROOT=$(TOPLEVEL)/../.. include $(TOPLEVEL)/common.make -CFLAGS += -I../mmap -I./ -I$(XEN_ROOT)/tools/libxc +CFLAGS += -I../mmap -I$(XEN_ROOT)/tools/libxc OCAMLINCLUDE += -I ../mmap -I ../uuid -I $(XEN_ROOT)/tools/libxc OBJS = xc
tools/security/Makefile +1 -1
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += -fno-strict-aliasing -CFLAGS += -I. $(CFLAGS_libxenctrl) +CFLAGS += $(CFLAGS_libxenctrl) CPPFLAGS += -MMD -MF .$*.d PROG_DEPS = .*.d
tools/vtpm/Rules.mk +1 -1
@@ -6,7 +6,7 @@ include $(XEN_ROOT)/tools/Rules.mk # # General compiler flags -CFLAGS = -Werror -g3 -I. +CFLAGS = -Werror -g3 # Generic project files HDRS = $(wildcard *.h)
tools/vtpm_manager/Rules.mk +1 -1
@@ -6,7 +6,7 @@ include $(XEN_ROOT)/tools/Rules.mk # # General compiler flags -CFLAGS = -Werror -g3 -I. +CFLAGS = -Werror -g3 # Generic project files HDRS = $(wildcard *.h)
tools/xenpaging/Makefile +0 -1
@@ -2,7 +2,6 @@ include $(XEN_ROOT)/tools/Rules.mk include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -I $(XEN_XC) -CFLAGS += -I ./ CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore)
PATCH 1/1 tools: Drop XEN_XC variable
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 31804758d43a24f03555429caa5f76ea43de2f28 # Parent 5da1f6fc58ac6b4e3654dbfbc49249fa0a1719a5
tools: Drop XEN_XC variable
There is nothing to include in the python bindings source directory and likely never was/will be ...
tools/Rules.mk +0 -1
@@ -9,7 +9,6 @@ INSTALL = $(XEN_ROOT)/tools/cross-instal INSTALL = $(XEN_ROOT)/tools/cross-install XEN_INCLUDE = $(XEN_ROOT)/tools/include -XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc XEN_LIBXC = $(XEN_ROOT)/tools/libxc XEN_XENLIGHT = $(XEN_ROOT)/tools/libxl XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore
tools/misc/Makefile +0 -1
@@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_XC) CFLAGS += -I $(XEN_LIBXC) CFLAGS += -I $(XEN_INCLUDE)
tools/tests/mce-test/tools/Makefile +0 -1
@@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_XC) CFLAGS += -I $(XEN_LIBXC) CFLAGS += -I $(XEN_INCLUDE)
tools/tests/xen-access/Makefile +0 -1
@@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_XC) CFLAGS += -I $(XEN_LIBXC) CFLAGS += -I $(XEN_INCLUDE)
tools/xenmon/Makefile +0 -1
@@ -14,7 +14,6 @@ include $(XEN_ROOT)/tools/Rules.mk include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_XC) CFLAGS += $(CFLAGS_libxenctrl) LDLIBS += $(LDLIBS_libxenctrl)
tools/xenpaging/Makefile +2 -3
@@ -1,9 +1,8 @@ XEN_ROOT=$(CURDIR)/../.. XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -I $(XEN_XC) -CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) -LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) +CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) +LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) POLICY = default
PATCH 1/1 tools: blktap2: copy xenstore/hashtable.h into blktap2
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 30a1f7d0aa1097fd2b3f39b03742865bcfc38731 # Parent 31804758d43a24f03555429caa5f76ea43de2f28
tools: blktap2: copy xenstore/hashtable.h into blktap2
hashtable.c has already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.
tools/blktap2/drivers/Makefile +0 -2
@@ -29,8 +29,6 @@ REMUS-OBJS += hashtable.o REMUS-OBJS += hashtable.o REMUS-OBJS += hashtable_itr.o REMUS-OBJS += hashtable_utility.o - -$(REMUS-OBJS): CFLAGS += -I$(XEN_XENSTORE) LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src MEMSHR_DIR = $(XEN_ROOT)/tools/memshr
tools/blktap2/drivers/hashtable.h new file +199 -0
199 lines not on this page · raw message
tools/blktap2/drivers/hashtable_private.h new file +85 -0
85 lines not on this page · raw message
Re: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
Ian Campbell writes ("[Xen-devel] [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2"):
Quoted 5 lines
tools: blktap2: copy
xenstore/hashtable.hinto blktap2
hashtable.chas already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.
Before we make this any worse, perhaps we should at least leave a comment in every copy of hashtable.c referring to every other clone ?
Ian.
Re: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
Quoted 11 lines · Ian Jackson
Ian Campbell writes ("[Xen-devel] [PATCH 09 of 30] tools: blktap2: copy
xenstore/hashtable.hinto blktap2"):Quoted 5 lines
tools: blktap2: copy
xenstore/hashtable.hinto blktap2
hashtable.chas already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.Before we make this any worse, perhaps we should at least leave a comment in every copy of
hashtable.creferring to every other clone ?
Quoted 7 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
copying hashtable.h alone wont suffice.hashtable_itr.h in blktap2/drivers includes hashtable_private.h in xenstore/
And a diff -wu blktap2/drivers/hashtable.c xenstore/hashtable.c shows no functional
difference between the two versions.
How about pulling the hashtable.h, hashtable.c, hashtable_private.h from
xenstore/
and hashtable_itr.[h,c], hashtable_utility.[h,c] from blktap2/drivers/ into one common
separate area, like utils/ or something.
Also, I suggest moving all code from hashtable_itr.c and hashtable_utility.c
into hashtable.c (and adding the appropriate declarations to hashtable.h). The copyrights
and attributions in the files seem to be the same. We could get rid of all the clutter and
have just 3 files related to hashtable, common to both xenstore and blktap2/drivers/.
shriram
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
Quoted 21 lines · Shriram Rajagopalan
On Mon, Mar 21, 2011 at 11:03 AM, Ian Jackson <[email protected]> wrote:
Ian Campbell writes ("[Xen-devel] [PATCH 09 of 30] tools:
blktap2: copyxenstore/hashtable.hinto blktap2"):
> tools: blktap2: copyxenstore/hashtable.hinto blktap2 >
>hashtable.chas already been copied, forked and modified, there
> doesn't seem much point in avoiding the same for the header until
> someone feels motivated to properly refactor.Before we make this any worse, perhaps we should at least leave a
comment in every copy ofhashtable.creferring to every other clone ?Ian.
Quoted 8 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develcopying
hashtable.halone wont suffice.hashtable_itr.hin blktap2/drivers includeshashtable_private.hin xenstore/
The commit copies both, although I forgot to update the description to say so.
Quoted 2 lines
And a diff -wu
blktap2/drivers/hashtable.cxenstore/hashtable.cshows no functional difference between the two versions.
Well, there are definitely some functional differences, they may well be trivial I suppose but determining that did not look immediately trivial so I didn't dig deeper.
If someone wants to merge the two versions and validate that it works for both usages I would be happy to have that patch instead of this one, or to have this one in the interim while that gets sorted out.
Quoted 4 lines
How about pulling the
hashtable.h,hashtable.c,hashtable_private.h
from xenstore/ and hashtable_itr.[h,c], hashtable_utility.[h,c] from blktap2/drivers/ into one common separate area, like utils/ or something.
Well, you can't just blindly take the blktap2 version since the xenstore version has had changes made to it since blktap2 forked its version off so you'd need to at least do a merge up pass first. In particular 9129:1c46091df7ce removed the use of floating point which seems like a useful change. 17816:189597fbb882 includes BSD portability fixes which are important for the xenstore usage (and 17819:57b8c74c35ef includes an incremental fix). I don't know if that accounts for all the differences or not.
xenstore and blktap2 have no common dependency where this shared code would sanely live, I suppose tools/utils or tools/hashtable is as good as anywhere, although I'm not sure I think the world really needs libxenhashtable.so...
Quoted 6 lines
Also, I suggest moving all code from
hashtable_itr.candhashtable_utility.cintohashtable.c(and adding the appropriate declarations tohashtable.h). The copyrights and attributions in the files seem to be the same. We could get rid of all the clutter and have just 3 files related to hashtable, common to both xenstore and blktap2/drivers/.
Seems ok to me.
Ian.
Re: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
Quoted 52 lines · Ian Campbell
Quoted 21 lines · Shriram Rajagopalan
On Mon, Mar 21, 2011 at 11:03 AM, Ian Jackson <[email protected]> wrote:
Ian Campbell writes ("[Xen-devel] [PATCH 09 of 30] tools:
blktap2: copyxenstore/hashtable.hinto blktap2"):
> tools: blktap2: copyxenstore/hashtable.hinto blktap2 >
>hashtable.chas already been copied, forked and modified, there
> doesn't seem much point in avoiding the same for the header until
> someone feels motivated to properly refactor.Before we make this any worse, perhaps we should at least leave a
comment in every copy ofhashtable.creferring to every other clone ?Ian.
Quoted 8 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develcopying
hashtable.halone wont suffice.hashtable_itr.hin blktap2/drivers includeshashtable_private.hin xenstore/The commit copies both, although I forgot to update the description to say so.
Quoted 2 lines
And a diff -wu
blktap2/drivers/hashtable.cxenstore/hashtable.cshows no functional difference between the two versions.Well, there are definitely some functional differences, they may well be trivial I suppose but determining that did not look immediately trivial so I didn't dig deeper.
answered below
If someone wants to merge the two versions and validate that it works for both usages I would be happy to have that patch instead of this one, or to have this one in the interim while that gets sorted out.
Quoted 4 lines
How about pulling the
hashtable.h,hashtable.c,hashtable_private.h
from xenstore/ and hashtable_itr.[h,c], hashtable_utility.[h,c] from blktap2/drivers/ into one common separate area, like utils/ or something.
Quoted 9 lines
Well, you can't just blindly take the blktap2 version since the xenstore version has had changes made to it since blktap2 forked its version off so you'd need to at least do a merge up pass first. In particular 9129:1c46091df7ce removed the use of floating point which seems like a useful change. 17816:189597fbb882 includes BSD portability fixes which are important for the xenstore usage (and 17819:57b8c74c35ef includes an incremental fix). I don't know if that accounts for all the differences or not.
I had already looked at those two change sets
9129: They are functionally same. Basically the blktap2 version uses 0.65 for specifying the load factor, while xenstore version uses 65 (used as %)
for the load factor.
17816: changing mallocs to callocs.
xenstore and blktap2 have no common dependency where this shared code
Quoted 5 lines
would sanely live, I suppose
tools/utilsortools/hashtableis as good as anywhere, although I'm not sure I think the world really needs libxenhashtable.so...that though is true. For this very reason alone, I think its simpler to
have these
two clones around than to refactor into a tools/util folder.
Quoted 7 lines
Quoted 6 lines
Also, I suggest moving all code from
hashtable_itr.candhashtable_utility.cintohashtable.c(and adding the appropriate declarations tohashtable.h). The copyrights and attributions in the files seem to be the same. We could get rid of all the clutter and have just 3 files related to hashtable, common to both xenstore and blktap2/drivers/.
Quoted 6 lines
Seems ok to me.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
In reply to Ian JacksonQuoted 9 lines · Ian Jackson
Ian Campbell writes ("[Xen-devel] [PATCH 09 of 30] tools: blktap2: copy
xenstore/hashtable.hinto blktap2"):Quoted 5 lines
tools: blktap2: copy
xenstore/hashtable.hinto blktap2
hashtable.chas already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.Before we make this any worse, perhaps we should at least leave a comment in every copy of
hashtable.creferring to every other clone ?
Sure. I found another one in vtpm_manager while doing so as well :-(
8<-----------------------
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300962476 0
# Node ID 708fdb28b0530e331a6df59cd42b1c3acfc85f8b # Parent 63f4adae7d7b70d323181ff31fc19f5432d283ff
tools: blktap2: copy xenstore/hashtable.h into blktap2
hashtable.c has already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.
Add comments to the various duplicated files cross-referencing each other for future reference and as a barrier to forking again...
tools/blktap2/drivers/Makefile +0 -2
@@ -29,8 +29,6 @@ REMUS-OBJS += hashtable.o REMUS-OBJS += hashtable.o REMUS-OBJS += hashtable_itr.o REMUS-OBJS += hashtable_utility.o - -$(REMUS-OBJS): CFLAGS += -I$(XEN_XENSTORE) LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src MEMSHR_DIR = $(XEN_ROOT)/tools/memshr
tools/blktap2/drivers/hashtable.c +6 -0
@@ -1,4 +1,10 @@/* Copyright (C) 2004 Christopher Clark <[email protected]> */ + +/* +* There are duplicates of this code in: +* - tools/xenstore/hashtable.c +* - tools/vtpm_manager/util/hashtable.c +*/ #include "hashtable.h" #include "hashtable_private.h"
tools/blktap2/drivers/hashtable.h new file +205 -0
205 lines not on this page · raw message
tools/blktap2/drivers/hashtable_itr.c +5 -0
@@ -1,4 +1,9 @@/* Copyright (C) 2002, 2004 Christopher Clark <[email protected]> */ + +/* +* There are duplicates of this code in: +* - tools/vtpm_manager/util/hashtable_itr.c +*/ #include "hashtable.h" #include "hashtable_private.h"
tools/blktap2/drivers/hashtable_itr.h +5 -0
@@ -1,4 +1,9 @@/* Copyright (C) 2002, 2004 Christopher Clark <[email protected]> */ + +/* +* There are duplicates of this code in: +* - tools/vtpm_manager/util/hashtable_itr.h +*/ #ifndef __HASHTABLE_ITR_CWC22__#define __HASHTABLE_ITR_CWC22__
tools/blktap2/drivers/hashtable_private.h new file +91 -0
91 lines not on this page · raw message
tools/vtpm_manager/util/hashtable.c +6 -0
@@ -31,6 +31,12 @@* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* +* There are duplicates of this code in: +* - tools/xenstore/hashtable.c +* - tools/blktap2/drivers/hashtable.c +*/ #include "hashtable.h" #include "hashtable_private.h"
tools/vtpm_manager/util/hashtable.h +5 -0
@@ -32,6 +32,11 @@* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* +* There are duplicates of this code in: +* - tools/xenstore/hashtable.h +* - tools/blktap2/drivers/hashtable.h +*/ #ifndef __HASHTABLE_CWC22_H__#define __HASHTABLE_CWC22_H__
tools/vtpm_manager/util/hashtable_itr.c +5 -0
@@ -31,6 +31,11 @@* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* +* There are duplicates of this code in: +* - tools/blktap2/drivers/hashtable_itr.c +*/ #include "hashtable.h" #include "hashtable_private.h"
tools/vtpm_manager/util/hashtable_itr.h +5 -0
@@ -31,6 +31,11 @@* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* +* There are duplicates of this code in: +* - tools/blktap2/drivers/hashtable_itr.h +*/ #ifndef __HASHTABLE_ITR_CWC22__
tools/vtpm_manager/util/hashtable_private.h +6 -0
@@ -31,6 +31,12 @@* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* +* There are duplicates of this code in: +* - tools/xenstore/hashtable_private.h +* - tools/blktap2/drivers/hashtable_private.h +*/ #ifndef __HASHTABLE_PRIVATE_CWC22_H__#define __HASHTABLE_PRIVATE_CWC22_H__
tools/xenstore/hashtable.c +6 -0
@@ -1,4 +1,10 @@/* Copyright (C) 2004 Christopher Clark <[email protected]> */ + +/* +* There are duplicates of this code in: +* - tools/blktap2/drivers/hashtable.c +* - tools/vtpm_manager/util/hashtable.c +*/ #include "hashtable.h" #include "hashtable_private.h"
tools/xenstore/hashtable.h +6 -0
@@ -1,4 +1,10 @@/* Copyright (C) 2002 Christopher Clark <[email protected]> */ + +/* +* There are duplicates of this code in: +* - tools/blktap2/drivers/hashtable.h +* - tools/vtpm_manager/util/hashtable.h +*/ #ifndef __HASHTABLE_CWC22_H__#define __HASHTABLE_CWC22_H__
tools/xenstore/hashtable_private.h +6 -0
@@ -1,4 +1,10 @@/* Copyright (C) 2002, 2004 Christopher Clark <[email protected]> */ + +/* +* There are duplicates of this code in: +* - tools/blktap2/drivers/hashtable_private.h +* - tools/vtpm_manager/util/hashtable_private.h +*/ #ifndef __HASHTABLE_PRIVATE_CWC22_H__#define __HASHTABLE_PRIVATE_CWC22_H__
Shriram Rajagopalan
Acked-byRe: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
Quoted 571 lines · Ian Campbell
Quoted 1 line · Ian Jackson
Ian Campbell writes ("[Xen-devel] [PATCH 09 of 30] tools: blktap2: copy
xenstore/hashtable.hinto blktap2"):Quoted 8 lines
Quoted 5 lines
tools: blktap2: copy
xenstore/hashtable.hinto blktap2
hashtable.chas already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.Before we make this any worse, perhaps we should at least leave a comment in every copy of
hashtable.creferring to every other clone ?Sure. I found another one in
vtpm_managerwhile doing so as well :-(8<-----------------------
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300962476 0
# Node ID708fdb28b0530e331a6df59cd42b1c3acfc85f8b# Parent63f4adae7d7b70d323181ff31fc19f5432d283ff
tools: blktap2: copyxenstore/hashtable.hinto blktap2
hashtable.chas already been copied, forked and modified, there doesn't seem much point in avoiding the same for the header until someone feels motivated to properly refactor.Add comments to the various duplicated files cross-referencing each other for future reference and as a barrier to forking again...
Signed-off-by Ian Campbell <[email protected]>diff -r
63f4adae7d7b-r708fdb28b053tools/blktap2/drivers/Makefiletools/blktap2/drivers/Makefile Thu Mar 24 10:27:56 2011 +0000 renamed from tools/blktap2/drivers/Makefile Wed Mar 23 17:04:20 2011 +0000 +0
-2@@ -29,8 +29,6 @@ REMUS-OBJS += hashtable.o REMUS-OBJS += hashtable.o REMUS-OBJS += hashtable_itr.o REMUS-OBJS += hashtable_utility.o - -$(REMUS-OBJS): CFLAGS += -I$(XEN_XENSTORE) LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src MEMSHR_DIR = $(XEN_ROOT)/tools/memshrdiff -r
63f4adae7d7b-r708fdb28b053tools/blktap2/drivers/hashtable.ctools/blktap2/drivers/hashtable.c Thu Mar 24 10:27:56 2011 +0000 renamed from tools/blktap2/drivers/hashtable.c Wed Mar 23 17:04:20 2011 +0000 +6
-0@@ -1,4 +1,10 @@ /* Copyright (C) 2004 Christopher Clark <[email protected]> */ + +/* + * There are duplicates of this code in: + * - tools/xenstore/hashtable.c + * - tools/vtpm_manager/util/hashtable.c + */ #include "hashtable.h"#include "
hashtable_private.h"
diff -r63f4adae7d7b-r708fdb28b053tools/blktap2/drivers/hashtable.htools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +1
-0@@ -0,0 +1,205 @@ +/* Copyright (C) 2002 Christopher Clark <[email protected]>*/
tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +20
-0+ +/* + * There are duplicates of this code in: + * - tools/xenstore/hashtable.h + * - tools/vtpm_manager/util/hashtable.h + */ + +#ifndef __HASHTABLE_CWC22_H__ +#define __HASHTABLE_CWC22_H__ + +struct hashtable; + +/* Example of use: + * + * struct hashtable *h; + * struct some_key *k; + * struct some_value *v; + * + * static unsigned int hash_from_key_fn( void *k ); + * static int keys_equal_fn ( void *key1, void *key2);
+ *+ * h = create_hashtable(16, hash_from_key_fn, keys_equal_fn); + * k = (struct some_key *) malloc(sizeof(struct some_key)); + * v = (struct some_value *) malloc(sizeof(struct some_value));+ *
+ * (initialise k and v to suitable values)
+ *
+ * if (!hashtable_insert(h,k,v))
+ * { exit(-1); }
+ *
+ * if (NULL == (found =hashtable_search(h,k)))
+ * {printf("not found!"); }
+ *
+ * if (NULL == (found =hashtable_remove(h,k)))
+ * {printf("Not found\n"); }
+ *
+ */tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +2
-0+ +/* Macros may be used to define type-safe(r) hashtable access functions,with
+ * methods specialized to take known key and value types as parameters.
+ *
+ * Example:
+ *
+ * Insert this at the start of your file:
+ *
+ *DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value);
+ *DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value);
+ *DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
+ *
+ * This defines the functions 'insert_some', 'search_some' and 'remove_some'.
+ * These operate just likehashtable_insertetc., with the same parameters,
+ * but their function signatures have 'structsome_key*' rather than
+ * 'void *', and hence can generate compile time errors if your program is
+ * supplying incorrect data as a key (and similarly for value).
+ *
+ * Note that the hash and key equality functions passed tocreate_hashtable
+ * still take 'void *' parameters instead of 'some key *'. This shouldn't be
+ * a difficult issue as they're only defined and passed once, and the other
+ * functions will ensure that only valid keys are supplied to them.
+ *
+ * The cost for this checking is increased code size and runtime overhead
+ * - if performance is important, it may be worth switching back to the
+ * unsafe methods once your program has been debugged with the safe methods.
+ * This just requires switching to some simple alternative defines - eg:
+ * #defineinsert_somehashtable_insert
+ *
+ */tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +22
-0+ +/***************************************************************************** + * create_hashtable + + * @name create_hashtable + * @param minsize minimum initial size of hashtable + * @param hashfunction function for hashing keys + * @param key_eq_fn function for determining key equality + * @return newly created hashtable or NULL on failure + */ + +struct hashtable * +create_hashtable(unsigned int minsize, + unsigned int (*hashfunction) (void*), + int (*key_eq_fn) (void*,void*)); + +/***************************************************************************** + * hashtable_insert + + * @name hashtable_insert + * @param h the hashtable to insert into + * @param k the key - hashtable claims ownership and will free onremoval
+ * @param v the value - does not claim ownership
+ * @return non-zero for successful insertion
+ *
+ * This function will cause the table to expand if the insertion would take
+ * the ratio of entries to table size over the maximum load factor.
+ *
+ * This function does not check for repeated insertions with a duplicate key.
+ * The value returned when using a duplicate key is undefined -- when
+ * the hashtable changes size, the order of retrieval of duplicate key
+ * entries is reversed.
+ * If in doubt, remove before insert.
+ */tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +64
-0+ +int +hashtable_insert(struct hashtable *h, void *k, void *v); + +#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \ +int fnname (struct hashtable *h, keytype *k, valuetype *v) \ +{ \ + return hashtable_insert(h,k,v); \ +} + +/***************************************************************************** + * hashtable_search + + * @name hashtable_search + * @param h the hashtable to search + * @param k the key to search for - does not claim ownership + * @return the value associated with the key, or NULL if none found + */ + +void * +hashtable_search(struct hashtable *h, void *k); + +#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \ +valuetype * fnname (struct hashtable *h, keytype *k) \ +{ \ + return (valuetype *) (hashtable_search(h,k)); \ +} + +/***************************************************************************** + * hashtable_remove + + * @name hashtable_remove + * @param h the hashtable to remove the item from + * @param k the key to search for - does not claim ownership + * @return the value associated with the key, or NULL if none found + */ + +void * /* returns value */ +hashtable_remove(struct hashtable *h, void *k); + +#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \ +valuetype * fnname (struct hashtable *h, keytype *k) \ +{ \ + return (valuetype *) (hashtable_remove(h,k)); \ +} + + +/***************************************************************************** + * hashtable_count + + * @name hashtable_count + * @param h the hashtable + * @return the number of items stored in the hashtable + */ +unsigned int +hashtable_count(struct hashtable *h); + + +/***************************************************************************** + * hashtable_destroy + + * @name hashtable_destroy + * @param h the hashtable + * @param free_values whether to call 'free' on the remainingvalues
+ */tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +22
-0+ +void +hashtable_destroy(struct hashtable *h, int free_values); + +#endif /* __HASHTABLE_CWC22_H__ */ + +/* + * Copyright (c) 2002, Christopher Clark + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of anycontributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/
diff -r63f4adae7d7b-r708fdb28b053tools/blktap2/drivers/hashtable_itr.c
---a/tools/blktap2/drivers/hashtable_itr.cWed Mar 23 17:04:20 2011
+0000
+++b/tools/blktap2/drivers/hashtable_itr.cThu Mar 24 10:27:56 2011
+0000tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +0
-0@@ -1,4 +1,9 @@ /* Copyright (C) 2002, 2004 Christopher Clark <tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5
-0+ +/* + * There are duplicates of this code in: + * - tools/vtpm_manager/util/hashtable_itr.c + */ #include "hashtable.h" #include "hashtable_private.h"diff -r
63f4adae7d7b-r708fdb28b053tools/blktap2/drivers/hashtable_itr.h
---a/tools/blktap2/drivers/hashtable_itr.hWed Mar 23 17:04:20 2011
+0000
+++b/tools/blktap2/drivers/hashtable_itr.hThu Mar 24 10:27:56 2011
+0000tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +0
-0@@ -1,4 +1,9 @@ /* Copyright (C) 2002, 2004 Christopher Clark <tools/blktap2/drivers/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5
-0+ +/* + * There are duplicates of this code in: + * - tools/vtpm_manager/util/hashtable_itr.h + */ #ifndef __HASHTABLE_ITR_CWC22__ #define __HASHTABLE_ITR_CWC22__diff -r
63f4adae7d7b-r708fdb28b053tools/blktap2/drivers/hashtable_private.htools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +2
-0+0000@@ -0,0 +1,91 @@ +/* Copyright (C) 2002, 2004 Christopher Clark <tools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +74
-0+ +/* + * There are duplicates of this code in: + * - tools/xenstore/hashtable_private.h + * - tools/vtpm_manager/util/hashtable_private.h + */ + +#ifndef __HASHTABLE_PRIVATE_CWC22_H__ +#define __HASHTABLE_PRIVATE_CWC22_H__ + +#include "hashtable.h" + +/*****************************************************************************/ +struct entry +{ + void *k, *v; + unsigned int h; + struct entry *next; +}; + +struct hashtable { + unsigned int tablelength; + struct entry **table; + unsigned int entrycount; + unsigned int loadlimit; + unsigned int primeindex; + unsigned int (*hashfn) (void *k); + int (*eqfn) (void *k1, void *k2); +}; + +/*****************************************************************************/ +unsigned int +hash(struct hashtable *h, void *k); + +/*****************************************************************************/ +/* indexFor */ +static inline unsigned int +indexFor(unsigned int tablelength, unsigned int hashvalue) { + return (hashvalue % tablelength); +}; + +/* Only works if tablelength == 2^N */ +/*static inline unsigned int +indexFor(unsigned int tablelength, unsigned int hashvalue) +{ + return (hashvalue & (tablelength - 1u)); +} +*/ + +/*****************************************************************************/ +#define freekey(X) free(X) +/*define freekey(X) ; */ + + +/*****************************************************************************/ + +#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/ + +/* + * Copyright (c) 2002, Christopher Clark + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the original author; nor the names of anycontributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/
diff -r63f4adae7d7b-r708fdb28b053tools/vtpm_manager/util/hashtable.c
---a/tools/vtpm_manager/util/hashtable.cWed Mar 23 17:04:20 2011
+0000
+++b/tools/vtpm_manager/util/hashtable.cThu Mar 24 10:27:56 2011
+0000tools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +6
-0@@ -31,6 +31,12 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* + * There are duplicates of this code in: + * - tools/xenstore/hashtable.c + * - tools/blktap2/drivers/hashtable.c + */ #include "hashtable.h" #include "hashtable_private.h"diff -r
63f4adae7d7b-r708fdb28b053tools/vtpm_manager/util/hashtable.h
---a/tools/vtpm_manager/util/hashtable.hWed Mar 23 17:04:20 2011
+0000
+++b/tools/vtpm_manager/util/hashtable.hThu Mar 24 10:27:56 2011
+0000tools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5
-0@@ -32,6 +32,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* + * There are duplicates of this code in: + * - tools/xenstore/hashtable.h + * - tools/blktap2/drivers/hashtable.h + */ #ifndef __HASHTABLE_CWC22_H__ #define __HASHTABLE_CWC22_H__diff -r
63f4adae7d7b-r708fdb28b053tools/vtpm_manager/util/hashtable_itr.c
---a/tools/vtpm_manager/util/hashtable_itr.cWed Mar 23 17:04:20 2011
+0000
+++b/tools/vtpm_manager/util/hashtable_itr.cThu Mar 24 10:27:56 2011
+0000tools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5
-0@@ -31,6 +31,11 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* + * There are duplicates of this code in: + * - tools/blktap2/drivers/hashtable_itr.c + */ #include "hashtable.h" #include "hashtable_private.h"diff -r
63f4adae7d7b-r708fdb28b053tools/vtpm_manager/util/hashtable_itr.h
---a/tools/vtpm_manager/util/hashtable_itr.hWed Mar 23 17:04:20 2011
+0000
+++b/tools/vtpm_manager/util/hashtable_itr.hThu Mar 24 10:27:56 2011
+0000tools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5
-0@@ -31,6 +31,11 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* + * There are duplicates of this code in: + * - tools/blktap2/drivers/hashtable_itr.h + */ #ifndef __HASHTABLE_ITR_CWC22__diff -r
63f4adae7d7b-r708fdb28b053tools/vtpm_manager/util/hashtable_private.h
---a/tools/vtpm_manager/util/hashtable_private.hWed Mar 23 17:04:20
2011 +0000
+++b/tools/vtpm_manager/util/hashtable_private.hThu Mar 24 10:27:56
2011 +0000tools/blktap2/drivers/hashtable_private.h Thu Mar 24 10:27:56 2011 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +6
-0@@ -31,6 +31,12 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* + * There are duplicates of this code in: + * - tools/xenstore/hashtable_private.h + * - tools/blktap2/drivers/hashtable_private.h + */ #ifndef __HASHTABLE_PRIVATE_CWC22_H__ #define __HASHTABLE_PRIVATE_CWC22_H__diff -r
63f4adae7d7b-r708fdb28b053tools/xenstore/hashtable.ctools/xenstore/hashtable.c Thu Mar 24 10:27:56 2011 +0000 renamed from tools/xenstore/hashtable.c Wed Mar 23 17:04:20 2011 +0000 +6
-0@@ -1,4 +1,10 @@ /* Copyright (C) 2004 Christopher Clark <[email protected]> */ + +/* + * There are duplicates of this code in: + * - tools/blktap2/drivers/hashtable.c + * - tools/vtpm_manager/util/hashtable.c + */ #include "hashtable.h"#include "
hashtable_private.h"
diff -r63f4adae7d7b-r708fdb28b053tools/xenstore/hashtable.htools/xenstore/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from tools/xenstore/hashtable.h Wed Mar 23 17:04:20 2011 +0000 +6
-0@@ -1,4 +1,10 @@ /* Copyright (C) 2002 Christopher Clark <[email protected]> */ + +/* + * There are duplicates of this code in: + * - tools/blktap2/drivers/hashtable.h + * - tools/vtpm_manager/util/hashtable.h + */ #ifndef __HASHTABLE_CWC22_H__#define
__HASHTABLE_CWC22_H__
diff -r63f4adae7d7b-r708fdb28b053tools/xenstore/hashtable_private.h
---a/tools/xenstore/hashtable_private.hWed Mar 23 17:04:20 2011
+0000
+++b/tools/xenstore/hashtable_private.hThu Mar 24 10:27:56 2011
+0000tools/xenstore/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from tools/xenstore/hashtable.h Wed Mar 23 17:04:20 2011 +0000 +0
-0@@ -1,4 +1,10 @@ /* Copyright (C) 2002, 2004 Christopher Clark <tools/xenstore/hashtable.h Thu Mar 24 10:27:56 2011 +0000 renamed from tools/xenstore/hashtable.h Wed Mar 23 17:04:20 2011 +0000 +6
-0+ +/* + * There are duplicates of this code in: + * - tools/blktap2/drivers/hashtable_private.h + * - tools/vtpm_manager/util/hashtable_private.h + */ #ifndef __HASHTABLE_PRIVATE_CWC22_H__ #define __HASHTABLE_PRIVATE_CWC22_H__
Quoted 5 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
I am not sure if my ack is needed (as this touches hashtable* in blktap2/drivers/) :P.
If it is needed,
thanks
shriram
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
Quoted 2 lines · Shriram Rajagopalan
On Thu, Mar 24, 2011 at 3:29 AM, Ian Campbell
<[email protected]> wrote:
[...]
Quoted 4 lines
I am not sure if my ack is needed (as this touches hashtable* in blktap2/drivers/) :P.
If it is needed,
Either way more Acks (==eyes) are always good, thanks.
Ian Jackson
AppliedRe: [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2
In reply to Ian CampbellIan Campbell writes ("Re: [Xen-devel] [PATCH 09 of 30] tools: blktap2: copy xenstore/hashtable.h into blktap2"):
Quoted 1 line
Sure. I found another one in
vtpm_managerwhile doing so as well :-(
Applied, thanks. (In two bits because I forgot to hg add. Must remember to hg status before push ...)
Ian.
PATCH 1/1 tools: consistently use $(CFLAGS_xeninclude) instead of open coding
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID e97432a5c7e8be2bbfbb535e2278aa48456e9459
# Parent 30a1f7d0aa1097fd2b3f39b03742865bcfc38731
tools: consistently use $(CFLAGS_xeninclude) instead of open coding.
Renamed from the slightly ambiguous CFLAGS_include.
tools/Rules.mk +6 -6
@@ -15,17 +15,17 @@ XEN_LIBXENSTAT = $(XEN_ROOT)/tools/x XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src XEN_BLKTAP2 = $(XEN_ROOT)/tools/blktap2 -CFLAGS_include = -I$(XEN_INCLUDE) +CFLAGS_xeninclude = -I$(XEN_INCLUDE) -CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_include) +CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) LDLIBS_libxenctrl = -L$(XEN_LIBXC) -lxenctrl SHLIB_libxenctrl = -Wl,-rpath-link=$(XEN_LIBXC) -CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_include) +CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) LDLIBS_libxenguest = -L$(XEN_LIBXC) -lxenguest SHLIB_libxenguest = -Wl,-rpath-link=L$(XEN_LIBXC) -CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_include) +CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) LDLIBS_libxenstore = -L$(XEN_XENSTORE) -lxenstore SHLIB_libxenstore = -Wl,-rpath-link=$(XEN_XENSTORE)
@@ -36,7 +36,7 @@ endif endif ifeq ($(LIBXL_BLKTAP),y) -CFLAGS_libblktapctl = -I$(XEN_BLKTAP2)/control -I$(XEN_BLKTAP2)/include $(CFLAGS_include) +CFLAGS_libblktapctl = -I$(XEN_BLKTAP2)/control -I$(XEN_BLKTAP2)/include $(CFLAGS_xeninclude) LDLIBS_libblktapctl = -L$(XEN_BLKTAP2)/control -lblktapctl SHLIB_libblktapctl = -Wl,-rpath-link=$(XEN_BLKTAP2)/control else
@@ -45,7 +45,7 @@ SHLIB_libblktapctl = SHLIB_libblktapctl = endif -CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_include) +CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_xeninclude) LDLIBS_libxenlight = -L$(XEN_XENLIGHT) $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libblktapctl) -lxenlight SHLIB_libxenlight = -Wl,-rpath-link=$(XEN_XENLIGHT)
tools/blktap2/control/Makefile +2 -1
@@ -11,7 +11,8 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += -Wno-unused CFLAGS += -I../include -I../drivers -CFLAGS += -I$(XEN_INCLUDE) -I$(XEN_LIBXC) +CFLAGS += $(CFLAGS_xeninclude) +CFLAGS += -I$(XEN_LIBXC) CFLAGS += -D_GNU_SOURCE CFLAGS += -DTAPCTL
tools/debugger/gdbsx/xg/Makefile +1 -1
@@ -4,7 +4,7 @@ XG_HDRS := xg_public.h XG_HDRS := xg_public.h XG_OBJS := xg_main.o -CFLAGS += -I../../../include +CFLAGS += $(CFLAGS_xeninclude) .PHONY: all
tools/firmware/hvmloader/Makefile +1 -1
@@ -26,7 +26,7 @@ SUBDIRS := acpi # The HVM loader is started in 32-bit mode at the address below: LOADADDR = 0x100000 -CFLAGS += $(CFLAGS_include) +CFLAGS += $(CFLAGS_xeninclude) SRCS = hvmloader.c mp_tables.c util.c smbios.c SRCS += 32bitbios_support.c smp.c cacheattr.c xenbus.c
tools/firmware/hvmloader/acpi/Makefile +2 -2
@@ -21,7 +21,7 @@ C_SRC = build.c dsdt_anycpu.c dsdt_15cpu C_SRC = build.c dsdt_anycpu.c dsdt_15cpu.c static_tables.c OBJS = $(patsubst %.c,%.o,$(C_SRC)) -CFLAGS += $(CFLAGS_include) +CFLAGS += $(CFLAGS_xeninclude) vpath iasl $(PATH) all: acpi.a
@@ -33,7 +33,7 @@ ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl # NB. awk invocation is a portable alternative to 'head -n -1' dsdt_15cpu.c dsdt_anycpu.c: %.c: dsdt.asl mk_dsdt.c iasl - $(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_include) -o mk_$* mk_dsdt.c + $(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -o mk_$* mk_dsdt.c awk 'NR > 1 {print s} {s=$$0}' $< >$*.asl ./mk_$* >>$*.asl iasl -vs -p $* -tc $*.asl
tools/firmware/rombios/32bit/Makefile +1 -1
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/firmware/Rules TARGET = 32bitbios_flat.h -CFLAGS += $(CFLAGS_include) -I.. +CFLAGS += $(CFLAGS_xeninclude) -I.. SUBDIRS = tcgbios
tools/firmware/rombios/32bit/tcgbios/Makefile +1 -1
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/firmware/Rules TARGET = tcgbiosext.o -CFLAGS += $(CFLAGS_include) -I.. -I../.. +CFLAGS += $(CFLAGS_xeninclude) -I.. -I../.. .PHONY: all all: $(TARGET)
tools/flask/libflask/Makefile +1 -1
@@ -11,7 +11,7 @@ SRCS += flask_op.c CFLAGS += -Werror CFLAGS += -fno-strict-aliasing -CFLAGS += -I./include -I$(XEN_LIBXC) -I$(XEN_INCLUDE) +CFLAGS += -I./include -I$(XEN_LIBXC) $(CFLAGS_xeninclude) # Get gcc to generate the dependencies for us. CFLAGS += -Wp,-MD,.$(@F).d
tools/flask/utils/Makefile +0 -1
@@ -8,7 +8,6 @@ PROFILE=#-pg PROFILE=#-pg BASECFLAGS=-Wall -g -Werror BASECFLAGS+= $(PROFILE) -#BASECFLAGS+= -I$(XEN_ROOT)/tools BASECFLAGS+= $(CFLAGS_libxenctrl) BASECFLAGS+= -I$(LIBFLASK_ROOT)/include
tools/libxc/Makefile +1 -1
@@ -68,7 +68,7 @@ OSDEP_SRCS-y += xenctrl_ -include $(XEN_TARGET_ARCH)/Makefile CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += -I. -I../include +CFLAGS += -I. $(CFLAGS_xeninclude) # Needed for posix_fadvise64() in xc_linux.c CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
tools/memshr/Makefile +1 -1
@@ -5,7 +5,7 @@ LIBMEMSHR-BUILD := libmemshr.a CFLAGS += -Werror CFLAGS += -Wno-unused -CFLAGS += -I../include +CFLAGS += $(CFLAGS_xeninclude) CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += -D_GNU_SOURCE CFLAGS += -fPIC
tools/misc/Makefile +1 -1
@@ -4,7 +4,7 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += -I $(XEN_LIBXC) -CFLAGS += -I $(XEN_INCLUDE) +CFLAGS += $(CFLAGS_xeninclude) HDRS = $(wildcard *.h)
tools/ocaml/common.make +1 -1
@@ -9,7 +9,7 @@ OCAMLYACC ?= ocamlyacc OCAMLYACC ?= ocamlyacc CFLAGS += -fPIC -Werror -CFLAGS += -I$(TOPLEVEL)/../include -I$(TOPLEVEL)/../libxc -I$(TOPLEVEL)/../xenstore -I$(TOPLEVEL)/../libxl +CFLAGS += $(CFLAGS_xeninclude) -I$(TOPLEVEL)/../libxc -I$(TOPLEVEL)/../xenstore -I$(TOPLEVEL)/../libxl CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
tools/tests/mce-test/tools/Makefile +1 -1
@@ -4,7 +4,7 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += -I $(XEN_LIBXC) -CFLAGS += -I $(XEN_INCLUDE) +CFLAGS += $(CFLAGS_xeninclude) HDRS = $(wildcard *.h)
tools/tests/xen-access/Makefile +1 -1
@@ -4,7 +4,7 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += -I $(XEN_LIBXC) -CFLAGS += -I $(XEN_INCLUDE) +CFLAGS += $(CFLAGS_xeninclude) TARGETS-y := TARGETS-$(CONFIG_X86) += xen-access
tools/xenstat/libxenstat/Makefile +1 -1
@@ -36,7 +36,7 @@ SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,li WARN_FLAGS=-Wall -Werror -CFLAGS+=-Isrc -I$(XEN_LIBXC) -I$(XEN_XENSTORE) -I$(XEN_INCLUDE) +CFLAGS+=-Isrc -I$(XEN_LIBXC) -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) LDFLAGS+=-Lsrc -L$(XEN_XENSTORE)/ -L$(XEN_LIBXC)/ LDLIBS-y = -lxenstore -lxenctrl LDLIBS-$(CONFIG_SunOS) += -lkstat
PATCH 1/1 tools: consistently use $({CFLAGS, LDLIBS}_libxenctrl) instead of open coding
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID 6fda0df59ce0845d8408de933b8d323018ad4abf
# Parent e97432a5c7e8be2bbfbb535e2278aa48456e9459
tools: consistently use $({CFLAGS,LDLIBS}_libxenctrl) instead of open coding.
tools/blktap2/control/Makefile +1 -1
@@ -12,7 +12,7 @@ CFLAGS += -Wno-unused CFLAGS += -Wno-unused CFLAGS += -I../include -I../drivers CFLAGS += $(CFLAGS_xeninclude) -CFLAGS += -I$(XEN_LIBXC) +CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += -D_GNU_SOURCE CFLAGS += -DTAPCTL
tools/blktap2/drivers/Makefile +1 -1
@@ -40,7 +40,7 @@ endif endif tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a -tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS += -I$(LIBAIO_DIR) -I$(XEN_LIBXC) +tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS += -I$(LIBAIO_DIR) ifeq ($(VHD_STATIC),y) td-util: CFLAGS += -static
tools/flask/libflask/Makefile +2 -4
@@ -4,14 +4,12 @@ XEN_ROOT = $(CURDIR)/../../.. XEN_ROOT = $(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -XEN_LIBXC = $(XEN_ROOT)/tools/libxc - SRCS := SRCS += flask_op.c CFLAGS += -Werror CFLAGS += -fno-strict-aliasing -CFLAGS += -I./include -I$(XEN_LIBXC) $(CFLAGS_xeninclude) +CFLAGS += -I./include $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) # Get gcc to generate the dependencies for us. CFLAGS += -Wp,-MD,.$(@F).d
@@ -58,6 +56,6 @@ libflask.so.$(MAJOR): libflask.so.$(MAJO ln -sf $< $@ libflask.so.$(MAJOR).$(MINOR): $(PIC_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libflask.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libflask.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxenctrl) -include $(DEPS)
tools/flask/utils/Makefile +2 -4
@@ -1,8 +1,6 @@ XEN_ROOT=$(CURDIR)/../../.. XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -XEN_LIBXC = $(XEN_ROOT)/tools/libxc -LIBXC_ROOT = $(XEN_ROOT)/tools/libxc LIBFLASK_ROOT = $(XEN_ROOT)/tools/flask/libflask PROFILE=#-pg
@@ -12,7 +10,7 @@ BASECFLAGS+= -I$(LIBFLASK_ROOT)/include BASECFLAGS+= -I$(LIBFLASK_ROOT)/include CFLAGS += $(BASECFLAGS) -LDLIBS += $(PROFILE) -L$(XEN_LIBXC) -L$(LIBFLASK_ROOT) +LDLIBS += $(PROFILE) TESTDIR = testsuite/tmp TESTFLAGS= -DTESTING TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
@@ -25,7 +23,7 @@ all: $(CLIENTS) all: $(CLIENTS) $(CLIENTS): flask-%: %.o - $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ .PHONY: clean clean:
tools/libxc/Makefile +2 -2
@@ -193,10 +193,10 @@ xc_dom_bzimageloader.opic: CFLAGS += $(c libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l) libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz -L. -lxenctrl $(PTHREAD_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so - $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) -L. -lxenctrl + $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) -include $(DEPS)
tools/libxl/Makefile +1 -1
@@ -87,7 +87,7 @@ libxenlight.so.$(MAJOR): libxenlight.so. ln -sf $< $@ libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS) - $(CC) $(CFLAGS) -Wl,-rpath-link -Wl,$(XEN_ROOT)/tools/libxc $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) libxenlight.a: $(LIBXL_OBJS) $(AR) rcs libxenlight.a $^
tools/misc/Makefile +1 -1
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_LIBXC) +CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_xeninclude) HDRS = $(wildcard *.h)
tools/ocaml/common.make +1 -1
@@ -9,7 +9,7 @@ OCAMLYACC ?= ocamlyacc OCAMLYACC ?= ocamlyacc CFLAGS += -fPIC -Werror -CFLAGS += $(CFLAGS_xeninclude) -I$(TOPLEVEL)/../libxc -I$(TOPLEVEL)/../xenstore -I$(TOPLEVEL)/../libxl +CFLAGS += $(CFLAGS_xeninclude) $(CFLAGS_libxenctrl) -I$(TOPLEVEL)/../xenstore -I$(TOPLEVEL)/../libxl CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
tools/ocaml/libs/xc/Makefile +3 -3
@@ -2,14 +2,14 @@ XEN_ROOT=$(TOPLEVEL)/../.. XEN_ROOT=$(TOPLEVEL)/../.. include $(TOPLEVEL)/common.make -CFLAGS += -I../mmap -I$(XEN_ROOT)/tools/libxc -OCAMLINCLUDE += -I ../mmap -I ../uuid -I $(XEN_ROOT)/tools/libxc +CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) +OCAMLINCLUDE += -I ../mmap -I ../uuid OBJS = xc INTF = xc.cmi LIBS = xc.cma xc.cmxa -LIBS_xc = -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest +LIBS_xc = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) xc_OBJS = $(OBJS) xc_C_OBJS = xc_stubs
tools/tests/mce-test/tools/Makefile +1 -1
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_LIBXC) +CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_xeninclude) HDRS = $(wildcard *.h)
tools/tests/xen-access/Makefile +1 -1
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -CFLAGS += -I $(XEN_LIBXC) +CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_xeninclude) TARGETS-y :=
tools/xenstat/libxenstat/Makefile +3 -3
@@ -36,9 +36,9 @@ SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,li WARN_FLAGS=-Wall -Werror -CFLAGS+=-Isrc -I$(XEN_LIBXC) -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) -LDFLAGS+=-Lsrc -L$(XEN_XENSTORE)/ -L$(XEN_LIBXC)/ -LDLIBS-y = -lxenstore -lxenctrl +CFLAGS+=-Isrc $(CFLAGS_libxenctrl) -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) +LDFLAGS+=-Lsrc -L$(XEN_XENSTORE)/ +LDLIBS-y = -lxenstore $(LDLIBS_libxenctrl) LDLIBS-$(CONFIG_SunOS) += -lkstat ARLIBS-y = $(XEN_XENSTORE)/libxenstore.so $(XEN_LIBXC)/libxenctrl.so ARLIBS-x86_64 = /usr/lib/amd64/libkstat.so
PATCH 1/1 tools: consistently use $({CFLAGS, LDLIBS}_libxenstore) instead of open coding
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID d189faef58e1ebec67571879f86519f3aacf3b53
# Parent 6fda0df59ce0845d8408de933b8d323018ad4abf
tools: consistently use $({CFLAGS,LDLIBS}_libxenstore) instead of open coding.
tools/ocaml/common.make +1 -1
@@ -9,7 +9,7 @@ OCAMLYACC ?= ocamlyacc OCAMLYACC ?= ocamlyacc CFLAGS += -fPIC -Werror -CFLAGS += $(CFLAGS_xeninclude) $(CFLAGS_libxenctrl) -I$(TOPLEVEL)/../xenstore -I$(TOPLEVEL)/../libxl +CFLAGS += $(CFLAGS_xeninclude) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) -I$(TOPLEVEL)/../libxl CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
tools/xenstat/libxenstat/Makefile +2 -2
@@ -36,9 +36,9 @@ SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,li WARN_FLAGS=-Wall -Werror -CFLAGS+=-Isrc $(CFLAGS_libxenctrl) -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) +CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) LDFLAGS+=-Lsrc -L$(XEN_XENSTORE)/ -LDLIBS-y = -lxenstore $(LDLIBS_libxenctrl) +LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) LDLIBS-$(CONFIG_SunOS) += -lkstat ARLIBS-y = $(XEN_XENSTORE)/libxenstore.so $(XEN_LIBXC)/libxenctrl.so ARLIBS-x86_64 = /usr/lib/amd64/libkstat.so
tools/xenstore/Makefile +2 -2
@@ -53,10 +53,10 @@ xenstored: $(XENSTORED_OBJS) ln -f xenstore $@ xenstore: xenstore_client.o $(LIBXENSTORE) - $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ xenstore-control: xenstore_control.o $(LIBXENSTORE) - $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
PATCH 1/1 tools: consistently use $({CFLAGS, LDLIBS}_libxenlight) instead of open coding
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID 5a131a7ca1cf877786f208003daa44b907a2702f
# Parent d189faef58e1ebec67571879f86519f3aacf3b53
tools: consistently use $({CFLAGS,LDLIBS}_libxenlight) instead of open coding.
tools/libxl/Makefile +1 -3
@@ -23,8 +23,6 @@ LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLI LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(UTIL_LIBS) $(LIBUUID_LIBS) LIBXLU_LIBS = - -CLIENT_LIBS = $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) LIBXL_OBJS-y = osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o ifeq ($(LIBXL_BLKTAP),y)
@@ -105,7 +103,7 @@ libxlutil.a: $(LIBXLU_OBJS) $(AR) rcs libxlutil.a $^ $(CLIENTS): $(XL_OBJS) libxlutil.so libxenlight.so - $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so libxenlight.so $(CLIENT_LIBS) + $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) .PHONY: install install: all
tools/ocaml/common.make +1 -1
@@ -9,7 +9,7 @@ OCAMLYACC ?= ocamlyacc OCAMLYACC ?= ocamlyacc CFLAGS += -fPIC -Werror -CFLAGS += $(CFLAGS_xeninclude) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) -I$(TOPLEVEL)/../libxl +CFLAGS += $(CFLAGS_xeninclude) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_libxenlight) CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
PATCH 1/1 tools: xenstat: install and use shared library
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 7516c1d3ee1fbf0e91cf215ab4956fc29c4c46a4 # Parent 5a131a7ca1cf877786f208003daa44b907a2702f
tools: xenstat: install and use shared library
Remove .so files from the .a file.
tools/Rules.mk +4 -0
@@ -28,6 +28,10 @@ CFLAGS_libxenstore = -I$(XEN_XENSTORE) $ CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) LDLIBS_libxenstore = -L$(XEN_XENSTORE) -lxenstore SHLIB_libxenstore = -Wl,-rpath-link=$(XEN_XENSTORE) + +CFLAGS_libxenstat = -I$(XEN_LIBXENSTAT) +LDLIBS_libxenstat = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -L$(XEN_LIBXENSTAT) -lxenstat +SHLIB_libxenstat = -Wl,-rpath-link=$(XEN_LIBXENSTAT) ifeq ($(CONFIG_Linux),y) LIBXL_BLKTAP = y
tools/xenstat/libxenstat/Makefile +10 -19
@@ -37,19 +37,15 @@ WARN_FLAGS=-Wall -Werror WARN_FLAGS=-Wall -Werror CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -LDFLAGS+=-Lsrc -L$(XEN_XENSTORE)/ + LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) LDLIBS-$(CONFIG_SunOS) += -lkstat -ARLIBS-y = $(XEN_XENSTORE)/libxenstore.so $(XEN_LIBXC)/libxenctrl.so -ARLIBS-x86_64 = /usr/lib/amd64/libkstat.so -ARLIBS-x86_32 = /usr/lib/libkstat.so -ARLIBS-$(CONFIG_SunOS) += $(ARLIBS-$(XEN_TARGET_ARCH)) .PHONY: all -all: $(LIB) +all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(LIB): $(OBJECTS-y) - $(AR) rc $@ $^ $(ARLIBS-y) + $(AR) rc $@ $^ $(RANLIB) $@ $(SHLIB): $(OBJECTS-y)
@@ -65,7 +61,7 @@ src/xenstat_solaris.o: src/xenstat_solar src/xenstat_solaris.o: src/xenstat_solaris.c src/xenstat_priv.h $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $< -src/libxenstat.so.$(MAJOR): $(LIB) +src/libxenstat.so.$(MAJOR): $(SHLIB) $(MAKE_LINK) $(<F) $@ src/libxenstat.so: src/libxenstat.so.$(MAJOR)
@@ -73,16 +69,11 @@ src/libxenstat.so: src/libxenstat.so.$(M .PHONY: install install: all -#install: all -# $(INSTALL_DATA) src/xenstat.h $(DESTDIR)$(includedir)/xenstat.h -# $(INSTALL_PROG) $(LIB) $(DESTDIR)$(libdir)/libxenstat.a -# $(INSTALL_PROG) $(SHLIB) \ -# $(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR).$(MINOR) -# $(MAKE_LINK) libxenstat.so.$(MAJOR).$(MINOR) \ -# $(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR) -# $(MAKE_LINK) libxenstat.so.$(MAJOR) \ -# $(DESTDIR)$(libdir)/libxenstat.so -# -$(LDCONFIG) + $(INSTALL_DATA) src/xenstat.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIBDIR)/libxenstat.a + $(INSTALL_PROG) src/libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR) + ln -sf libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstat.so.$(MAJOR) + ln -sf libxenstat.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstat.so PYLIB=bindings/swig/python/_xenstat.so PYMOD=bindings/swig/python/xenstat.py
@@ -156,7 +147,7 @@ endif .PHONY: clean clean: - rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \ + rm -f $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \ $(BINDINGS) $(BINDINGSRC) $(DEPS) -include $(DEPS)
tools/xenstat/xentop/Makefile +2 -3
@@ -18,9 +18,8 @@ all install xentop: all install xentop: else -CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT) -LDFLAGS += -L$(XEN_LIBXENSTAT) -LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS) +CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat) +LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS) CFLAGS += -DHOST_$(XEN_OS) .PHONY: all
PATCH 1/1 tools: Drop $(X11_LDPATH) from build
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID e58adb757dc14201b8ec9d37f6baa34cae471579 # Parent 7516c1d3ee1fbf0e91cf215ab4956fc29c4c46a4
tools: Drop $(X11_LDPATH) from build.
Nothing uses it.
tools/Rules.mk +0 -2
@@ -53,8 +53,6 @@ LDLIBS_libxenlight = -L$(XEN_XENLIGHT) $ LDLIBS_libxenlight = -L$(XEN_XENLIGHT) $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libblktapctl) -lxenlight SHLIB_libxenlight = -Wl,-rpath-link=$(XEN_XENLIGHT) -X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR) - CFLAGS += -D__XEN_TOOLS__ # Get gcc to generate the dependencies for us.
PATCH 1/1 tools: allow Makefiles to define CFLAGS_foo.o
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID fa367151e9cd2f6f43a530925e985dde5fc9b776 # Parent e58adb757dc14201b8ec9d37f6baa34cae471579
tools: allow Makefiles to define CFLAGS_foo.o
To provide per-file flags.
tools/Rules.mk +3 -3
@@ -81,13 +81,13 @@ INSTALL_PYTHON_PROG = \ $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG) %.opic: %.c - $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< + $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS_$*.opic) -fPIC -c -o $@ $< %.o: %.c - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -o $@ $< %.o: %.cc - $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS_$*.o) -c -o $@ $< subdirs-all subdirs-clean subdirs-install subdirs-distclean: .phony @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
PATCH 1/1 tools: ocaml: link xl bindings against libxl
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 268469483e35aff1355342264f304117225e655a # Parent fa367151e9cd2f6f43a530925e985dde5fc9b776
tools: ocaml: link xl bindings against libxl
tools/ocaml/libs/xl/Makefile +2 -0
@@ -5,6 +5,8 @@ OBJS = xl OBJS = xl INTF = xl.cmi LIBS = xl.cma xl.cmxa + +LIBS_xl = $(LDLIBS_libxenlight) xl_OBJS = $(OBJS) xl_C_OBJS = xl_stubs
PATCH 1/1 tools: ocaml: link evtchn bindings against libxenctrl
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID e260a7ba1ae77117c69369d37434b54e9de1c74d # Parent 268469483e35aff1355342264f304117225e655a
tools: ocaml: link evtchn bindings against libxenctrl
tools/ocaml/libs/eventchn/Makefile +2 -0
@@ -5,6 +5,8 @@ OBJS = eventchn OBJS = eventchn INTF = $(foreach obj, $(OBJS),$(obj).cmi) LIBS = eventchn.cma eventchn.cmxa + +LIBS_evtchn = $(LDLIBS_libxenctrl) all: $(INTF) $(LIBS) $(PROGRAMS)
PATCH 1/1 tools: users of libxl currently need to see libxc and libxenstore headers
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID 27741a8c4a6fe0d6abf239977538c013bd474998
# Parent e260a7ba1ae77117c69369d37434b54e9de1c74d
tools: users of libxl currently need to see libxc and libxenstore headers
So add them to CFLAGS_libxenlight
tools/Rules.mk +1 -1
@@ -49,7 +49,7 @@ SHLIB_libblktapctl = SHLIB_libblktapctl = endif -CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_xeninclude) +CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) LDLIBS_libxenlight = -L$(XEN_XENLIGHT) $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libblktapctl) -lxenlight SHLIB_libxenlight = -Wl,-rpath-link=$(XEN_XENLIGHT)
PATCH 1/1 tools: ocaml: push CFLAGS usage down into the specific bindings
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID 2276552067f8cad6123115534524bfa4bdbadb30
# Parent 27741a8c4a6fe0d6abf239977538c013bd474998
tools: ocaml: push CFLAGS usage down into the specific bindings
tools/ocaml/common.make +0 -1
@@ -9,7 +9,6 @@ OCAMLYACC ?= ocamlyacc OCAMLYACC ?= ocamlyacc CFLAGS += -fPIC -Werror -CFLAGS += $(CFLAGS_xeninclude) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_libxenlight) CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
tools/ocaml/libs/eventchn/Makefile +2 -0
@@ -1,6 +1,8 @@ TOPLEVEL=$(CURDIR)/../.. TOPLEVEL=$(CURDIR)/../.. XEN_ROOT=$(TOPLEVEL)/../.. include $(TOPLEVEL)/common.make + +CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) OBJS = eventchn INTF = $(foreach obj, $(OBJS),$(obj).cmi)
tools/ocaml/libs/xb/Makefile +2 -0
@@ -3,6 +3,8 @@ include $(TOPLEVEL)/common.make include $(TOPLEVEL)/common.make CFLAGS += -I../mmap +CFLAGS += $(CFLAGS_libxenctrl) # For xen_mb() +CFLAGS += $(CFLAGS_xeninclude) OCAMLINCLUDE += -I ../mmap .NOTPARALLEL:
tools/ocaml/libs/xb/xs_ring_stubs.c +0 -4
@@ -34,10 +34,6 @@#include "mmap_stubs.h" #define GET_C_STRUCT (a) ((struct mmap_interface *) a) - -#ifndef xen_mb -#define xen_mb () mb() -#endif static int xs_ring_read (struct mmap_interface *interface,char *buffer,int len)
tools/ocaml/libs/xl/Makefile +2 -0
@@ -1,6 +1,8 @@ TOPLEVEL=$(CURDIR)/../.. TOPLEVEL=$(CURDIR)/../.. XEN_ROOT=$(TOPLEVEL)/../.. include $(TOPLEVEL)/common.make + +CFLAGS += $(CFLAGS_libxenlight) OBJS = xl INTF = xl.cmi
tools/ocaml/libs/xs/Makefile +0 -8
@@ -23,14 +23,6 @@ xs_OBJS = $(OBJS) xs_OBJS = $(OBJS) OCAML_NOC_LIBRARY = xs -#xs.cmxa: $(foreach obj,$(OBJS),$(obj).cmx) -# $(E) " MLLIB $@" -# $(Q)$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx) -# -#xs.cma: $(foreach obj,$(OBJS),$(obj).cmo) -# $(E) " MLLIB $@" -# $(Q)$(OCAMLC) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmo) - .PHONY: install install: $(LIBS) META mkdir -p $(OCAMLDESTDIR)
PATCH 1/1 tools: flask: Remove BASECFLAGS, just use CFLAGS
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 9c2a39e72b04831f3402ce22926e906da636fe8c # Parent 2276552067f8cad6123115534524bfa4bdbadb30
tools: flask: Remove BASECFLAGS, just use CFLAGS
tools/flask/utils/Makefile +3 -7
@@ -3,14 +3,10 @@ include $(XEN_ROOT)/tools/Rules.mk LIBFLASK_ROOT = $(XEN_ROOT)/tools/flask/libflask -PROFILE=#-pg -BASECFLAGS=-Wall -g -Werror -BASECFLAGS+= $(PROFILE) -BASECFLAGS+= $(CFLAGS_libxenctrl) -BASECFLAGS+= -I$(LIBFLASK_ROOT)/include +CFLAGS += -Wall -g -Werror +CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += -I$(LIBFLASK_ROOT)/include -CFLAGS += $(BASECFLAGS) -LDLIBS += $(PROFILE) TESTDIR = testsuite/tmp TESTFLAGS= -DTESTING TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
PATCH 1/1 tools: flask: remove $(LOADLIBES)
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 6bce01ea806f9fc0a2cd9ceb5ca0e11b179a38b3 # Parent 9c2a39e72b04831f3402ce22926e906da636fe8c
tools: flask: remove $(LOADLIBES)
Probably a typo and never defined, I can't tell what it was supposed to be.
tools/flask/utils/Makefile +1 -1
@@ -19,7 +19,7 @@ all: $(CLIENTS) all: $(CLIENTS) $(CLIENTS): flask-%: %.o - $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ .PHONY: clean clean:
PATCH 1/1 tools: provide generic rules for compiling .S files
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID b298aa44524e9c36619eb00bffaa37f36c68acce # Parent 6bce01ea806f9fc0a2cd9ceb5ca0e11b179a38b3
tools: provide generic rules for compiling .S files
tools/Rules.mk +5 -0
@@ -89,6 +89,11 @@ INSTALL_PYTHON_PROG = \ %.o: %.cc $(CC) $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS_$*.o) -c -o $@ $< +%.o: %.S + $(CC) $(CFLAGS) $(CFLAGS_$*.o) -c $< -o $@ +%.opic: %.S + $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< + subdirs-all subdirs-clean subdirs-install subdirs-distclean: .phony @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \ $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
tools/libxc/ia64/Makefile +0 -6
@@ -16,13 +16,7 @@ DOMFW_SRCS := $(addprefix ia64/, $(DOMFW $(DOMFW_SRCS): ln -sf $(XEN_ROOT)/xen/arch/ia64/xen/$(@F) $@ -# XXX kludge: libxc/Makefile doesn't understand .S. GUEST_SRCS-y += $(patsubst %.S, %.c, $(DOMFW_SRCS)) -%.o: %.S - $(CC) $(CFLAGS) -c $< -o $@ -%.opic: %.S - $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< - CFLAGS += -Iia64
PATCH 1/1 tools: Remove $(CFLAGS) from links lines
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 83ba7f8b634d542fea896ab16ce3f80220d14cb1 # Parent b298aa44524e9c36619eb00bffaa37f36c68acce
tools: Remove $(CFLAGS) from links lines.
The relevant variable in these circumstances is called $(LDFLAGS).
tools/blktap/drivers/Makefile +3 -3
@@ -48,16 +48,16 @@ all: $(IBIN) qcow-util all: $(IBIN) qcow-util blktapctrl: $(BLKTAB-OBJS-y) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS_blktapctrl) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_blktapctrl) tapdisk: tapdisk.o $(BLK-OBJS-y) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS_img) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_img) .PHONY: qcow-util qcow-util: img2qcow qcow2raw qcow-create img2qcow qcow2raw qcow-create: %: %.o $(BLK-OBJS-y) - $(CC) $(CFLAGS) $(LDFLAGS) -o $* $^ $(LDLIBS_img) + $(CC) $(LDFLAGS) -o $* $^ $(LDLIBS_img) install: all $(INSTALL_PROG) $(IBIN) $(QCOW_UTIL) $(VHD_UTIL) $(DESTDIR)$(SBINDIR)
tools/blktap/lib/Makefile +1 -1
@@ -46,7 +46,7 @@ clean: rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen TAGS libblktap.so.$(MAJOR).$(MINOR): $(OBJS_PIC) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_LDFLAGS) \ + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_LDFLAGS) \ -o $@ $^ $(LDLIBS) ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR) ln -sf libblktap.so.$(MAJOR) libblktap.so
tools/blktap2/control/Makefile +2 -2
@@ -56,13 +56,13 @@ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARE ln -sf $< $@ tap-ctl: tap-ctl.o $(LIBNAME).so - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ $(LIB_STATIC): $(CTL_OBJS) $(AR) r $@ $^ $(LIB_SHARED): $(CTL_PICS) - $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@ + $(CC) $(LDFLAGS) -fPIC -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@ install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED) $(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
tools/blktap2/lvm/Makefile +1 -1
@@ -28,7 +28,7 @@ install: all install: all lvm-util: lvm-util.o - $(CC) $(CFLAGS) -DLVM_UTIL $(LDFLAGS) -o lvm-util lvm-util.c + $(CC) -DLVM_UTIL $(LDFLAGS) -o lvm-util lvm-util.c clean: rm -rf *.o *~ $(DEPS) $(IBIN)
tools/blktap2/vhd/Makefile +2 -2
@@ -35,10 +35,10 @@ LIBS_DEPENDS := lib/libvhd.so lib/vhd. $(LIBS_DEPENDS):subdirs-all vhd-util: vhd-util.o $(LIBS_DEPENDS) - $(CC) $(CFLAGS) $(LDFLAGS) -o vhd-util vhd-util.o $(LIBS) + $(CC) $(LDFLAGS) -o vhd-util vhd-util.o $(LIBS) vhd-update: vhd-update.o $(LIBS_DEPENDS) - $(CC) $(CFLAGS) $(LDFLAGS) -o vhd-update vhd-update.o $(LIBS) + $(CC) $(LDFLAGS) -o vhd-update vhd-update.o $(LIBS) install: all $(MAKE) subdirs-install
tools/blktap2/vhd/lib/Makefile +1 -1
@@ -56,7 +56,7 @@ build: $(LIBVHD-BUILD) build: $(LIBVHD-BUILD) libvhd.a: $(LIB-OBJS) - $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG),$(LIBVHD-SONAME) $(SHLIB_LDFLAGS) \ + $(CC) -Wl,$(SONAME_LDFLAG),$(LIBVHD-SONAME) $(SHLIB_LDFLAGS) \ $(LDFLAGS) -o libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $^ $(LIBS) ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) libvhd.so.$(LIBVHD-MAJOR) ln -sf libvhd.so.$(LIBVHD-MAJOR) libvhd.so
tools/console/Makefile +2 -2
@@ -23,10 +23,10 @@ clean: $(RM) client/*.o daemon/*.o xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c)) - $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(LDLIBS_xenconsoled) + $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c)) - $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) $(LDLIBS_xenconsole) + $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) .PHONY: install install: $(BIN)
tools/debugger/kdd/Makefile +1 -1
@@ -10,7 +10,7 @@ all: kdd all: kdd kdd: $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) .PHONY: clean clean:
tools/flask/libflask/Makefile +1 -1
@@ -56,6 +56,6 @@ libflask.so.$(MAJOR): libflask.so.$(MAJO ln -sf $< $@ libflask.so.$(MAJOR).$(MINOR): $(PIC_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libflask.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxenctrl) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libflask.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxenctrl) -include $(DEPS)
tools/flask/utils/Makefile +1 -1
@@ -19,7 +19,7 @@ all: $(CLIENTS) all: $(CLIENTS) $(CLIENTS): flask-%: %.o - $(CC) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ .PHONY: clean clean:
tools/libfsimage/Rules.mk +1 -1
@@ -24,7 +24,7 @@ fs-install: fs-all $(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR) $(FSLIB): $(PIC_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) + $(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) clean distclean: rm -f $(PIC_OBJS) $(FSLIB) $(DEPS)
tools/libfsimage/common/Makefile +1 -1
@@ -37,7 +37,7 @@ libfsimage.so.$(MAJOR): libfsimage.so.$( ln -sf $< $@ libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ -lpthread + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ -lpthread -include $(DEPS)
tools/libxc/Makefile +3 -3
@@ -157,7 +157,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$( ln -sf $< $@ libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) $(PTHREAD_LIBS) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) $(PTHREAD_LIBS) # libxenguest
@@ -193,10 +193,10 @@ xc_dom_bzimageloader.opic: CFLAGS += $(c libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l) libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so - $(CC) -g $(CFLAGS) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) + $(CC) -g $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) -include $(DEPS)
tools/libxen/Makefile +1 -1
@@ -44,7 +44,7 @@ libxenapi.so.$(MAJOR): libxenapi.so.$(MA ln -sf $< $@ libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ libxenapi.a: $(LIBXENAPI_OBJS) $(AR) rcs libxenapi.a $^
tools/libxen/Makefile.dist +1 -1
@@ -54,7 +54,7 @@ libxenapi.so.$(MAJOR): libxenapi.so.$(MA ln -sf $< $@ libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ libxenapi.a: $(LIBXENAPI_OBJS) $(AR) rcs libxenapi.a $^
tools/libxl/Makefile +2 -2
@@ -85,7 +85,7 @@ libxenlight.so.$(MAJOR): libxenlight.so. ln -sf $< $@ libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) libxenlight.a: $(LIBXL_OBJS) $(AR) rcs libxenlight.a $^
@@ -97,7 +97,7 @@ libxlutil.so.$(XLUMAJOR): libxlutil.so.$ ln -sf $< $@ libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXLU_LIBS) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXLU_LIBS) libxlutil.a: $(LIBXLU_OBJS) $(AR) rcs libxlutil.a $^
tools/misc/Makefile +2 -2
@@ -58,9 +58,9 @@ clean: $(CC) -c $(CFLAGS) -o $@ $< xen-hvmctx xen-hvmcrash xenperf xenpm gtracestat xenlockprof xen-hptool xenwatchdogd: %: %.o Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS_$*) + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_$*) gtraceview: %: %.o Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CURSES_LIBS) + $(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) -include $(DEPS)
tools/ocaml/Makefile.rules +1 -1
@@ -84,7 +84,7 @@ endef define C_PROGRAM_template $(1): $(foreach obj,$($(1)_OBJS),$(obj).o) - $(call quiet-command, $(CC) $(CFLAGS) -o $$@ $$+,BIN,$$@) + $(call quiet-command, $(CC) $(LDFLAGS) -o $$@ $$+,BIN,$$@) endef -include .ocamldep.make
tools/security/Makefile +1 -1
@@ -76,7 +76,7 @@ build: $(ACM_INST_TOOLS) $(ACM_NOINST_TO chmod 700 $(ACM_SCRIPTS) xensec_tool: $(OBJS_TOOL) - $(CC) -g $(CFLAGS) $(LDFLAGS) -O0 -o $@ $^ $(LDLIBS_libxenctrl) + $(CC) -g $(LDFLAGS) -O0 -o $@ $^ $(LDLIBS_libxenctrl) xensec_gen: xensec_gen.py cp -f $^ $@
tools/tests/mce-test/tools/Makefile +1 -4
@@ -18,8 +18,5 @@ clean: clean: $(RM) *.o xen-mceinj -%.o: %.c $(HDRS) Makefile - $(CC) -c $(CFLAGS) -o $@ $< - xen-mceinj: %: %.o Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) + $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
tools/tests/xen-access/Makefile +2 -5
@@ -25,10 +25,7 @@ clean: $(RM) *.o $(TARGETS) *~ $(DEPS) set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done -%.o: %.c Makefile - $(CC) -c $(CFLAGS) -o $@ $< +xen-access: %: %.o Makefile + $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) -xen-access: %: %.o Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) -# $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -include $(DEPS)
tools/vtpm_manager/manager/Makefile +1 -1
@@ -29,7 +29,7 @@ mrproper: clean rm -f *~ $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ + $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ # libraries LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
tools/vtpm_manager/migration/Makefile +2 -2
@@ -33,10 +33,10 @@ mrproper: clean rm -f *~ $(BIND): $(OBJSD) - $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ + $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ $(BINC): $(OBJSC) - $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ + $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ # libraries LIBS += ../util/libTCGUtils.a
tools/xcutils/Makefile +5 -9
@@ -11,15 +11,14 @@ XEN_ROOT = $(CURDIR)/../.. XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk - PROGRAMS = xc_restore xc_save readnotes lsevtchn CFLAGS += -Werror -CFLAGS_xc_restore := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -CFLAGS_xc_save := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) -CFLAGS_readnotes := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -CFLAGS_lsevtchn := $(CFLAGS_libxenctrl) +CFLAGS_xc_restore.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) +CFLAGS_xc_save.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) +CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) +CFLAGS_lsevtchn.o := $(CFLAGS_libxenctrl) LDLIBS_xc_restore := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) LDLIBS_xc_save := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
@@ -32,11 +31,8 @@ all: build .PHONY: build build: $(PROGRAMS) -%.o: %.c - $(CC) $(CFLAGS) $(CFLAGS_$*) -c $^ -o $@ - $(PROGRAMS): %: %.o - $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_$*) -o $@ + $(CC) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_$*) -o $@ .PHONY: install install: build
tools/xenbackendd/Makefile +2 -2
@@ -35,7 +35,7 @@ clean: rm -f $(SBIN) $(DEPS) -%: %.c Makefile - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) +%: %.o Makefile + $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -include $(DEPS)
tools/xenmon/Makefile +5 -4
@@ -40,9 +40,10 @@ clean: rm -f $(BIN) $(DEPS) -%: %.c Makefile - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) -xentrace_%: %.c Makefile - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) +%: %.o Makefile + $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) + +xentrace_%: %.o Makefile + $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -include $(DEPS)
tools/xenpaging/Makefile +1 -1
@@ -22,7 +22,7 @@ all: $(IBINS) all: $(IBINS) xenpaging: $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) install: all $(INSTALL_DIR) $(DESTDIR)/var/lib/xen/xenpaging
tools/xenpmd/Makefile +5 -4
@@ -1,8 +1,9 @@ XEN_ROOT=$(CURDIR)/../.. XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -Werror -CFLAGS += $(CFLAGS_libxenstore) +CFLAGS += -Werror +CFLAGS += $(CFLAGS_libxenstore) + LDLIBS += $(LDLIBS_libxenstore) BIN = xenpmd
@@ -19,7 +20,7 @@ clean: clean: $(RM) -f $(BIN) $(DEPS) -%: %.c Makefile - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) +%: %.o Makefile + $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -include $(DEPS)
tools/xenstat/libxenstat/Makefile +1 -10
@@ -49,17 +49,8 @@ all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(RANLIB) $@ $(SHLIB): $(OBJECTS-y) - $(CC) $(CFLAGS) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \ + $(CC) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \ $(OBJECTS-y) $(LDLIBS-y) - -src/xenstat.o: src/xenstat.c src/xenstat.h src/xenstat_priv.h - $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $< - -src/xenstat_linux.o: src/xenstat_linux.c src/xenstat_priv.h - $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $< - -src/xenstat_solaris.o: src/xenstat_solaris.c src/xenstat_priv.h - $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $< src/libxenstat.so.$(MAJOR): $(SHLIB) $(MAKE_LINK) $(<F) $@
tools/xenstore/Makefile +5 -5
@@ -47,19 +47,19 @@ endif endif xenstored: $(XENSTORED_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ + $(CC) $(LDFLAGS) $^ $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(CLIENTS): xenstore ln -f xenstore $@ xenstore: xenstore_client.o $(LIBXENSTORE) - $(CC) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ xenstore-control: xenstore_control.o $(LIBXENSTORE) - $(CC) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS_libxenstore) $(SOCKET_LIBS) -o $@ xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o - $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ + $(CC) $(LDFLAGS) $^ -o $@ libxenstore.so: libxenstore.so.$(MAJOR) ln -sf $< $@
@@ -69,7 +69,7 @@ xs.opic: CFLAGS += -DUSE_PTHREAD xs.opic: CFLAGS += -DUSE_PTHREAD libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread libxenstore.a: xs.o xs_lib.o $(AR) rcs $@ $^
tools/xentrace/Makefile +6 -6
@@ -1,9 +1,9 @@ XEN_ROOT=$(CURDIR)/../.. XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += -Werror +CFLAGS += -Werror -CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(CFLAGS_libxenctrl) LDLIBS += $(LDLIBS_libxenctrl) HDRS = $(wildcard *.h)
@@ -49,10 +49,10 @@ clean: clean: $(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) $(DEPS) -%: %.c $(HDRS) Makefile - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) -xentrace_%: %.c $(HDRS) Makefile - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) +%: %.o $(HDRS) Makefile + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) +xentrace_%: %.o $(HDRS) Makefile + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -include $(DEPS)
PATCH 1/1 libxl: move libxl_doimid_valid_guest out of line
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 825082d71dd594e0eee41a4cb3b8006ea9e31451 # Parent 83ba7f8b634d542fea896ab16ce3f80220d14cb1
libxl: move libxl_doimid_valid_guest out of line
tools/libxl/libxl.h +1 -6
@@ -561,12 +561,7 @@ int libxl_cpupool_cpuremove_node(libxl_cint libxl_cpupool_cpuremove_node (libxl_ctx *ctx,uint32_t poolid,int node,int *cpus);int libxl_cpupool_movedomain (libxl_ctx *ctx,uint32_t poolid,uint32_t domid); -static inline int libxl_domid_valid_guest (uint32_t domid) -{ -/* returns 1 if the value _could_ be a valid guest domid, 0 otherwise -* does not check whether the domain actually exists */ -return domid >0 && domid <DOMID_FIRST_RESERVED ; -} +int libxl_domid_valid_guest (uint32_t domid);/* common paths */ const char *libxl_sbindir_path (void );
tools/libxl/libxl_utils.c +7 -0
@@ -55,6 +55,13 @@ const char *libxl_basename(const char *nif (filename)return strdup (filename+1 );return strdup (name); +} + +int libxl_domid_valid_guest (uint32_t domid) +{ +/* returns 1 if the value _could_ be a valid guest domid, 0 otherwise +* does not check whether the domain actually exists */ +return domid >0 && domid <DOMID_FIRST_RESERVED ; }unsigned long libxl_get_required_shadow_memory (unsigned long maxmem_kb,unsigned int smp_cpus)
PATCH 1/1 libxl: drop protype for libxl_ctx_set_log
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 0346391ed12e485c4fd1727eb5d4d7a88ac13542 # Parent 825082d71dd594e0eee41a4cb3b8006ea9e31451
libxl: drop protype for libxl_ctx_set_log
Nothing defines or uses it.
tools/libxl/libxl.h +0 -1
@@ -285,7 +285,6 @@ typedef struct {/* context functions */ int libxl_ctx_init (libxl_ctx *ctx,int version,xentoollog_logger *);int libxl_ctx_free (libxl_ctx *ctx); -int libxl_ctx_set_log (libxl_ctx *ctx,xentoollog_logger *);int libxl_ctx_postfork (libxl_ctx *ctx);/* domain related functions */
PATCH 1/1 libxl: remove XS transaction from public API
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 8789166a014f43bf66ec4b2af51a4771fb56a5d5 # Parent 0346391ed12e485c4fd1727eb5d4d7a88ac13542
libxl: remove XS transaction from public API.
All external users pass 0 anyway so make the version of libxl_domain_rename which takes a transaction internal and provide an external facing function which does not expose a transaction.
tools/libxl/libxl.c +17 -8
@@ -116,11 +116,11 @@ void libxl_key_value_list_destroy(libxl_/******************************************************************************/ -int libxl_domain_rename (libxl_ctx *ctx,uint32_t domid, -const char *old_name,const char *new_name, -xs_transaction_t trans) +int libxl__domain_rename (libxl__gc *gc,uint32_t domid, +const char *old_name,const char *new_name, +xs_transaction_t trans) { -libxl__gc gc =LIBXL_INIT_GC (ctx); +libxl_ctx *ctx =libxl__gc_owner (gc);char *dom_path =0 ;const char *name_path;char *got_old_name;
@@ -128,10 +128,10 @@ int libxl_domain_rename(libxl_ctx *ctx,xs_transaction_t our_trans =0 ;int rc; - dom_path =libxl__xs_get_dompath (&gc, domid); + dom_path =libxl__xs_get_dompath (gc, domid);if (!dom_path) goto x_nomem; - name_path=libxl__sprintf (&gc,"%s/name" , dom_path); + name_path=libxl__sprintf (gc,"%s/name" , dom_path);if (!name_path) goto x_nomem; retry_transaction:
@@ -211,11 +211,20 @@ int libxl_domain_rename(libxl_ctx *ctx, rc =0 ; x_rc:if (our_trans)xs_transaction_end (ctx->xsh, our_trans,1 ); -libxl__free_all (&gc);return rc; x_fail: rc =ERROR_FAIL ; goto x_rc; x_nomem: rc =ERROR_NOMEM ; goto x_rc; +} + +int libxl_domain_rename (libxl_ctx *ctx,uint32_t domid, +const char *old_name,const char *new_name) +{ +libxl__gc gc =LIBXL_INIT_GC (ctx); +int rc; + rc =libxl__domain_rename (&gc, domid, old_name, new_name,XBT_NULL ); +libxl__free_all (&gc); +return rc; }int libxl_domain_resume (libxl_ctx *ctx,uint32_t domid)
@@ -303,7 +312,7 @@ int libxl_domain_preserve(libxl_ctx *ctxxs_set_permissions (ctx->xsh, t, vm_path, roperm,ARRAY_SIZE (roperm));xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/vm" , dom_path), vm_path,strlen (vm_path)); - rc =libxl_domain_rename (ctx, domid, info->name, preserved_name, t); + rc =libxl__domain_rename (&gc, domid, info->name, preserved_name, t);if (rc) {libxl__free_all (&gc);return rc;
tools/libxl/libxl.h +2 -2
@@ -376,8 +376,8 @@ int libxl_event_get_disk_eject_info(libxint libxl_event_get_disk_eject_info (libxl_ctx *ctx,uint32_t domid,libxl_event *event,libxl_device_disk *disk);int libxl_domain_rename (libxl_ctx *ctx,uint32_t domid, -const char *old_name,const char *new_name, -xs_transaction_t trans); +const char *old_name,const char *new_name); +/* if old_name is NULL, any old name is OK; otherwise we check * transactionally that the domain has the old old name; if * trans is not 0 we use caller's transaction and caller must do retries */
tools/libxl/libxl_create.c +1 -1
@@ -354,7 +354,7 @@ retry_transaction:xs_set_permissions (ctx->xsh, t, vm_path, roperm,ARRAY_SIZE (roperm));xs_write (ctx->xsh, t,libxl__sprintf (gc,"%s/vm" , dom_path), vm_path,strlen (vm_path)); - rc =libxl_domain_rename (ctx, *domid,0 , info->name, t); + rc =libxl__domain_rename (gc, *domid,0 , info->name, t);if (rc) goto out;
tools/libxl/libxl_internal.h +4 -0
@@ -170,6 +170,10 @@ _hidden int libxl__build_pv(libxl__gc *g libxl_domain_build_info *info, libxl_domain_build_state *state); _hidden int libxl__build_hvm(libxl__gc *gc, uint32_t domid,libxl_domain_build_info *info,libxl_domain_build_state *state); + +_hidden int libxl__domain_rename(libxl__gc *gc, uint32_t domid, +const char *old_name,const char *new_name, +xs_transaction_t trans); _hidden int libxl__domain_restore_common(libxl__gc *gc, uint32_t domid,libxl_domain_build_info *info,libxl_domain_build_state *state,int fd);
tools/libxl/xl_cmdimpl.c +4 -7
@@ -2638,8 +2638,7 @@ static void migrate_domain(const char *dif (common_domname) {if (asprintf (&away_domname,"%s--migratedaway" , common_domname) <0 ) goto failed_resume; - rc =libxl_domain_rename (&ctx, domid, - common_domname, away_domname,0 ); + rc =libxl_domain_rename (&ctx, domid, common_domname, away_domname);if (rc) goto failed_resume; }
@@ -2679,8 +2678,7 @@ static void migrate_domain(const char *dfprintf (stderr,"migration sender: Trying to resume at our end.\n" );if (common_domname) { -libxl_domain_rename (&ctx, domid, - away_domname, common_domname,0 ); +libxl_domain_rename (&ctx, domid, away_domname, common_domname); } rc =libxl_domain_resume (&ctx, domid);if (!rc)fprintf (stderr,"migration sender: Resumed OK.\n" );
@@ -2779,8 +2777,7 @@ static void migrate_receive(int debug, ifprintf (stderr,"migration target: Got permission, starting domain.\n" );if (migration_domname) { - rc =libxl_domain_rename (&ctx, domid, - migration_domname, common_domname,0 ); + rc =libxl_domain_rename (&ctx, domid, migration_domname, common_domname);if (rc) goto perhaps_destroy_notify_rc; }
@@ -4059,7 +4056,7 @@ int main_rename(int argc, char **argv)find_domain (dom); new_name = argv[optind]; -if (libxl_domain_rename (&ctx, domid, common_domname, new_name,0 )) { +if (libxl_domain_rename (&ctx, domid, common_domname, new_name)) {fprintf (stderr,"Can't rename domain '%s'.\n" , dom);return 1 ; }
tools/python/xen/lowlevel/xl/xl.c +2 -2
@@ -1,6 +1,6 @@/****************************************************************************** * xl.c -* +* * Copyright (c) 2010 Citrix Ltd. * Author: Gianni Tedesco *
@@ -481,7 +481,7 @@ static PyObject *pyxl_domain_rename(XlObint domid;if ( !PyArg_ParseTuple (args,"is|s" , &domid, &new_name, &old_name) )return NULL ; -if (libxl_domain_rename (&self->ctx, domid, old_name, new_name,0 ) ) { +if (libxl_domain_rename (&self->ctx, domid, old_name, new_name) ) {PyErr_SetString (xl_error_obj,"cannot rename domain" );return NULL ; }
PATCH 1/1 libxl: do not expose libxenctrl/libxenstore headers via libxl.h
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID dd0e1d4aae8f95979df38fe6ed9fadcfdda03b9d
# Parent 8789166a014f43bf66ec4b2af51a4771fb56a5d5
libxl: do not expose libxenctrl/libxenstore headers via libxl.h
This completely removes libxenstore from libxl users' view.
xl still needs libxenctrl directly due to the direct use of the xentoollog functionality but it is not exposed to the indirect linkage anymore.
tools/Rules.mk +1 -1
@@ -49,7 +49,7 @@ SHLIB_libblktapctl = SHLIB_libblktapctl = endif -CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) +CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) LDLIBS_libxenlight = -L$(XEN_XENLIGHT) $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libblktapctl) -lxenlight SHLIB_libxenlight = -Wl,-rpath-link=$(XEN_XENLIGHT)
tools/libxl/Makefile +5 -1
@@ -13,7 +13,6 @@ XLUMINOR = 0 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations CFLAGS += -I. -fPIC -CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) ifeq ($(CONFIG_Linux),y) LIBUUID_LIBS += -luuid
@@ -38,13 +37,18 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_c libxl_internal.o libxl_utils.o $(LIBXL_OBJS-y) LIBXL_OBJS += _libxl_types.o +$(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) + AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o +$(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h CLIENTS = xl XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o +$(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h +$(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight) .PHONY: all all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
tools/libxl/libxl.c +11 -2
@@ -41,15 +41,22 @@#define STRINGIFY (x) #x#define TOSTRING (x) STRINGIFY(x) -int libxl_ctx_init (libxl_ctx *ctx,int version,xentoollog_logger *lg) +int libxl_ctx_alloc (libxl_ctx **pctx,int version,xentoollog_logger * lg) { +libxl_ctx *ctx;struct stat stat_buf;if (version !=LIBXL_VERSION )return ERROR_VERSION ; + + ctx =malloc (sizeof (*ctx)); +if (!ctx) { +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"Failed to allocate context\n" ); +return ERROR_NOMEM ; + } +memset (ctx,0 ,sizeof (libxl_ctx)); ctx->lg = lg; -memset (&ctx->version_info,0 ,sizeof (libxl_version_info));if (stat (XENSTORE_PID_FILE , &stat_buf) !=0 ) { LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Is xenstore daemon running?\n"
@@ -73,6 +80,8 @@ int libxl_ctx_init(libxl_ctx *ctx, int vxc_interface_close (ctx->xch);return ERROR_FAIL ; } + + *pctx = ctx;return 0 ; }
tools/libxl/libxl.h +9 -14
@@ -124,12 +124,17 @@#ifndef LIBXL_H #define LIBXL_H +#include <stdbool.h> #include <stdint.h> #include <stdarg.h> +#include <errno.h> #include <netinet/in.h> -#include <xenctrl.h> -#include <xs.h> #include <sys/wait.h> /* for pid_t */ + +#include <xentoollog.h> + +#include <xen/sched.h> +#include <xen/sysctl.h> #include "libxl_uuid.h"
@@ -216,17 +221,7 @@ void libxl_cpuid_destroy(libxl_cpuid_pol#include "_libxl_types.h" -typedef struct { -xentoollog_logger *lg; -xc_interface *xch; -struct xs_handle *xsh; - -/* for callers who reap children willy-nilly; caller must only -* set this after libxl_init and before any other call - or -* may leave them untouched */ -int (*waitpid_instead)(pid_t pid,int *status,int flags); -libxl_version_info version_info; -}libxl_ctx ; +typedef struct libxl__ctx libxl_ctx ;const libxl_version_info *libxl_get_version_info (libxl_ctx *ctx);
@@ -283,7 +278,7 @@ typedef struct { } libxl_domain_config;/* context functions */ -int libxl_ctx_init (libxl_ctx *ctx,int version,xentoollog_logger *); +int libxl_ctx_alloc (libxl_ctx **pctx,int version,xentoollog_logger *lg);int libxl_ctx_free (libxl_ctx *ctx);int libxl_ctx_postfork (libxl_ctx *ctx);
tools/libxl/libxl_internal.h +11 -0
@@ -82,6 +82,17 @@ _hidden void libxl__log(libxl_ctx *ctx,/* these functions preserve errno (saving and restoring) */ +struct libxl__ctx { +xentoollog_logger *lg; +xc_interface *xch; +struct xs_handle *xsh; + +/* for callers who reap children willy-nilly; caller must only +* set this after libxl_init and before any other call - or +* may leave them untouched */ +int (*waitpid_instead)(pid_t pid,int *status,int flags); +libxl_version_info version_info; +}; typedef enum { DEVICE_VIF = 1,
tools/libxl/xl.c +4 -3
@@ -26,6 +26,7 @@#include <fcntl.h> #include <ctype.h> #include <inttypes.h> +#include <xenctrl.h> #include "libxl.h" #include "libxl_utils.h"
@@ -111,7 +112,7 @@ int main(int argc, char **argv) logger =xtl_createlogger_stdiostream (stderr, minmsglevel,0 );if (!logger)exit (1 ); -if (libxl_ctx_init (&ctx,LIBXL_VERSION , (xentoollog_logger *)logger)) { +if (libxl_ctx_alloc (&ctx,LIBXL_VERSION , (xentoollog_logger *)logger)) {fprintf (stderr,"cannot init xl context\n" );exit (1 ); }
@@ -123,7 +124,7 @@ int main(int argc, char **argv)exit (1 ); } - ret =libxl_read_file_contents (&ctx, config_file, + ret =libxl_read_file_contents (ctx, config_file, &config_data, &config_len);if (ret) fprintf(stderr, "Failed to read config file: %s: %s\n",
@@ -147,7 +148,7 @@ int main(int argc, char **argv) ret =1 ; } -libxl_ctx_free (&ctx); +libxl_ctx_free (ctx);xtl_logger_destroy ((xentoollog_logger *)logger);return ret;
tools/libxl/xl.h +1 -1
@@ -95,7 +95,7 @@ extern int cmdtable_len;/* Look up a command in the table, allowing unambiguous truncation */ struct cmd_spec *cmdtable_lookup (const char *s); -extern libxl_ctx ctx; +extern libxl_ctx *ctx;extern xentoollog_logger_stdiostream *logger;/* global options */
tools/libxl/xl_cmdimpl.c +197 -197
1,338 lines not on this page · raw message
tools/ocaml/libs/xl/xl_stubs.c +24 -24
192 lines not on this page · raw message
tools/python/setup.py +1 -1
@@ -91,7 +91,7 @@ netlink = Extension("netlink", xl = Extension("xl", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, PATH_XENSTORE, "xen/lowlevel/xl" ], + include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, "xen/lowlevel/xl" ], library_dirs = [ PATH_LIBXL ], libraries = [ "xenlight" ], depends = [ PATH_LIBXL + "/libxenlight.so" ],
tools/python/xen/lowlevel/xl/xl.c +16 -16
@@ -370,7 +370,7 @@ PyObject *attrib__struct_in_addr_get(strtypedef struct {PyObject_HEAD ; -libxl_ctx ctx; +libxl_ctx *ctx;xentoollog_logger_stdiostream *logger;xentoollog_level minmsglevel; }XlObject ;
@@ -381,7 +381,7 @@ static PyObject *pyxl_list_domains(XlObjPyObject *list;int nr_dom, i; - info =libxl_list_domain (&self->ctx, &nr_dom); + info =libxl_list_domain (self->ctx, &nr_dom);if (NULL == info )return PyList_New (0 );
@@ -416,7 +416,7 @@ static PyObject *pyxl_domid_to_name(XlObif ( !PyArg_ParseTuple (args,"i" , &domid) )return NULL ; - domname =libxl_domid_to_name (&self->ctx, domid); + domname =libxl_domid_to_name (self->ctx, domid); ret =PyString_FromString (domname);free (domname);
@@ -428,7 +428,7 @@ static PyObject *pyxl_domain_shutdown(Xlint domid, req =0 ;if ( !PyArg_ParseTuple (args,"i|i" , &domid, &req) )return NULL ; -if (libxl_domain_shutdown (&self->ctx, domid, req) ) { +if (libxl_domain_shutdown (self->ctx, domid, req) ) {PyErr_SetString (xl_error_obj,"cannot shutdown domain" );return NULL ; }
@@ -441,7 +441,7 @@ static PyObject *pyxl_domain_destroy(XlOint domid, force =1 ;if ( !PyArg_ParseTuple (args,"i|i" , &domid, &force) )return NULL ; -if (libxl_domain_destroy (&self->ctx, domid, force) ) { +if (libxl_domain_destroy (self->ctx, domid, force) ) {PyErr_SetString (xl_error_obj,"cannot destroy domain" );return NULL ; }
@@ -454,7 +454,7 @@ static PyObject *pyxl_domain_pause(XlObjint domid;if ( !PyArg_ParseTuple (args,"i" , &domid) )return NULL ; -if (libxl_domain_pause (&self->ctx, domid) ) { +if (libxl_domain_pause (self->ctx, domid) ) {PyErr_SetString (xl_error_obj,"cannot pause domain" );return NULL ; }
@@ -467,7 +467,7 @@ static PyObject *pyxl_domain_unpause(XlOint domid;if ( !PyArg_ParseTuple (args,"i" , &domid) )return NULL ; -if (libxl_domain_unpause (&self->ctx, domid) ) { +if (libxl_domain_unpause (self->ctx, domid) ) {PyErr_SetString (xl_error_obj,"cannot unpause domain" );return NULL ; }
@@ -481,7 +481,7 @@ static PyObject *pyxl_domain_rename(XlObint domid;if ( !PyArg_ParseTuple (args,"is|s" , &domid, &new_name, &old_name) )return NULL ; -if (libxl_domain_rename (&self->ctx, domid, old_name, new_name) ) { +if (libxl_domain_rename (self->ctx, domid, old_name, new_name) ) {PyErr_SetString (xl_error_obj,"cannot rename domain" );return NULL ; }
@@ -501,7 +501,7 @@ static PyObject *pyxl_pci_add(XlObject *return NULL ; } pci = (Py_device_pci *)obj; -if (libxl_device_pci_add (&self->ctx, domid, &pci->obj) ) { +if (libxl_device_pci_add (self->ctx, domid, &pci->obj) ) {PyErr_SetString (xl_error_obj,"cannot add pci device" );return NULL ; }
@@ -522,7 +522,7 @@ static PyObject *pyxl_pci_del(XlObject *return NULL ; } pci = (Py_device_pci *)obj; -if (libxl_device_pci_remove (&self->ctx, domid, &pci->obj, force) ) { +if (libxl_device_pci_remove (self->ctx, domid, &pci->obj, force) ) {PyErr_SetString (xl_error_obj,"cannot remove pci device" );return NULL ; }
@@ -544,7 +544,7 @@ static PyObject *pyxl_pci_parse(XlObjectreturn NULL ; } -if (libxl_device_pci_parse_bdf (&self->ctx, &pci->obj, str) ) { +if (libxl_device_pci_parse_bdf (self->ctx, &pci->obj, str) ) {PyErr_SetString (xl_error_obj,"cannot parse pci device spec (BDF)" );Py_DECREF (pci);return NULL ;
@@ -559,7 +559,7 @@ static PyObject *pyxl_pci_list_assignablPyObject *list;int nr_dev, i; -if (libxl_device_pci_list_assignable (&self->ctx, &dev, &nr_dev) ) { +if (libxl_device_pci_list_assignable (self->ctx, &dev, &nr_dev) ) {PyErr_SetString (xl_error_obj,"Cannot list assignable devices" );return NULL ; }
@@ -595,7 +595,7 @@ static PyObject *pyxl_pci_list(XlObjectif ( !PyArg_ParseTuple (args,"i" , &domid) )return NULL ; -if (libxl_device_pci_list_assigned (&self->ctx, &dev, domid, &nr_dev) ) { +if (libxl_device_pci_list_assigned (self->ctx, &dev, domid, &nr_dev) ) {PyErr_SetString (xl_error_obj,"Cannot list assignable devices" );return NULL ; }
@@ -663,7 +663,7 @@ static PyObject *PyXl_new(PyTypeObject *if (self ==NULL )return NULL ; -memset (&self->ctx,0 ,sizeof (self->ctx)); + self->ctx =NULL ; self->logger =NULL ; self->minmsglevel =XTL_PROGRESS ;
@@ -679,7 +679,7 @@ PyXl_init(XlObject *self, PyObject *argsreturn -1 ; } -if (libxl_ctx_init (&self->ctx,LIBXL_VERSION , +if (libxl_ctx_alloc (&self->ctx,LIBXL_VERSION , (xentoollog_logger *)self->logger) ) {PyErr_SetString (xl_error_obj,"cannot init xl context" );return -1 ;
@@ -690,7 +690,7 @@ PyXl_init(XlObject *self, PyObject *argsstatic void PyXl_dealloc (XlObject *self) { -libxl_ctx_free (&self->ctx); +libxl_ctx_free (self->ctx);if ( self->logger )xtl_logger_destroy ((xentoollog_logger *)self->logger);
PATCH 1/1 tools: drop further uses of -Wp, -MD, .$(@F).d to generate dependencies
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300718506 0
# Node ID 7a4eb10b336b127e480750969ef03eea04f4b161
# Parent dd0e1d4aae8f95979df38fe6ed9fadcfdda03b9d
tools: drop further uses of -Wp,-MD,.$(@F).d to generate dependencies.
19025:bd78714b8594 switched to "-MMD -MF" in preference, adding the correct runes to tools/Rules.mk but appears to have missed some other uses of -Wp,...
tools/blktap/lib/Makefile +0 -4
@@ -18,10 +18,6 @@ CFLAGS += -fPIC CFLAGS += -fPIC # get asprintf(): CFLAGS += -D _GNU_SOURCE - -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d OBJS = $(SRCS:.c=.o) OBJS_PIC = $(SRCS:.c=.opic)
tools/blktap2/control/Makefile +0 -4
@@ -15,10 +15,6 @@ CFLAGS += $(CFLAGS_libxenctrl CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += -D_GNU_SOURCE CFLAGS += -DTAPCTL - -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d CTL_OBJS := tap-ctl-ipc.o CTL_OBJS += tap-ctl-list.o
tools/blktap2/lvm/Makefile +0 -4
@@ -14,10 +14,6 @@ ifeq ($(CONFIG_X86_64),y) ifeq ($(CONFIG_X86_64),y) CFLAGS += -fPIC endif - -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d LVM-OBJS := lvm-util.o
tools/blktap2/vhd/Makefile +0 -4
@@ -23,10 +23,6 @@ endif LIBS := -Llib -lvhd -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d - all: subdirs-all build build: $(IBIN)
tools/blktap2/vhd/lib/Makefile +0 -4
@@ -22,10 +22,6 @@ ifeq ($(CONFIG_Linux),y) ifeq ($(CONFIG_Linux),y) LIBS := -luuid endif - -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d LIB-SRCS := libvhd.c LIB-SRCS += libvhd-journal.c
tools/flask/libflask/Makefile +0 -3
@@ -10,9 +10,6 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += -fno-strict-aliasing CFLAGS += -I./include $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) - -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d LIB_OBJS := $(patsubst %.c,%.o,$(SRCS)) PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
tools/memshr/Makefile +0 -4
@@ -10,10 +10,6 @@ CFLAGS += -D_GNU_SOURCE CFLAGS += -D_GNU_SOURCE CFLAGS += -fPIC CFLAGS += -g - -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d LIB-SRCS := interface.c LIB-SRCS += shm.c
tools/xenpaging/Makefile +0 -3
@@ -12,9 +12,6 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += -Wno-unused CFLAGS += -g - -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d OBJS = $(SRCS:.c=.o) IBINS = xenpaging
PATCH 1/1 tools: remove pattern matched linking rules
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1300718506 0
# Node ID 26ba6a80310af7c3b360d4b78da8f3ff7188a9e8 # Parent 7a4eb10b336b127e480750969ef03eea04f4b161
tools: remove pattern matched linking rules
Most subdirs only build a single tool to start with and those which build multiple tools often have different linkage requirements.
tools/debugger/xenitp/Makefile +3 -24
@@ -5,14 +5,7 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += $(CFLAGS_libxenctrl) -HDRS = $(wildcard *.h) -OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) - -BIN = LIBBIN = -SCRIPTS = -MAN1 = $(wildcard *.1) -MAN8 = $(wildcard *.8) ifeq ($(XEN_TARGET_ARCH),ia64) LIBBIN += xenitp
@@ -22,32 +15,18 @@ all: build all: build .PHONY: build -build: $(BIN) $(LIBBIN) +build: $(LIBBIN) .PHONY: install install: build - $(INSTALL_DIR) $(DESTDIR)$(BINDIR) [ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) - $(INSTALL_DIR) $(DESTDIR)$(MAN1DIR) - $(INSTALL_DIR) $(DESTDIR)$(MAN8DIR) - if [ "x$(SCRIPTS)" != "x" ]; then \ - $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR); \ - fi [ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(PRIVATE_BINDIR) - if [ "x$(MAN1)" != "x" ]; then \ - $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1DIR); \ - fi - if [ "x$(MAN1)" != "x" ]; then \ - $(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MAN8DIR); \ - fi .PHONY: clean clean: - $(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) - -%: %.c $(HDRS) Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDLIBS_libxenctrl) + $(RM) *.a *.so *.o *.rpm $(LIBBIN) XENITP_OBJS=xenitp.o ia64-dis.o ia64-opc.o cpu-ia64-opc.o + xenitp: $(XENITP_OBJS) $(CC) $(CFLAGS) -o $@ $(XENITP_OBJS) $(LDLIBS_libxenctrl)
tools/flask/utils/Makefile +7 -4
@@ -18,7 +18,13 @@ CLIENTS_OBJS := $(patsubst flask-%,%.o,$ .PHONY: all all: $(CLIENTS) -$(CLIENTS): flask-%: %.o +flask-loadpolicy: loadpolicy.o + $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + +flask-setenforce: setenforce.o + $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + +flask-getenforce: getenforce.o $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ .PHONY: clean
@@ -41,6 +47,3 @@ install: all $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(SBINDIR) -include $(DEPS) - -# never delete any intermediate files. -.SECONDARY:
tools/misc/Makefile +23 -13
@@ -12,14 +12,6 @@ TARGETS-$(CONFIG_X86) += xen-detect xen- TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash TARGETS-$(CONFIG_MIGRATE) += xen-hptool TARGETS := $(TARGETS-y) - -LDLIBS_xenperf := $(LDLIBS_libxenctrl) -LDLIBS_xenpm := $(LDLIBS_libxenctrl) -LDLIBS_xenlockprof := $(LDLIBS_libxenctrl) -LDLIBS_xenwatchdogd := $(LDLIBS_libxenctrl) -LDLIBS_xen-hvmctx := $(LDLIBS_libxenctrl) -LDLIBS_xen-hvmcrash := $(LDLIBS_libxenctrl) -LDLIBS_xen-hptool := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) SUBDIRS-$(CONFIG_LOMOUNT) += lomount SUBDIRS-$(CONFIG_MINITERM) += miniterm
@@ -54,13 +46,31 @@ clean: $(RM) *.o $(TARGETS) *~ $(DEPS) set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done -%.o: %.c $(HDRS) Makefile - $(CC) -c $(CFLAGS) -o $@ $< +xen-hvmctx: xen-hvmctx.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) -xen-hvmctx xen-hvmcrash xenperf xenpm gtracestat xenlockprof xen-hptool xenwatchdogd: %: %.o Makefile - $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_$*) +xen-hvmcrash: xen-hvmcrash.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) -gtraceview: %: %.o Makefile +xenperf: xenperf.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) + +xenpm: xenpm.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) + +gtracestat: gtracestat.o + $(CC) $(LDFLAGS) -o $@ $< + +xenlockprof: xenlockprof.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) + +xen-hptool: xen-hptool.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) + +xenwatchdogd: xenwatchdogd.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) + +gtraceview: gtraceview.o $(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) -include $(DEPS)
tools/misc/lomount/Makefile +3 -7
@@ -3,16 +3,11 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -HDRS = $(wildcard *.h) -OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) - -BIN = lomount - .PHONY: all all: build .PHONY: build -build: $(BIN) +build: lomount .PHONY: install install install-recurse: build
@@ -22,6 +17,7 @@ clean: clean: $(RM) *.a *.so *.o *.rpm $(BIN) -%: %.c $(HDRS) Makefile +lomount: lomount.o $(CC) $(CFLAGS) -o $@ $< +-include $(DEPS)
tools/tests/mce-test/tools/Makefile +4 -5
@@ -2,21 +2,20 @@ include $(XEN_ROOT)/tools/Rules.mk include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror - CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(CFLAGS_libxenguest) +CFLAGS += $(CFLAGS_libxenstore) CFLAGS += $(CFLAGS_xeninclude) - -HDRS = $(wildcard *.h) .PHONY: all all: xen-mceinj install: - cp xen-mceinj /usr/sbin/ + $(INSTALL_PROG) xen-mceinj $(DESTDIR)$(SBINDIR) .PHONY: clean clean: $(RM) *.o xen-mceinj -xen-mceinj: %: %.o Makefile +xen-mceinj: xen-mceinj.o Makefile $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
tools/tests/xen-access/Makefile +3 -7
@@ -4,28 +4,24 @@ CFLAGS += -Werror CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(CFLAGS_libxenguest) CFLAGS += $(CFLAGS_xeninclude) TARGETS-y := TARGETS-$(CONFIG_X86) += xen-access TARGETS := $(TARGETS-y) -SUBDIRS-y := -SUBDIRS := $(SUBDIRS-y) - .PHONY: all all: build .PHONY: build build: $(TARGETS) - set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done .PHONY: clean clean: $(RM) *.o $(TARGETS) *~ $(DEPS) - set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done -xen-access: %: %.o Makefile - $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) +xen-access: xen-access.o Makefile + $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) -include $(DEPS)
tools/xcutils/Makefile +11 -7
@@ -20,19 +20,23 @@ CFLAGS_readnotes.o := $(CFLAGS_libxenct CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) CFLAGS_lsevtchn.o := $(CFLAGS_libxenctrl) -LDLIBS_xc_restore := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) -LDLIBS_xc_save := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -LDLIBS_readnotes := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) -LDLIBS_lsevtchn := $(LDLIBS_libxenctrl) - .PHONY: all all: build .PHONY: build build: $(PROGRAMS) -$(PROGRAMS): %: %.o - $(CC) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_$*) -o $@ +xc_restore: xc_restore.o + $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) + +xc_save: xc_save.o + $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) + +readnotes: readnotes.o + $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) + +lsevtchn: lsevtchn.o + $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) .PHONY: install install: build
tools/xenbackendd/Makefile +3 -6
@@ -17,13 +17,11 @@ CPPFLAGS += -DXEN_SCRIPT_DIR="\"$(XEN_SC CPPFLAGS += -DXEN_SCRIPT_DIR="\"$(XEN_SCRIPT_DIR)\"" LDLIBS += $(LDLIBS_libxenstore) -SBIN = xenbackendd - .PHONY: all all: build .PHONY: build -build: $(SBIN) +build: xenbackendd .PHONY: install install: build
@@ -32,10 +30,9 @@ install: build .PHONY: clean clean: - rm -f $(SBIN) $(DEPS) + rm -f $(DEPS) - -%: %.o Makefile +xenbackendd: xenbackendd.o $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -include $(DEPS)
tools/xenmon/Makefile +4 -6
@@ -17,14 +17,13 @@ CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_libxenctrl) LDLIBS += $(LDLIBS_libxenctrl) -BIN = xentrace_setmask xenbaked SCRIPTS = xenmon.py .PHONY: all all: build .PHONY: build -build: $(BIN) +build: xentrace_setmask xenbaked .PHONY: install install: build
@@ -37,13 +36,12 @@ install: build .PHONY: clean clean: - rm -f $(BIN) $(DEPS) + rm -f $(DEPS) - -%: %.o Makefile +xenbaked: xenbaked.o Makefile $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -xentrace_%: %.o Makefile +xentrace_setmask: setmask.o Makefile $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -include $(DEPS)
tools/xenpmd/Makefile +4 -6
@@ -6,21 +6,19 @@ CFLAGS += $(CFLAGS_libxenstore) LDLIBS += $(LDLIBS_libxenstore) -BIN = xenpmd - .PHONY: all -all: $(BIN) +all: xenpmd .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) - $(INSTALL_PROG) $(BIN) $(DESTDIR)$(SBINDIR) + $(INSTALL_PROG) xenpmd $(DESTDIR)$(SBINDIR) .PHONY: clean clean: - $(RM) -f $(BIN) $(DEPS) + $(RM) -f xenpmd $(DEPS) -%: %.o Makefile +xenpmd: xenpmd.o Makefile $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) -include $(DEPS)
tools/xentrace/Makefile +7 -18
@@ -6,26 +6,11 @@ CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_libxenctrl) LDLIBS += $(LDLIBS_libxenctrl) -HDRS = $(wildcard *.h) -OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) - BIN = xentrace xentrace_setsize -LIBBIN = +LIBBIN = xenctx SCRIPTS = xentrace_format MAN1 = $(wildcard *.1) MAN8 = $(wildcard *.8) - -ifeq ($(XEN_TARGET_ARCH),x86_32) -LIBBIN += xenctx -endif - -ifeq ($(XEN_TARGET_ARCH),x86_64) -LIBBIN += xenctx -endif - -ifeq ($(XEN_TARGET_ARCH),ia64) -LIBBIN += xenctx -endif .PHONY: all all: build
@@ -49,9 +34,13 @@ clean: clean: $(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) $(DEPS) -%: %.o $(HDRS) Makefile +xentrace: xentrace.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -xentrace_%: %.o $(HDRS) Makefile + +xenctx: xenctx.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) + +xentrace_setsize: setsize.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -include $(DEPS)
Ian Campbell writes ("[Xen-devel] [PATCH 00 of 30] tools: shave build yaks"):
Quoted 6 lines
Clean up a bunch of inconsistency, wierdness, cut-and-paste etc in the
tools/build system. All in all it's a bit of a grab bag of stuff I happened to notice as I was trawlingOne specific useful thing which comes out of it is to isolate users of libxl from needing to know about libxenstore or libxenctrl.
Thanks, I've acked and applied a number of these up to around 14 ...
Ian.
Quoted 6 lines · Ian Campbell
Clean up a bunch of inconsistency, wierdness, cut-and-paste etc in the
tools/build system. All in all it's a bit of a grab bag of stuff I happened to notice as I was trawlingOne specific useful thing which comes out of it is to isolate users of libxl from needing to know about libxenstore or libxenctrl.
Ian,
from a quick look its not clear which patch between changeset 23062 and 23082 causes a link failure in libxenstat.
Appending -fPIC to the CFLAGS in tools/xenstat/libxenstat/Makefile fixed this failure for me:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:src/xenstat.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
Olaf
Quoted 11 lines · Olaf Hering
Quoted 6 lines · Ian Campbell
Clean up a bunch of inconsistency, wierdness, cut-and-paste etc in the
tools/build system. All in all it's a bit of a grab bag of stuff I happened to notice as I was trawlingOne specific useful thing which comes out of it is to isolate users of libxl from needing to know about libxenstore or libxenctrl.
Ian,
Quoted 8 lines
from a quick look its not clear which patch between changeset 23062 and 23082 causes a link failure in libxenstat.
Appending -fPIC to the CFLAGS intools/xenstat/libxenstat/Makefilefixed this failure for me:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld:src/xenstat.o: relocationR_X86_64_32Sagainst `.rodata' can not be used when making a shared object; recompile with -fPIC
Sorry, I should have compile tested 64 bit and I forgot.
In theory we should compile to .opic as well as .o files and use them for the .so and the .a respectively. However I'm not sure we care much about the PIC overhead in the .a version of a library such as this so I think simply adding the -fPIC is ok.
8<-----------------------------------------------
# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300899163 0
# Node ID 7b4578c97a8f51f566595a269018f786cfeeb22b
# Parent d7d3aabffa1b70955ba347cfbe3869b9461374ee tools/xenstat: 23075:b4351d57464b added libxenstat.so but didn't build fPIC
This broke on x86_64.
Reported by Olaf Hering
tools/xenstat/libxenstat/Makefile +1 -0
@@ -36,6 +36,7 @@ SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,li WARN_FLAGS=-Wall -Werror +CFLAGS+=-fPIC CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl)