Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.2.1 (13 May 2014)
-------------------

* Ship the API reference inside the SDK zip file (html and pdf format).
* Bugs fixed: CA-89829, CA-109972, CA-124005, CA-126115, CA-129648, XOP-541.

1.2.0 (4 Mar 2014)
------------------

Expand Down
1 change: 1 addition & 0 deletions CommonFunctions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ and get_release_name release =
else if release = rel_clearwater then "XenServer 6.2"
else if release = rel_vgpu_tech_preview then "XenServer 6.2 SP1 Tech-Preview"
else if release = rel_vgpu_productisation then "XenServer 6.2 SP1"
else if release = rel_clearwater_felton then "XenServer 6.2 SP1 Hotfix XS62ESP1004"
else if release = rel_augusta then "Unreleased"
else ""

Expand Down
27 changes: 27 additions & 0 deletions FriendlyErrorNames.resx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@
<data name="FIELD_TYPE_ERROR" xml:space="preserve">
<value>One of the fields you supplied was of the wrong type.</value>
</data>
<data name="GPU_GROUP_CONTAINS_NO_PGPUS" xml:space="preserve">
<value>The GPU group does not contain any pGPUs.</value>
</data>
<data name="GPU_GROUP_CONTAINS_PGPU" xml:space="preserve">
<value>The GPU group contains active pGPUs and cannot be deleted.</value>
</data>
<data name="GPU_GROUP_CONTAINS_VGPU" xml:space="preserve">
<value>The GPU group contains active vGPUs and cannot be deleted.</value>
</data>
<data name="HANDLE_INVALID" xml:space="preserve">
<value>Object has been deleted.{0}:{1}</value>
</data>
Expand Down Expand Up @@ -474,6 +483,15 @@
<data name="PBD_EXISTS" xml:space="preserve">
<value>A PBD already exists connecting the SR to the server</value>
</data>
<data name="PGPU_INSUFFICIENT_CAPACITY_FOR_VGPU" xml:space="preserve">
<value>There is insufficient capacity on this pGPU to run the vGPU.</value>
</data>
<data name="PGPU_IN_USE_BY_VM" xml:space="preserve">
<value>This pGPU is currently in use by running VMs.</value>
</data>
<data name="PGPU_NOT_COMPATIBLE_WITH_GPU_GROUP" xml:space="preserve">
<value>pGPU type not compatible with destination group.</value>
</data>
<data name="PIF_ALREADY_BONDED" xml:space="preserve">
<value>You cannot create a bond of an interface which is a member of an existing bond.</value>
</data>
Expand Down Expand Up @@ -848,6 +866,15 @@ Authorized Roles: {1}</value>
<data name="VDI_READONLY" xml:space="preserve">
<value>The operation required write access but VDI {0} is read-only</value>
</data>
<data name="VGPU_TYPE_NOT_COMPATIBLE_WITH_RUNNING_TYPE" xml:space="preserve">
<value>vGPU type is not compatible with one or more of the vGPU types currently running on this pGPU</value>
</data>
<data name="VGPU_TYPE_NOT_ENABLED" xml:space="preserve">
<value>vGPU type is not one of the pGPU's enabled types.</value>
</data>
<data name="VGPU_TYPE_NOT_SUPPORTED" xml:space="preserve">
<value>vGPU type is not one of the pGPU's supported types.</value>
</data>
<data name="VIFS_MAX_ALLOWED" xml:space="preserve">
<value>You have reached the maximum number of virtual network interfaces allowed for this virtual machine.</value>
</data>
Expand Down
73 changes: 43 additions & 30 deletions c/Makefile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,69 +25,79 @@
# 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.
#

