Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit a3d46b4

Browse files
author
Konstantina Chremmou
committed
Merge pull request #24 from kc284/master
Porting from xs64bit to trunk.
2 parents e611b96 + db501c4 commit a3d46b4

File tree

23 files changed

+273
-210
lines changed

23 files changed

+273
-210
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.2.1 (13 May 2014)
2+
-------------------
3+
4+
* Ship the API reference inside the SDK zip file (html and pdf format).
5+
* Bugs fixed: CA-89829, CA-109972, CA-124005, CA-126115, CA-129648, XOP-541.
6+
17
1.2.0 (4 Mar 2014)
28
------------------
39

CommonFunctions.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ and get_release_name release =
105105
else if release = rel_clearwater then "XenServer 6.2"
106106
else if release = rel_vgpu_tech_preview then "XenServer 6.2 SP1 Tech-Preview"
107107
else if release = rel_vgpu_productisation then "XenServer 6.2 SP1"
108+
else if release = rel_clearwater_felton then "XenServer 6.2 SP1 Hotfix XS62ESP1004"
108109
else if release = rel_augusta then "Unreleased"
109110
else ""
110111

FriendlyErrorNames.resx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@
201201
<data name="FIELD_TYPE_ERROR" xml:space="preserve">
202202
<value>One of the fields you supplied was of the wrong type.</value>
203203
</data>
204+
<data name="GPU_GROUP_CONTAINS_NO_PGPUS" xml:space="preserve">
205+
<value>The GPU group does not contain any pGPUs.</value>
206+
</data>
207+
<data name="GPU_GROUP_CONTAINS_PGPU" xml:space="preserve">
208+
<value>The GPU group contains active pGPUs and cannot be deleted.</value>
209+
</data>
210+
<data name="GPU_GROUP_CONTAINS_VGPU" xml:space="preserve">
211+
<value>The GPU group contains active vGPUs and cannot be deleted.</value>
212+
</data>
204213
<data name="HANDLE_INVALID" xml:space="preserve">
205214
<value>Object has been deleted.{0}:{1}</value>
206215
</data>
@@ -474,6 +483,15 @@
474483
<data name="PBD_EXISTS" xml:space="preserve">
475484
<value>A PBD already exists connecting the SR to the server</value>
476485
</data>
486+
<data name="PGPU_INSUFFICIENT_CAPACITY_FOR_VGPU" xml:space="preserve">
487+
<value>There is insufficient capacity on this pGPU to run the vGPU.</value>
488+
</data>
489+
<data name="PGPU_IN_USE_BY_VM" xml:space="preserve">
490+
<value>This pGPU is currently in use by running VMs.</value>
491+
</data>
492+
<data name="PGPU_NOT_COMPATIBLE_WITH_GPU_GROUP" xml:space="preserve">
493+
<value>pGPU type not compatible with destination group.</value>
494+
</data>
477495
<data name="PIF_ALREADY_BONDED" xml:space="preserve">
478496
<value>You cannot create a bond of an interface which is a member of an existing bond.</value>
479497
</data>
@@ -848,6 +866,15 @@ Authorized Roles: {1}</value>
848866
<data name="VDI_READONLY" xml:space="preserve">
849867
<value>The operation required write access but VDI {0} is read-only</value>
850868
</data>
869+
<data name="VGPU_TYPE_NOT_COMPATIBLE_WITH_RUNNING_TYPE" xml:space="preserve">
870+
<value>vGPU type is not compatible with one or more of the vGPU types currently running on this pGPU</value>
871+
</data>
872+
<data name="VGPU_TYPE_NOT_ENABLED" xml:space="preserve">
873+
<value>vGPU type is not one of the pGPU's enabled types.</value>
874+
</data>
875+
<data name="VGPU_TYPE_NOT_SUPPORTED" xml:space="preserve">
876+
<value>vGPU type is not one of the pGPU's supported types.</value>
877+
</data>
851878
<data name="VIFS_MAX_ALLOWED" xml:space="preserve">
852879
<value>You have reached the maximum number of virtual network interfaces allowed for this virtual machine.</value>
853880
</data>

c/Makefile.dist

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,69 +25,79 @@
2525
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2626
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2727
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28-
# OF THE POSSIBILITY OF SUCH DAMAGE
28+
# OF THE POSSIBILITY OF SUCH DAMAGE.
2929
#
3030

31-
MAJOR = @LIB_MAJOR@
32-
MINOR = @LIB_MINOR@
31+
DESTDIR=/usr/local
3332

