From 211fae046e166fafa20affcab60af667222900ac Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 17 Apr 2014 16:02:01 +0100 Subject: [PATCH 1/5] CA-129648: Handle deprecation warnings causing XenRT test failures. Suppressed warning in test checking explicitly for the use of deprecated method HostPatch.apply. Removed use of deprecated methods SR.make and SR.makeAsync. Signed-off-by: Konstantina Chremmou --- java/samples/DeprecatedMethod.java | 1 + java/samples/VdiAndSrOps.java | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/java/samples/DeprecatedMethod.java b/java/samples/DeprecatedMethod.java index 49806bc..c3e5ebd 100644 --- a/java/samples/DeprecatedMethod.java +++ b/java/samples/DeprecatedMethod.java @@ -39,6 +39,7 @@ */ public class DeprecatedMethod extends TestBase { + @SuppressWarnings("deprecation") public static void RunTest(ILog logger, TargetServer server) throws Exception { TestBase.logger = logger; diff --git a/java/samples/VdiAndSrOps.java b/java/samples/VdiAndSrOps.java index 1677402..ab5920c 100644 --- a/java/samples/VdiAndSrOps.java +++ b/java/samples/VdiAndSrOps.java @@ -60,7 +60,6 @@ public static void RunTest(ILog logger, TargetServer server) throws Exception testSrOp("SR.forget", false, nullSmConfig, version); testSrOp("SR.createAsync", false, nullSmConfig, version); testSrOp("SR.forget", false, nullSmConfig, version); - testSrOp("SR.makeAsync", false, nullSmConfig, version); testSrOp("SR.forget", false, nullSmConfig, version); testSrOp("SR.introduce", false, nullSmConfig, version); testSrOp("SR.forget", false, nullSmConfig, version); @@ -201,14 +200,6 @@ private static void srOpLong(Connection c, HashMap smConfig, Str { SR.createAsync(c, our_host, new HashMap(), TEST_SR_SIZE, TEST_SR_NAME, TEST_SR_DESC, TEST_SR_TYPE, TEST_SR_CONTENT, true, smConfig); - } else if (op.equals("SR.make")) - { - SR.make(c, our_host, new HashMap(), TEST_SR_SIZE, TEST_SR_NAME, TEST_SR_DESC, - TEST_SR_TYPE, TEST_SR_CONTENT, smConfig); - } else if (op.equals("SR.makeAsync")) - { - SR.makeAsync(c, our_host, new HashMap(), TEST_SR_SIZE, TEST_SR_NAME, TEST_SR_DESC, - TEST_SR_TYPE, TEST_SR_CONTENT, smConfig); } else if (op.equals("SR.forget")) { Set srs = SR.getByNameLabel(c, TEST_SR_NAME); From aa46a834541bcccca3193d6c15459b237a3987bc Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Tue, 22 Apr 2014 14:20:05 +0100 Subject: [PATCH 2/5] CA-124005: Updated java README. Do a test compilation of the samples when building. Signed-off-by: Konstantina Chremmou --- java/OMakefile | 33 +++++++++++------------ java/README.dist | 59 ++++++++++++++++++++++++++---------------- java/lib/Makefile.dist | 3 +-- 3 files changed, 52 insertions(+), 43 deletions(-) mode change 100644 => 100755 java/lib/Makefile.dist diff --git a/java/OMakefile b/java/OMakefile index 2434e25..6de8d6f 100644 --- a/java/OMakefile +++ b/java/OMakefile @@ -30,10 +30,10 @@ JAVAGEN_DIR = $(BINDINGS_TMP)/javagen JAVATMP_DIR = $(BINDINGS_TMP)/XenServerJava-tmp -JAVABIN_DIR = $(BINDINGS_TMP)/XenServerJava-bin/XenServerJava -JAVASRC_DIR = $(BINDINGS_TMP)/XenServerJava-src/XenServerJava -JAVASAM_DIR = $(BINDINGS_TMP)/XenServerJava-samples/XenServerJava -JAVADOC_DIR = $(BINDINGS_TMP)/XenServerJavadoc/javadoc +JAVABIN_DIR = $(BINDINGS_TMP)/XenServerJava-bin +JAVASRC_DIR = $(BINDINGS_TMP)/XenServerJava-src +JAVASAM_DIR = $(BINDINGS_TMP)/XenServerJava-samples +JAVADOC_DIR = $(BINDINGS_TMP)/XenServerJava-javadoc SDK_JAVA_FOLDER=$(SDK_FOLDER)/XenServerJava @@ -59,31 +59,26 @@ Brand(src, dst) = sed -e 's/@SDK_VERSION@/$(SDK_VERSION)/g' $(src) >$(JAVATMP_DIR)/t-$(basename $(dst)) $(INSTALL) $(JAVATMP_DIR)/t-$(basename $(dst)) $(dst) +#N.B. the following also does a test build of the tests .PHONY: java_bindings_all java_bindings_all: main if $(equal $(COMPILE_JAVA), yes) - Empty($(JAVAGEN_DIR) $(JAVASRC_DIR) $(JAVABIN_DIR) $(JAVADOC_DIR)) + Empty($(JAVAGEN_DIR) $(JAVASRC_DIR) $(JAVABIN_DIR) $(JAVADOC_DIR) $(JAVASAM_DIR)) Brand(lib/Makefile.dist, $(JAVAGEN_DIR)/Makefile) mkdir -p $(JAVAGEN_DIR)/com/xensource/xenapi $(INSTALL) lib/com/xensource/xenapi/*.java $(JAVAGEN_DIR)/com/xensource/xenapi Brand(lib/com/xensource/xenapi/Connection.java, $(JAVAGEN_DIR)/com/xensource/xenapi/Connection.java) + ./main $(JAVAGEN_DIR) + cp -r $(JAVAGEN_DIR)/* $(JAVASRC_DIR) + $(INSTALL) samples/*.java $(JAVASAM_DIR) + $(INSTALL) samples/*.java $(JAVAGEN_DIR) $(INSTALL) $(XMLRPC_DIST)/{xmlrpc-common-3.1,xmlrpc-client-3.1,ws-commons-util-1.0.2}.jar $(JAVAGEN_DIR) - ./main $(JAVAGEN_DIR) - make -C $(JAVAGEN_DIR) all docs cleanclass + make -C $(JAVAGEN_DIR) all docs mv $(JAVAGEN_DIR)/*.jar $(JAVABIN_DIR) - Brand(README.dist, $(JAVATMP_DIR)/README.txt) - $(INSTALL) $(JAVATMP_DIR)/README.txt $(JAVABIN_DIR) - LicenceJava($(JAVABIN_DIR)) mv $(JAVAGEN_DIR)/doc/* $(JAVADOC_DIR) rmdir $(JAVAGEN_DIR)/doc - mv $(JAVAGEN_DIR)/* $(JAVASRC_DIR) - $(INSTALL) $(JAVATMP_DIR)/README.txt $(JAVASRC_DIR) - LicenceJava($(JAVASRC_DIR)) - Empty($(JAVASAM_DIR)) - $(INSTALL) samples/*.java $(JAVASAM_DIR) - $(INSTALL) $(JAVATMP_DIR)/README.txt $(JAVASAM_DIR) - LicenceJava($(JAVASAM_DIR)) + Brand(README.dist, $(JAVATMP_DIR)/README.txt) else Empty($(JAVASRC_DIR) $(JAVABIN_DIR) $(JAVADOC_DIR)) @@ -91,8 +86,10 @@ java_bindings_all: main java_folders: java_bindings_all mkdir -p $(SDK_JAVA_FOLDER)/bin && cp -r $(JAVABIN_DIR)/* $(SDK_JAVA_FOLDER)/bin mkdir -p $(SDK_JAVA_FOLDER)/src && cp -r $(JAVASRC_DIR)/* $(SDK_JAVA_FOLDER)/src - mkdir -p $(SDK_JAVA_FOLDER)/samples && cp -r $(JAVASAM_DIR)/{*.java,README.txt} $(SDK_JAVA_FOLDER)/samples + mkdir -p $(SDK_JAVA_FOLDER)/samples && cp -r $(JAVASAM_DIR)/*.java $(SDK_JAVA_FOLDER)/samples mkdir -p $(SDK_JAVA_FOLDER)/javadoc && cp -r $(JAVADOC_DIR)/* $(SDK_JAVA_FOLDER)/javadoc + $(INSTALL) $(JAVATMP_DIR)/README.txt $(SDK_JAVA_FOLDER) + LicenceJava($(SDK_JAVA_FOLDER)) .PHONY: clean clean: diff --git a/java/README.dist b/java/README.dist index ef985a2..03f1ae7 100644 --- a/java/README.dist +++ b/java/README.dist @@ -6,7 +6,10 @@ Version @SDK_VERSION@ XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer API as Java classes. -For XenServer documentation, see http://docs.xensource.com. +It is available in the XenServer-SDK-@SDK_VERSION@.zip, which can be downloaded +from http://www.citrix.com/downloads/xenserver/. + +For XenServer documentation see http://docs.xensource.com. XenServerJava includes a class for every XenServer class, and a method for each XenServer API call, so API documentation and examples written for for other languages will apply equally well to Java. @@ -14,39 +17,49 @@ In particular, the SDK Guide and API Documentation are ideal for developers wishing to use XenServerJava. For community content, blogs, and downloads, visit the XenServer Developer -Network at http://community.citrix.com/cdn/xs. - -XenServerJava is free sofware. You can redistribute and modify it under the -terms of the BSD license. See LICENSE.txt for details. +Network at https://www.citrix.com/community.html. -This library may be accompanied by pedagogical examples. These do not form -part of this library, and are licensed for redistribution and modification -under the BSD license. Such examples are licensed clearly at the top -of each file. +XenServerJava is free sofware. You can redistribute and modify it under the +terms of the BSD license. See LICENSE.txt for details. Dependencies ------------ XenServerJava is dependent upon Apache XML-RPC and WS-Commons, both by The -Apache Software Foundation. We would like to thank the ASF and the -Apache XML-RPC development team in particular. -Both are licensed under the Apache Software License 2.0; see -LICENSE.Apache-2.0.txt for details. +Apache Software Foundation. We would like to thank the ASF and the +Apache XML-RPC development team in particular. Both are licensed under the +Apache Software License 2.0. See LICENSE.Apache-2.0.txt for details. -We test with version 3.1 of Apache XML-RPC, and version 1.0.2 of WS-Commons. +We test with version 3.1 of Apache XML-RPC and version 1.0.2 of WS-Commons. We recommend that you use these versions, though others may work. +Apache XML-RPC is available from http://ws.apache.org/xmlrpc/. +WS-Commons is available from http://ws.apache.org/commons/. -Downloads ---------- -XenServerJava is available in the XenServer-SDK-@SDK_VERSION@.zip in three separate -folders, one for the compiled binaries, one for the source code, -and one containing sample code. +Folder structure +---------------- + +XenServerJava consists of three separate folders: +- XenServerJava/bin: contains the compiled binaries +- XenServerJava/javadoc: contains the documentation +- XenServerJava/src: contains the source code and tests; the tests can also +be used as pedagogical examples. + + +Compiling from source +--------------------- + +Extract XenServerJava from XenServer-SDK-@SDK_VERSION@.zip. +Copy the dependency jars from XenServerJava/bin to XenServerJava/src. + +From XenServerJava/src do: +- "make all" to build the XenServer binary +- "make docs" to build the documentation. + +To build and run the tests, copy them from XenServerJava/samples to +XenServerJava/src, then from XenServerJava/src "make all" and +$ java RunTests [nfs server] [nfs path] -The XenServer-SDK-@SDK_VERSION@.zip is available from -http://www.citrix.com/downloads/xenserver/. -Apache XML-RPC is available from http://ws.apache.org/xmlrpc/. -WS-Commons is available from http://ws.apache.org/commons/. diff --git a/java/lib/Makefile.dist b/java/lib/Makefile.dist old mode 100644 new mode 100755 index 4b44cb9..da12957 --- a/java/lib/Makefile.dist +++ b/java/lib/Makefile.dist @@ -28,14 +28,13 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. # -# Makefile to compile the Xen Java SDK bindings +# Makefile to compile the Xen Java SDK bindings and tests BINDINGJAVAFILES := $(wildcard com/xensource/xenapi/*.java) BINDINGCLASSFILES := $(BINDINGJAVAFILES:.java=.class) BINDINGJAR := xenserver-@SDK_VERSION@.jar CLASSPATH := :xmlrpc-client-3.1.jar:xmlrpc-common-3.1.jar:ws-commons-util-1.0.2.jar -EXAMPLECLASSPATH := :$(BINDINGJAR)$(CLASSPATH) .PHONY: all all: $(BINDINGJAR) tests From dd36900dec6b1bfa8e21fff8783ececa93d0cc38 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Wed, 23 Apr 2014 12:01:42 +0100 Subject: [PATCH 3/5] Ship the API reference inside the SDK zip file (html and pdf format). Signed-off-by: Konstantina Chremmou --- mk/Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mk/Makefile b/mk/Makefile index ab06bd2..94437e4 100644 --- a/mk/Makefile +++ b/mk/Makefile @@ -78,6 +78,10 @@ API_PYTHON=$(API_SRC)/xen-api-src/scripts/examples/python PYTHON_FILES=XenAPI.py provision.py PYTHON_SAMPLES=install.py powercycle.py permute.py vm_start_async.py watch-all-events.py fixpbds.py shell.py license.py +API_REF=$(MY_OBJ_DIR)/api-ref +API_REF_HTML=$(API_REF)/usr/share/doc/xapi/docs/html/xenserver +API_REF_PDF=$(API_REF)/usr/share/doc/xapi/docs/pdf + SDK_ZIP=XenServer-SDK-$(SDK_VERSION).zip SDK_ZIP_LN=XenServer-SDK.zip SDK_FOLDER=$(MY_OUTPUT_DIR)/XenServer-SDK @@ -85,6 +89,7 @@ SDK_NET_FOLDER=$(SDK_FOLDER)/XenServer.NET SDK_PS_FOLDER=$(SDK_FOLDER)/XenServerPowerShell SDK_PY_FOLDER=$(SDK_FOLDER)/XenServerPython SDK_PY_FOLDER_SAMPLES=$(SDK_PY_FOLDER)/samples +API_REF_FOLDER=$(SDK_FOLDER)/API-reference export SDK_VERSION export PROJECT_OUTPUTDIR @@ -169,11 +174,17 @@ bins: omake-phase powershell-module powershell_samples csharp-bin .PHONY: python-module python-module: - mkdir -p $(API_SRC) && tar -xf $(PROJECT_OUTPUTDIR)/api/SOURCES/xen-api-src.tar.bz2 -C $(API_SRC) xen-api-src/scripts/examples/python + mkdir -p $(API_SRC) && tar -xf $(PROJECT_OUTPUTDIR)/api/SOURCES/xen-api-src.tar.bz2 -C $(API_SRC) xen-api-src/scripts/examples/python mkdir -p $(SDK_PY_FOLDER) && cp $(addprefix $(API_PYTHON)/, $(PYTHON_FILES)) $(SDK_PY_FOLDER) mkdir -p $(SDK_PY_FOLDER_SAMPLES) && cp $(addprefix $(API_PYTHON)/, $(PYTHON_SAMPLES) README) $(SDK_PY_FOLDER_SAMPLES) -$(MY_OUTPUT_DIR)/$(SDK_ZIP): bins python-module +.PHONY: api-ref +api-ref: + mkdir -p $(API_REF) && tar -xf $(PROJECT_OUTPUTDIR)/api/sdk.tar.gz -C $(API_REF) + mkdir -p $(API_REF_FOLDER)/html && cp -r $(API_REF_HTML)/* $(API_REF_FOLDER)/html + mkdir -p $(API_REF_FOLDER)/pdf && cp $(API_REF_PDF)/xenenterpriseapi.pdf $(API_REF_FOLDER)/pdf/XenServerAPI.pdf + +$(MY_OUTPUT_DIR)/$(SDK_ZIP): bins python-module api-ref cd $(MY_OUTPUT_DIR) && zip -q -r9 $(SDK_ZIP) XenServer-SDK ln -sf $(SDK_ZIP) $(MY_OUTPUT_DIR)/$(SDK_ZIP_LN) rm -Rf $(SDK_FOLDER) From e1b1dbf742d1773b94d34b039e83ad0574658fee Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 24 Apr 2014 10:33:53 +0100 Subject: [PATCH 4/5] CA-109972: Corrections to the libxenserver Makefile. Fixed broken "make install". Updated README. Signed-off-by: Konstantina Chremmou --- c/Makefile.dist | 46 +++++++++++++++++++++++----------------------- c/OMakefile | 10 +++++----- c/README.dist | 31 +++++++++++++------------------ 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/c/Makefile.dist b/c/Makefile.dist index 4b48a0f..c9d1ac8 100644 --- a/c/Makefile.dist +++ b/c/Makefile.dist @@ -28,8 +28,7 @@ # OF THE POSSIBILITY OF SUCH DAMAGE # -MAJOR = @LIB_MAJOR@ -MINOR = @LIB_MINOR@ +DESTDIR=/usr/local CFLAGS = -g -Iinclude \ $(shell xml2-config --cflags) \ @@ -42,34 +41,32 @@ LDFLAGS = -g $(shell xml2-config --libs) \ # -h for Solaris SONAME_LDFLAG ?= -soname -# -R /usr/sfw/$(LIBDIR) -shared for Solaris +# -R /usr/sfw/lib -shared for Solaris SHLIB_CFLAGS ?= -shared # ginstall for Solaris -INSTALL = install -INSTALL_DIR = $(INSTALL) -d -m0755 -p -INSTALL_DATA = $(INSTALL) -m0644 -p +INSTALL_DIR = install -d -m0755 -p +INSTALL_DATA = install -m0644 -p -LIBXENAPI_HDRS = $(wildcard include/*.h) +LIBXENAPI_HDRS_INT = $(wildcard include/*.h) +LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h) LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c)) -TEST_PROGRAMS = test/test_vm_ops test/test_event_handling \ - test/test_failures test/test_vm_async_migrate \ - test/test_enumerate test/test_get_records +TEST_PROGRAMS = $(patsubst %.c, %, $(wildcard test/*.c)) -TARBALL_DEST = lib@LIB_NAME@-$(MAJOR).$(MINOR) +TARBALL_DEST = lib@LIB_NAME@-@LIB_MAJOR@.@LIB_MINOR@ .PHONY: all all: $(TEST_PROGRAMS) -lib@LIB_NAME@.so: lib@LIB_NAME@.so.$(MAJOR) +lib@LIB_NAME@.so: lib@LIB_NAME@.so.@LIB_MAJOR@ ln -sf $< $@ -lib@LIB_NAME@.so.$(MAJOR): lib@LIB_NAME@.so.$(MAJOR).$(MINOR) +lib@LIB_NAME@.so.@LIB_MAJOR@: lib@LIB_NAME@.so.@LIB_MAJOR@.@LIB_MINOR@ ln -sf $< $@ -lib@LIB_NAME@.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib@LIB_NAME@.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ +lib@LIB_NAME@.so.@LIB_MAJOR@.@LIB_MINOR@: $(LIBXENAPI_OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib@LIB_NAME@.so.@LIB_MAJOR@ $(SHLIB_CFLAGS) -o $@ $^ lib@LIB_NAME@.a: $(LIBXENAPI_OBJS) $(AR) rcs lib@LIB_NAME@.a $^ @@ -79,15 +76,18 @@ $(TEST_PROGRAMS): test/%: test/%.o lib@LIB_NAME@.so .PHONY: install -install: all - $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api - $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR) - $(INSTALL_PROG) lib@LIB_NAME@.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR) - ln -sf lib@LIB_NAME@.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/lib@LIB_NAME@.so.$(MAJOR) - ln -sf lib@LIB_NAME@.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/lib@LIB_NAME@.so - $(INSTALL_DATA) lib@LIB_NAME@.a $(DESTDIR)/usr/$(LIBDIR) +install: all lib@LIB_NAME@.a + $(INSTALL_DIR) $(DESTDIR)/include/xen/api + $(INSTALL_DIR) $(DESTDIR)/lib + $(INSTALL_DATA) lib@LIB_NAME@.so.@LIB_MAJOR@.@LIB_MINOR@ $(DESTDIR)/lib + ln -sf lib@LIB_NAME@.so.@LIB_MAJOR@.@LIB_MINOR@ $(DESTDIR)/lib/lib@LIB_NAME@.so.@LIB_MAJOR@ + ln -sf lib@LIB_NAME@.so.@LIB_MAJOR@ $(DESTDIR)/lib/lib@LIB_NAME@.so + $(INSTALL_DATA) lib@LIB_NAME@.a $(DESTDIR)/lib + for i in $(LIBXENAPI_HDRS_INT); do \ + $(INSTALL_DATA) $$i $(DESTDIR)/include/; \ + done for i in $(LIBXENAPI_HDRS); do \ - $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \ + $(INSTALL_DATA) $$i $(DESTDIR)/include/xen/api; \ done diff --git a/c/OMakefile b/c/OMakefile index 7d5d333..084657d 100644 --- a/c/OMakefile +++ b/c/OMakefile @@ -68,8 +68,6 @@ c_source: gen_c_binding cp $(C_GEN_FOLDER)/*.h $(C_SRC_TMP_FOLDER)/include cp $(C_GEN_FOLDER)/*.c $(C_SRC_TMP_FOLDER)/src sed -e s/@LIB_MAJOR@/$(API_MAJOR)/g -e s/@LIB_MINOR@/$(API_MINOR)/g -e s/@LIB_NAME@/xenserver/g Makefile.dist > $(C_SRC_TMP_FOLDER)/Makefile - cp ../LICENSE $(C_SRC_TMP_FOLDER)/COPYING - sed -e 's/@SDK_VERSION@/$(SDK_VERSION)/g' README.dist >$(C_SRC_TMP_FOLDER)/README cp xen_internal.h $(C_SRC_TMP_FOLDER)/include cp xen_common.h xen_string_set.h $(C_SRC_TMP_FOLDER)/include/xen/api cp xen_common.c xen_string_set.c $(C_SRC_TMP_FOLDER)/src @@ -77,6 +75,8 @@ c_source: gen_c_binding make -C $(C_SRC_TMP_FOLDER) -f Makefile uberheader cd $(BINDINGS_TMP) && tar cjf $(MY_OUTPUT_DIR)/libxenserver-src.tar.bz2 libxenserver mkdir -p $(C_SRC_FOLDER) && cp -r $(C_SRC_TMP_FOLDER)/* $(C_SRC_FOLDER) + sed -e 's/@SDK_VERSION@/$(SDK_VERSION)/g' README.dist >$(SDK_C_FOLDER)/README + cp ../LICENSE $(SDK_C_FOLDER)/COPYING .PHONY: c_binaries c_binaries: c_source @@ -84,9 +84,9 @@ c_binaries: c_source make -C $(C_SRC_TMP_FOLDER) -f Makefile libxenserver.so else touch $(C_SRC_TMP_FOLDER)/libxenserver.so $(C_SRC_TMP_FOLDER)/libxenserver.so.$(API_MAJOR) $(C_SRC_TMP_FOLDER)/libxenserver.so.$(API_VER) - touch $(addprefix $(C_SRC_TMP_FOLDER)/, COPYING README) - cd $(BINDINGS_TMP) && tar cjf $(MY_OUTPUT_DIR)/libxenserver-bin.tar.bz2 $(addprefix libxenserver/, libxenserver.so libxenserver.so.$(API_MAJOR) libxenserver.so.$(API_VER) COPYING README) - mkdir -p $(C_BIN_FOLDER) && cp $(addprefix $(C_SRC_TMP_FOLDER)/, libxenserver.so libxenserver.so.$(API_MAJOR) libxenserver.so.$(API_VER) COPYING README) $(C_BIN_FOLDER) + touch $(addprefix $(SDK_C_FOLDER)/, COPYING README) + cd $(BINDINGS_TMP) && tar cjf $(MY_OUTPUT_DIR)/libxenserver-bin.tar.bz2 $(addprefix libxenserver/, libxenserver.so libxenserver.so.$(API_MAJOR) libxenserver.so.$(API_VER)) + mkdir -p $(C_BIN_FOLDER) && cp $(addprefix $(C_SRC_TMP_FOLDER)/, libxenserver.so libxenserver.so.$(API_MAJOR) libxenserver.so.$(API_VER)) $(C_BIN_FOLDER) .PHONY: c_folders c_folders: c_binaries c_source diff --git a/c/README.dist b/c/README.dist index fb4ec24..57b7dc2 100644 --- a/c/README.dist +++ b/c/README.dist @@ -6,6 +6,9 @@ Version @SDK_VERSION@ libxenserver is a complete SDK for Citrix XenServer, exposing the XenServer API to C programmers. +It is available in the XenServer-SDK-6.4.90.zip, which can be downloaded +from http://www.citrix.com/downloads/xenserver/. + For XenServer documentation, see http://docs.xensource.com. libxenserver includes a C function call for each XenServer API call, so API documentation and examples written for for other languages can be easily @@ -18,15 +21,11 @@ to understand the approach to error reporting and memory management taken by this library. For community content, blogs, and downloads, visit the XenServer Developer -Network at http://community.citrix.com/cdn/xs. +Network at https://www.citrix.com/community.html. libxenserver is free sofware. You can redistribute and modify it under the terms of the BSD license. See COPYING for details. -This library may be accompanied by pedagogical examples. These do not form -part of this library, and are licensed for redistribution and modification -under the BSD license. Such examples are licensed clearly at the top -of each file. Dependencies ------------ @@ -44,23 +43,19 @@ prefer. On Debian, these are packaged as libxml2-dev and libcurl3-dev. -Downloads ---------- - -libxenserver is available in the XenServer-SDK-@SDK_VERSION@.zip in two separate -folders, one for the compiled binaries, and one for the source code. -The binaries are compiled for the XenServer SDK virtual machine, and we -recommend compiling from source if you wish to use the library in a -different environment. +Folder structure +---------------- -The XenServer-SDK-@SDK_VERSION@.zip is available from -http://www.citrix.com/downloads/xenserver/. +libxenserver consists of two separate folders: +- libxenserver/bin: contains the compiled binaries +- libxenserver/src: contains the source code and tests; the tests can also +be used as pedagogical examples. -Compiling from Source +Compiling from source --------------------- -To build, simply type "make" in the libxenserver directory. +To build, simply type "make" in the libxenserver/src directory. To run any of the tests, for example the test_vm_ops, do @@ -68,5 +63,5 @@ To run any of the tests, for example the test_vm_ops, do The should be of the form: https://hostname.domain/ -You can obtain a suitable by typing in "xe sr-list" on the host, e.g.: +You can obtain a suitable by typing in "xe sr-list" on the host, e.g. "Auto-created spanning LVM SR on /dev/sda3" From 1e3d872bcd369ca3f478c431d1f305eaae7fce86 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 24 Apr 2014 12:43:27 +0100 Subject: [PATCH 5/5] CA-89829: Provided support for building oon Windows with cygwin. Signed-off-by: Konstantina Chremmou --- c/Makefile.dist | 27 ++++++++++++++++++++------- c/README.dist | 1 + 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/c/Makefile.dist b/c/Makefile.dist index c9d1ac8..7baa39f 100644 --- a/c/Makefile.dist +++ b/c/Makefile.dist @@ -25,19 +25,29 @@ # 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 +# OF THE POSSIBILITY OF SUCH DAMAGE. # DESTDIR=/usr/local -CFLAGS = -g -Iinclude \ +ifeq ($(CYGWIN), 1) + CYGWIN_LIBXML = -L/bin -lxml2-2 + CYGWIN_CURL = -L/bin -lcurl-4 + POS_FLAG = -U__STRICT_ANSI__ + TEST_LDFLAGS = -L . lib@LIB_NAME@.so $(CYGWIN_CURL) +else + POS_FLAG = -fPIC + TEST_LDFLAGS = -L . -l@LIB_NAME@ +endif + +CFLAGS = -g -Iinclude \ $(shell xml2-config --cflags) \ $(shell curl-config --cflags) \ - -W -Wall -Wmissing-prototypes -Werror -std=c99 -fPIC + -W -Wall -Wmissing-prototypes -Werror -std=c99 $(POS_FLAG) LDFLAGS = -g $(shell xml2-config --libs) \ - $(shell curl-config --libs) \ - -Wl,-rpath,$(shell pwd) + $(shell curl-config --libs) \ + -Wl,-rpath,$(shell pwd) $(CYGWIN_LIBXML) # -h for Solaris SONAME_LDFLAG ?= -soname @@ -72,7 +82,7 @@ lib@LIB_NAME@.a: $(LIBXENAPI_OBJS) $(AR) rcs lib@LIB_NAME@.a $^ $(TEST_PROGRAMS): test/%: test/%.o lib@LIB_NAME@.so - $(CC) -o $@ $< -L . -l@LIB_NAME@ $(LDFLAGS) + $(CC) -o $@ $< $(TEST_LDFLAGS) $(LDFLAGS) .PHONY: install @@ -112,10 +122,13 @@ $(TARBALL_DEST).tar.bz2: all .PHONY: clean -clean: +clean: cleantests rm -f `find -name *.o` rm -f lib@LIB_NAME@.so* rm -f lib@LIB_NAME@.a + +.PHONY: cleantests +cleantests: rm -f $(TEST_PROGRAMS) diff --git a/c/README.dist b/c/README.dist index 57b7dc2..2d2bd3d 100644 --- a/c/README.dist +++ b/c/README.dist @@ -56,6 +56,7 @@ Compiling from source --------------------- To build, simply type "make" in the libxenserver/src directory. +To build on Windows with cygwin type "make CYGWIN=1" To run any of the tests, for example the test_vm_ops, do