MAJOR = @LIB_MAJOR@
MINOR = @LIB_MINOR@
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@[email protected] $(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
# -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@[email protected]: lib@[email protected].$(MAJOR)
lib@[email protected]: lib@[email protected].@LIB_MAJOR@
ln -sf $< $@

lib@[email protected].$(MAJOR): lib@[email protected].$(MAJOR).$(MINOR)
lib@[email protected].@LIB_MAJOR@: lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@
ln -sf $< $@

lib@[email protected].$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib@[email protected].$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@: $(LIBXENAPI_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib@[email protected].@LIB_MAJOR@ $(SHLIB_CFLAGS) -o $@ $^

lib@[email protected]: $(LIBXENAPI_OBJS)
$(AR) rcs lib@[email protected] $^

$(TEST_PROGRAMS): test/%: test/%.o lib@[email protected]
$(CC) -o $@ $< -L . -l@LIB_NAME@ $(LDFLAGS)
$(CC) -o $@ $< $(TEST_LDFLAGS) $(LDFLAGS)


.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api
$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
$(INSTALL_PROG) lib@[email protected].$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
ln -sf lib@[email protected].$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/lib@[email protected].$(MAJOR)
ln -sf lib@[email protected].$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/lib@[email protected]
$(INSTALL_DATA) lib@[email protected] $(DESTDIR)/usr/$(LIBDIR)
install: all lib@[email protected]
$(INSTALL_DIR) $(DESTDIR)/include/xen/api
$(INSTALL_DIR) $(DESTDIR)/lib
$(INSTALL_DATA) lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@ $(DESTDIR)/lib
ln -sf lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@ $(DESTDIR)/lib/lib@[email protected].@LIB_MAJOR@
ln -sf lib@[email protected].@LIB_MAJOR@ $(DESTDIR)/lib/lib@[email protected]
$(INSTALL_DATA) lib@[email protected] $(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


Expand All @@ -112,10 +122,13 @@ $(TARBALL_DEST).tar.bz2: all


.PHONY: clean
clean:
clean: cleantests
rm -f `find -name *.o`
rm -f lib@[email protected]*
rm -f lib@[email protected]

.PHONY: cleantests
cleantests:
rm -f $(TEST_PROGRAMS)


Expand Down
12 changes: 6 additions & 6 deletions c/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#

API_MAJOR=2
API_MINOR=0
API_MINOR=2
API_VER=$(API_MAJOR).$(API_MINOR)

C_GEN_FOLDER=$(BINDINGS_TMP)/c_gen
Expand Down Expand Up @@ -68,25 +68,25 @@ 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
cp test/*.c $(C_SRC_TMP_FOLDER)/test
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
if $(equal $(COMPILE_C), yes)
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
Expand Down
32 changes: 14 additions & 18 deletions c/README.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
------------
Expand All @@ -44,29 +43,26 @@ prefer.
On Debian, these are packaged as libxml2-dev and libcurl3-dev.


Downloads
---------

libxenserver is available in the XenServer-SDK-@[email protected] 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-@[email protected] 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 build on Windows with cygwin type "make CYGWIN=1"

To run any of the tests, for example the test_vm_ops, do

./test/test_vm_ops <url> <sr-name> <username> <password>

The <url> should be of the form: https://hostname.domain/

You can obtain a suitable <sr-name> by typing in "xe sr-list" on the host, e.g.:
You can obtain a suitable <sr-name> by typing in "xe sr-list" on the host, e.g.
"Auto-created spanning LVM SR on /dev/sda3"
14 changes: 12 additions & 2 deletions c/xen_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ xen_api_version_to_string(xen_api_version version)
return "1.10";
case xen_api_version_2_0:
return "2.0";
case xen_api_version_2_1:
return "2.1";
case xen_api_version_2_2:
return "2.2";
default:
return "Unknown";
}
Expand Down Expand Up @@ -321,9 +325,15 @@ set_api_version(xen_session *session)

if (major_version == (int64_t)2)
{
if (minor_version == (int64_t)0)
if (minor_version == (int64_t)2)
session->api_version = xen_api_version_2_2;

else if (minor_version == (int64_t)1)
session->api_version = xen_api_version_2_1;

else if (minor_version == (int64_t)0)
session->api_version = xen_api_version_2_0;

else
session->api_version = xen_api_unknown_version;
}
Expand Down
4 changes: 3 additions & 1 deletion c/xen_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ typedef enum xen_api_version
xen_api_version_1_9 = 9,
xen_api_version_1_10 = 10,
xen_api_version_2_0 = 11,
xen_api_latest_version = 11,
xen_api_version_2_1 = 12,
xen_api_version_2_2 = 13,
xen_api_latest_version = 13,
xen_api_unknown_version = 99,
/* Also change xen_api_version_to_string() and set_api_version() in xen_common.c */
} xen_api_version;
Expand Down
6 changes: 5 additions & 1 deletion csharp/gen_csharp_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,12 @@ and returns_xenobject msg =
and get_params_doc msg classname params =
let sessionDoc = "\n /// <param name=\"session\">The session</param>" in
let refDoc = if is_method_static msg then ""
else if (msg.msg_name = "get_by_permission") then
sprintf "\n /// <param name=\"_%s\">The opaque_ref of the given permission</param>" (String.lowercase classname)
else if (msg.msg_name = "revert") then
sprintf "\n /// <param name=\"_%s\">The opaque_ref of the given snapshotted state</param>" (String.lowercase classname)
else sprintf "\n /// <param name=\"_%s\">The opaque_ref of the given %s</param>"
(String.lowercase classname) (String.capitalize classname) in
(String.lowercase classname) (String.lowercase classname) in
String.concat "" (sessionDoc::(refDoc::(List.map (fun x -> get_param_doc msg x) params)))

and get_param_doc msg x =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[assembly: AssemblyTitle("GetVariousRecords")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Citrix Systems, Inc.")]
[assembly: AssemblyProduct("GetVariousRecords")]
[assembly: AssemblyCopyright("Copyright © Citrix Systems, Inc.")]
[assembly: AssemblyTrademark("")]
Expand Down
2 changes: 1 addition & 1 deletion csharp/samples/GetVmRecords/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[assembly: AssemblyTitle("GetVmRecords")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Citrix Systems, Inc.")]
[assembly: AssemblyProduct("GetVmRecords")]
[assembly: AssemblyCopyright("Copyright © Citrix Systems, Inc.")]
[assembly: AssemblyTrademark("")]
Expand Down
2 changes: 1 addition & 1 deletion csharp/samples/VmPowerStates/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[assembly: AssemblyTitle("VmPowerStates")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Citrix Systems, Inc.")]
[assembly: AssemblyProduct("VmPowerStates")]
[assembly: AssemblyCopyright("Copyright © Citrix Systems, Inc.")]
[assembly: AssemblyTrademark("")]
Expand Down
Loading