34-
CFLAGS = -g -Iinclude \
33+
ifeq ($(CYGWIN), 1)
34+
CYGWIN_LIBXML = -L/bin -lxml2-2
35+
CYGWIN_CURL = -L/bin -lcurl-4
36+
POS_FLAG = -U__STRICT_ANSI__
37+
TEST_LDFLAGS = -L . lib@[email protected] $(CYGWIN_CURL)
38+
else
39+
POS_FLAG = -fPIC
40+
TEST_LDFLAGS = -L . -l@LIB_NAME@
41+
endif
42+
43+
CFLAGS = -g -Iinclude \
3544
$(shell xml2-config --cflags) \
3645
$(shell curl-config --cflags) \
37-
-W -Wall -Wmissing-prototypes -Werror -std=c99 -fPIC
46+
-W -Wall -Wmissing-prototypes -Werror -std=c99 $(POS_FLAG)
3847

3948
LDFLAGS = -g $(shell xml2-config --libs) \
40-
$(shell curl-config --libs) \
41-
-Wl,-rpath,$(shell pwd)
49+
$(shell curl-config --libs) \
50+
-Wl,-rpath,$(shell pwd) $(CYGWIN_LIBXML)
4251

4352
# -h for Solaris
4453
SONAME_LDFLAG ?= -soname
45-
# -R /usr/sfw/$(LIBDIR) -shared for Solaris
54+
# -R /usr/sfw/lib -shared for Solaris
4655
SHLIB_CFLAGS ?= -shared
4756

4857
# ginstall for Solaris
49-
INSTALL = install
50-
INSTALL_DIR = $(INSTALL) -d -m0755 -p
51-
INSTALL_DATA = $(INSTALL) -m0644 -p
58+
INSTALL_DIR = install -d -m0755 -p
59+
INSTALL_DATA = install -m0644 -p
5260

53-
LIBXENAPI_HDRS = $(wildcard include/*.h)
61+
LIBXENAPI_HDRS_INT = $(wildcard include/*.h)
62+
LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h)
5463
LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
5564

56-
TEST_PROGRAMS = test/test_vm_ops test/test_event_handling \
57-
test/test_failures test/test_vm_async_migrate \
58-
test/test_enumerate test/test_get_records
65+
TEST_PROGRAMS = $(patsubst %.c, %, $(wildcard test/*.c))
5966

60-
TARBALL_DEST = lib@LIB_NAME@-$(MAJOR).$(MINOR)
67+
TARBALL_DEST = lib@LIB_NAME@-@LIB_MAJOR@.@LIB_MINOR@
6168

6269
.PHONY: all
6370
all: $(TEST_PROGRAMS)
6471

65-
72+
6673
ln -sf $< $@
6774

68-
lib@[email protected].$(MAJOR): lib@[email protected].$(MAJOR).$(MINOR)
75+
lib@[email protected].@LIB_MAJOR@: lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@
6976
ln -sf $< $@
7077

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

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

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

8087

8188
.PHONY: install
82-
install: all
83-
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api
84-
$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
85-
$(INSTALL_PROG) lib@[email protected].$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
86-
ln -sf lib@[email protected].$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/lib@[email protected].$(MAJOR)
87-
ln -sf lib@[email protected].$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/lib@[email protected]
88-
$(INSTALL_DATA) lib@[email protected] $(DESTDIR)/usr/$(LIBDIR)
89+
install: all lib@[email protected]
90+
$(INSTALL_DIR) $(DESTDIR)/include/xen/api
91+
$(INSTALL_DIR) $(DESTDIR)/lib
92+
$(INSTALL_DATA) lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@ $(DESTDIR)/lib
93+
ln -sf lib@[email protected].@LIB_MAJOR@.@LIB_MINOR@ $(DESTDIR)/lib/lib@[email protected].@LIB_MAJOR@
94+
ln -sf lib@[email protected].@LIB_MAJOR@ $(DESTDIR)/lib/lib@[email protected]
95+
$(INSTALL_DATA) lib@[email protected] $(DESTDIR)/lib
96+
for i in $(LIBXENAPI_HDRS_INT); do \
97+
$(INSTALL_DATA) $$i $(DESTDIR)/include/; \
98+
done
8999
for i in $(LIBXENAPI_HDRS); do \
90-
$(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
100+
$(INSTALL_DATA) $$i $(DESTDIR)/include/xen/api; \
91101
done
92102

93103

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

113123

114124
.PHONY: clean
115-
clean:
125+
clean: cleantests
116126
rm -f `find -name *.o`
117127
rm -f lib@[email protected]*
118128
129+
130+
.PHONY: cleantests
131+
cleantests:
119132
rm -f $(TEST_PROGRAMS)
120133

121134

c/OMakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030

3131
API_MAJOR=2
32-
API_MINOR=0
32+
API_MINOR=2
3333
API_VER=$(API_MAJOR).$(API_MINOR)
3434

3535
C_GEN_FOLDER=$(BINDINGS_TMP)/c_gen
@@ -68,25 +68,25 @@ c_source: gen_c_binding
6868
cp $(C_GEN_FOLDER)/*.h $(C_SRC_TMP_FOLDER)/include
6969
cp $(C_GEN_FOLDER)/*.c $(C_SRC_TMP_FOLDER)/src
7070
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
71-
cp ../LICENSE $(C_SRC_TMP_FOLDER)/COPYING
72-
sed -e 's/@SDK_VERSION@/$(SDK_VERSION)/g' README.dist >$(C_SRC_TMP_FOLDER)/README
7371
cp xen_internal.h $(C_SRC_TMP_FOLDER)/include
7472
cp xen_common.h xen_string_set.h $(C_SRC_TMP_FOLDER)/include/xen/api
7573
cp xen_common.c xen_string_set.c $(C_SRC_TMP_FOLDER)/src
7674
cp test/*.c $(C_SRC_TMP_FOLDER)/test
7775
make -C $(C_SRC_TMP_FOLDER) -f Makefile uberheader
7876
cd $(BINDINGS_TMP) && tar cjf $(MY_OUTPUT_DIR)/libxenserver-src.tar.bz2 libxenserver
7977
mkdir -p $(C_SRC_FOLDER) && cp -r $(C_SRC_TMP_FOLDER)/* $(C_SRC_FOLDER)
78+
sed -e 's/@SDK_VERSION@/$(SDK_VERSION)/g' README.dist >$(SDK_C_FOLDER)/README
79+
cp ../LICENSE $(SDK_C_FOLDER)/COPYING
8080

8181
.PHONY: c_binaries
8282
c_binaries: c_source
8383
if $(equal $(COMPILE_C), yes)
8484
make -C $(C_SRC_TMP_FOLDER) -f Makefile libxenserver.so
8585
else
8686
touch $(C_SRC_TMP_FOLDER)/libxenserver.so $(C_SRC_TMP_FOLDER)/libxenserver.so.$(API_MAJOR) $(C_SRC_TMP_FOLDER)/libxenserver.so.$(API_VER)
87-
touch $(addprefix $(C_SRC_TMP_FOLDER)/, COPYING README)
88-
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)
89-
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)
87+
touch $(addprefix $(SDK_C_FOLDER)/, COPYING README)
88+
cd $(BINDINGS_TMP) && tar cjf $(MY_OUTPUT_DIR)/libxenserver-bin.tar.bz2 $(addprefix libxenserver/, libxenserver.so libxenserver.so.$(API_MAJOR) libxenserver.so.$(API_VER))
89+
mkdir -p $(C_BIN_FOLDER) && cp $(addprefix $(C_SRC_TMP_FOLDER)/, libxenserver.so libxenserver.so.$(API_MAJOR) libxenserver.so.$(API_VER)) $(C_BIN_FOLDER)
9090

9191
.PHONY: c_folders
9292
c_folders: c_binaries c_source

c/README.dist

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Version @SDK_VERSION@
66
libxenserver is a complete SDK for Citrix XenServer, exposing the XenServer
77
API to C programmers.
88

9+
It is available in the XenServer-SDK-6.4.90.zip, which can be downloaded
10+
from http://www.citrix.com/downloads/xenserver/.
11+
912
For XenServer documentation, see http://docs.xensource.com.
1013
libxenserver includes a C function call for each XenServer API call, so API
1114
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
1821
by this library.
1922

2023
For community content, blogs, and downloads, visit the XenServer Developer
21-
Network at http://community.citrix.com/cdn/xs.
24+
Network at https://www.citrix.com/community.html.
2225

2326
libxenserver is free sofware. You can redistribute and modify it under the
2427
terms of the BSD license. See COPYING for details.
2528

26-
This library may be accompanied by pedagogical examples. These do not form
27-
part of this library, and are licensed for redistribution and modification
28-
under the BSD license. Such examples are licensed clearly at the top
29-
of each file.
3029

3130
Dependencies
3231
------------
@@ -44,29 +43,26 @@ prefer.
4443
On Debian, these are packaged as libxml2-dev and libcurl3-dev.
4544

4645

47-
Downloads
48-
---------
49-
50-
libxenserver is available in the XenServer-SDK-@[email protected] in two separate
51-
folders, one for the compiled binaries, and one for the source code.
52-
The binaries are compiled for the XenServer SDK virtual machine, and we
53-
recommend compiling from source if you wish to use the library in a
54-
different environment.
46+
Folder structure
47+
----------------
5548

56-
The XenServer-SDK-@[email protected] is available from
57-
http://www.citrix.com/downloads/xenserver/.
49+
libxenserver consists of two separate folders:
50+
- libxenserver/bin: contains the compiled binaries
51+
- libxenserver/src: contains the source code and tests; the tests can also
52+
be used as pedagogical examples.
5853

5954

60-
Compiling from Source
55+
Compiling from source
6156
---------------------
6257

63-
To build, simply type "make" in the libxenserver directory.
58+
To build, simply type "make" in the libxenserver/src directory.
59+
To build on Windows with cygwin type "make CYGWIN=1"
6460

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

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

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

71-
You can obtain a suitable <sr-name> by typing in "xe sr-list" on the host, e.g.:
67+
You can obtain a suitable <sr-name> by typing in "xe sr-list" on the host, e.g.
7268
"Auto-created spanning LVM SR on /dev/sda3"

c/xen_common.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ xen_api_version_to_string(xen_api_version version)
192192
return "1.10";
193193
case xen_api_version_2_0:
194194
return "2.0";
195+
case xen_api_version_2_1:
196+
return "2.1";
197+
case xen_api_version_2_2:
198+
return "2.2";
195199
default:
196200
return "Unknown";
197201
}
@@ -321,9 +325,15 @@ set_api_version(xen_session *session)
321325

322326
if (major_version == (int64_t)2)
323327
{
324-
if (minor_version == (int64_t)0)
328+
if (minor_version == (int64_t)2)
329+
session->api_version = xen_api_version_2_2;
330+
331+
else if (minor_version == (int64_t)1)
332+
session->api_version = xen_api_version_2_1;
333+
334+
else if (minor_version == (int64_t)0)
325335
session->api_version = xen_api_version_2_0;
326-
336+
327337
else
328338
session->api_version = xen_api_unknown_version;
329339
}

c/xen_common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ typedef enum xen_api_version
7575
xen_api_version_1_9 = 9,
7676
xen_api_version_1_10 = 10,
7777
xen_api_version_2_0 = 11,
78-
xen_api_latest_version = 11,
78+
xen_api_version_2_1 = 12,
79+
xen_api_version_2_2 = 13,
80+
xen_api_latest_version = 13,
7981
xen_api_unknown_version = 99,
8082
/* Also change xen_api_version_to_string() and set_api_version() in xen_common.c */
8183
} xen_api_version;

csharp/gen_csharp_binding.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,12 @@ and returns_xenobject msg =
684684
and get_params_doc msg classname params =
685685
let sessionDoc = "\n /// <param name=\"session\">The session</param>" in
686686
let refDoc = if is_method_static msg then ""
687+
else if (msg.msg_name = "get_by_permission") then
688+
sprintf "\n /// <param name=\"_%s\">The opaque_ref of the given permission</param>" (String.lowercase classname)
689+
else if (msg.msg_name = "revert") then
690+
sprintf "\n /// <param name=\"_%s\">The opaque_ref of the given snapshotted state</param>" (String.lowercase classname)
687691
else sprintf "\n /// <param name=\"_%s\">The opaque_ref of the given %s</param>"
688-
(String.lowercase classname) (String.capitalize classname) in
692+
(String.lowercase classname) (String.lowercase classname) in
689693
String.concat "" (sessionDoc::(refDoc::(List.map (fun x -> get_param_doc msg x) params)))
690694

691695
and get_param_doc msg x =

csharp/samples/GetVariousRecords/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[assembly: AssemblyTitle("GetVariousRecords")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyCompany("Citrix Systems, Inc.")]
1212
[assembly: AssemblyProduct("GetVariousRecords")]
1313
[assembly: AssemblyCopyright("Copyright © Citrix Systems, Inc.")]
1414
[assembly: AssemblyTrademark("")]

0 commit comments

Comments
 (0)