ia64/xen-unstable

changeset 14891:295858ddac87

Move all internal header files to a separate directory, so that it's clear what
forms the public API. Tidy up a couple of macros in xen_internal.h. Remove
test_hvm_bindings, which no longer builds, and which has had its functionality
subsumed into test_bindings. Bump the library version to 0.9.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author ewan@localhost.localdomain
date Sat Apr 21 12:21:06 2007 -0700 (2007-04-21)
parents 80304d79a78c
children 8b0e9cb6b49b
files tools/libxen/Makefile tools/libxen/include/xen/api/xen_all.h tools/libxen/include/xen/api/xen_common.h tools/libxen/include/xen/api/xen_console.h tools/libxen/include/xen/api/xen_console_decl.h tools/libxen/include/xen/api/xen_console_protocol.h tools/libxen/include/xen/api/xen_crashdump.h tools/libxen/include/xen/api/xen_crashdump_decl.h tools/libxen/include/xen/api/xen_event.h tools/libxen/include/xen/api/xen_event_decl.h tools/libxen/include/xen/api/xen_event_operation.h tools/libxen/include/xen/api/xen_host.h tools/libxen/include/xen/api/xen_host_cpu.h tools/libxen/include/xen/api/xen_host_cpu_decl.h tools/libxen/include/xen/api/xen_host_decl.h tools/libxen/include/xen/api/xen_host_metrics.h tools/libxen/include/xen/api/xen_host_metrics_decl.h tools/libxen/include/xen/api/xen_int_float_map.h tools/libxen/include/xen/api/xen_int_int_map.h tools/libxen/include/xen/api/xen_int_string_set_map.h tools/libxen/include/xen/api/xen_network.h tools/libxen/include/xen/api/xen_network_decl.h tools/libxen/include/xen/api/xen_on_crash_behaviour.h tools/libxen/include/xen/api/xen_on_normal_exit.h tools/libxen/include/xen/api/xen_pbd.h tools/libxen/include/xen/api/xen_pbd_decl.h tools/libxen/include/xen/api/xen_pif.h tools/libxen/include/xen/api/xen_pif_decl.h tools/libxen/include/xen/api/xen_pif_metrics.h tools/libxen/include/xen/api/xen_pif_metrics_decl.h tools/libxen/include/xen/api/xen_sr.h tools/libxen/include/xen/api/xen_sr_decl.h tools/libxen/include/xen/api/xen_string_set.h tools/libxen/include/xen/api/xen_string_string_map.h tools/libxen/include/xen/api/xen_user.h tools/libxen/include/xen/api/xen_user_decl.h tools/libxen/include/xen/api/xen_vbd.h tools/libxen/include/xen/api/xen_vbd_decl.h tools/libxen/include/xen/api/xen_vbd_metrics.h tools/libxen/include/xen/api/xen_vbd_metrics_decl.h tools/libxen/include/xen/api/xen_vbd_mode.h tools/libxen/include/xen/api/xen_vbd_type.h tools/libxen/include/xen/api/xen_vdi.h tools/libxen/include/xen/api/xen_vdi_decl.h tools/libxen/include/xen/api/xen_vdi_type.h tools/libxen/include/xen/api/xen_vif.h tools/libxen/include/xen/api/xen_vif_decl.h tools/libxen/include/xen/api/xen_vif_metrics.h tools/libxen/include/xen/api/xen_vif_metrics_decl.h tools/libxen/include/xen/api/xen_vm.h tools/libxen/include/xen/api/xen_vm_decl.h tools/libxen/include/xen/api/xen_vm_guest_metrics.h tools/libxen/include/xen/api/xen_vm_guest_metrics_decl.h tools/libxen/include/xen/api/xen_vm_metrics.h tools/libxen/include/xen/api/xen_vm_metrics_decl.h tools/libxen/include/xen/api/xen_vm_power_state.h tools/libxen/include/xen/api/xen_vtpm.h tools/libxen/include/xen/api/xen_vtpm_decl.h tools/libxen/include/xen_common.h tools/libxen/include/xen_console.h tools/libxen/include/xen_console_decl.h tools/libxen/include/xen_console_protocol.h tools/libxen/include/xen_console_protocol_internal.h tools/libxen/include/xen_crashdump.h tools/libxen/include/xen_crashdump_decl.h tools/libxen/include/xen_event.h tools/libxen/include/xen_event_decl.h tools/libxen/include/xen_event_operation.h tools/libxen/include/xen_host.h tools/libxen/include/xen_host_cpu.h tools/libxen/include/xen_host_cpu_decl.h tools/libxen/include/xen_host_decl.h tools/libxen/include/xen_host_metrics.h tools/libxen/include/xen_host_metrics_decl.h tools/libxen/include/xen_int_float_map.h tools/libxen/include/xen_int_int_map.h tools/libxen/include/xen_int_string_set_map.h tools/libxen/include/xen_internal.h tools/libxen/include/xen_network.h tools/libxen/include/xen_network_decl.h tools/libxen/include/xen_on_crash_behaviour.h tools/libxen/include/xen_on_crash_behaviour_internal.h tools/libxen/include/xen_on_normal_exit.h tools/libxen/include/xen_on_normal_exit_internal.h tools/libxen/include/xen_pbd.h tools/libxen/include/xen_pbd_decl.h tools/libxen/include/xen_pif.h tools/libxen/include/xen_pif_decl.h tools/libxen/include/xen_pif_metrics.h tools/libxen/include/xen_pif_metrics_decl.h tools/libxen/include/xen_sr.h tools/libxen/include/xen_sr_decl.h tools/libxen/include/xen_string_set.h tools/libxen/include/xen_string_string_map.h tools/libxen/include/xen_user.h tools/libxen/include/xen_user_decl.h tools/libxen/include/xen_vbd.h tools/libxen/include/xen_vbd_decl.h tools/libxen/include/xen_vbd_metrics.h tools/libxen/include/xen_vbd_metrics_decl.h tools/libxen/include/xen_vbd_mode.h tools/libxen/include/xen_vbd_mode_internal.h tools/libxen/include/xen_vbd_type.h tools/libxen/include/xen_vdi.h tools/libxen/include/xen_vdi_decl.h tools/libxen/include/xen_vdi_type.h tools/libxen/include/xen_vdi_type_internal.h tools/libxen/include/xen_vif.h tools/libxen/include/xen_vif_decl.h tools/libxen/include/xen_vif_metrics.h tools/libxen/include/xen_vif_metrics_decl.h tools/libxen/include/xen_vm.h tools/libxen/include/xen_vm_decl.h tools/libxen/include/xen_vm_guest_metrics.h tools/libxen/include/xen_vm_guest_metrics_decl.h tools/libxen/include/xen_vm_metrics.h tools/libxen/include/xen_vm_metrics_decl.h tools/libxen/include/xen_vm_power_state.h tools/libxen/include/xen_vm_power_state_internal.h tools/libxen/include/xen_vtpm.h tools/libxen/include/xen_vtpm_decl.h tools/libxen/src/xen_common.c tools/libxen/src/xen_console.c tools/libxen/src/xen_console_protocol.c tools/libxen/src/xen_crashdump.c tools/libxen/src/xen_event.c tools/libxen/src/xen_event_operation.c tools/libxen/src/xen_host.c tools/libxen/src/xen_host_cpu.c tools/libxen/src/xen_host_metrics.c tools/libxen/src/xen_int_float_map.c tools/libxen/src/xen_int_int_map.c tools/libxen/src/xen_int_string_set_map.c tools/libxen/src/xen_network.c tools/libxen/src/xen_on_crash_behaviour.c tools/libxen/src/xen_on_normal_exit.c tools/libxen/src/xen_pbd.c tools/libxen/src/xen_pif.c tools/libxen/src/xen_pif_metrics.c tools/libxen/src/xen_sr.c tools/libxen/src/xen_string_set.c tools/libxen/src/xen_string_string_map.c tools/libxen/src/xen_user.c tools/libxen/src/xen_vbd.c tools/libxen/src/xen_vbd_metrics.c tools/libxen/src/xen_vbd_mode.c tools/libxen/src/xen_vbd_type.c tools/libxen/src/xen_vdi.c tools/libxen/src/xen_vdi_type.c tools/libxen/src/xen_vif.c tools/libxen/src/xen_vif_metrics.c tools/libxen/src/xen_vm.c tools/libxen/src/xen_vm_guest_metrics.c tools/libxen/src/xen_vm_metrics.c tools/libxen/src/xen_vm_power_state.c tools/libxen/src/xen_vtpm.c tools/libxen/test/test_bindings.c tools/libxen/test/test_event_handling.c tools/libxen/test/test_hvm_bindings.c
line diff
     1.1 --- a/tools/libxen/Makefile	Mon Apr 16 19:19:07 2007 -0400
     1.2 +++ b/tools/libxen/Makefile	Sat Apr 21 12:21:06 2007 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  #
     1.5 -# Copyright (c) 2006, XenSource Inc.
     1.6 +# Copyright (c) 2006-2007, XenSource Inc.
     1.7  #
     1.8  # This library is free software; you can redistribute it and/or
     1.9  # modify it under the terms of the GNU Lesser General Public
    1.10 @@ -18,20 +18,21 @@
    1.11  XEN_ROOT=../..
    1.12  include $(XEN_ROOT)/tools/Rules.mk
    1.13  
    1.14 -MAJOR = 0.1
    1.15 -MINOR = 0
    1.16 +MAJOR = 0.9
    1.17 +MINOR = 1
    1.18  
    1.19  CFLAGS = -Iinclude                     \
    1.20 -	 $(shell xml2-config --cflags) \
    1.21 +         $(shell xml2-config --cflags) \
    1.22           $(shell curl-config --cflags) \
    1.23           -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
    1.24  
    1.25  LDFLAGS = $(shell xml2-config --libs) \
    1.26            $(shell curl-config --libs)
    1.27  
    1.28 -LIBXENAPI_HDRS = $(wildcard include/*.h)
    1.29 +LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h) include/xen/api/xen_all.h
    1.30  LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
    1.31  
    1.32 +TEST_PROGRAMS = test/test_bindings test/test_event_handling
    1.33  
    1.34  .PHONY: all
    1.35  all: libxenapi.so libxenapi.a
    1.36 @@ -48,13 +49,7 @@ libxenapi.so.$(MAJOR).$(MINOR): $(LIBXEN
    1.37  libxenapi.a: $(LIBXENAPI_OBJS)
    1.38  	$(AR) rcs libxenapi.a $^
    1.39  
    1.40 -test/test_bindings: test/test_bindings.o libxenapi.so
    1.41 -	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
    1.42 -
    1.43 -test/test_event_handling: test/test_event_handling.o libxenapi.so
    1.44 -	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
    1.45 -
    1.46 -test/test_hvm_bindings: test/test_hvm_bindings.o libxenapi.so
    1.47 +$(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
    1.48  	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
    1.49  
    1.50  
    1.51 @@ -70,9 +65,21 @@ install: all
    1.52  	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
    1.53  	done
    1.54  
    1.55 +
    1.56  .PHONY: clean
    1.57  clean:
    1.58  	rm -f `find -name *.o`
    1.59  	rm -f libxenapi.so*
    1.60  	rm -f libxenapi.a
    1.61 -	rm -f test/test_bindings
    1.62 +	rm -f $(TEST_PROGRAMS)
    1.63 +
    1.64 +
    1.65 +.PHONY: uberheader
    1.66 +uberheader: include/xen/api/xen_all.h
    1.67 +include/xen/api/xen_all.h::
    1.68 +	echo "/* This file is autogenerated */" >$@
    1.69 +	echo "#ifndef XEN_API_XEN_ALL_H" >>$@
    1.70 +	echo "#define XEN_API_XEN_ALL_H" >>$@
    1.71 +	ls include/xen/api/*.h | grep -v xen_all.h | grep -v _decl.h | \
    1.72 +          sed 's,^include/\(.*\)$$,#include <\1>,g' >>$@
    1.73 +	echo "#endif" >>$@
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/libxen/include/xen/api/xen_all.h	Sat Apr 21 12:21:06 2007 -0700
     2.3 @@ -0,0 +1,39 @@
     2.4 +/* This file is autogenerated */
     2.5 +#ifndef XEN_API_XEN_ALL_H
     2.6 +#define XEN_API_XEN_ALL_H
     2.7 +#include <xen/api/xen_common.h>
     2.8 +#include <xen/api/xen_console.h>
     2.9 +#include <xen/api/xen_console_protocol.h>
    2.10 +#include <xen/api/xen_crashdump.h>
    2.11 +#include <xen/api/xen_event.h>
    2.12 +#include <xen/api/xen_event_operation.h>
    2.13 +#include <xen/api/xen_host_cpu.h>
    2.14 +#include <xen/api/xen_host.h>
    2.15 +#include <xen/api/xen_host_metrics.h>
    2.16 +#include <xen/api/xen_int_float_map.h>
    2.17 +#include <xen/api/xen_int_int_map.h>
    2.18 +#include <xen/api/xen_int_string_set_map.h>
    2.19 +#include <xen/api/xen_network.h>
    2.20 +#include <xen/api/xen_on_crash_behaviour.h>
    2.21 +#include <xen/api/xen_on_normal_exit.h>
    2.22 +#include <xen/api/xen_pbd.h>
    2.23 +#include <xen/api/xen_pif.h>
    2.24 +#include <xen/api/xen_pif_metrics.h>
    2.25 +#include <xen/api/xen_sr.h>
    2.26 +#include <xen/api/xen_string_set.h>
    2.27 +#include <xen/api/xen_string_string_map.h>
    2.28 +#include <xen/api/xen_user.h>
    2.29 +#include <xen/api/xen_vbd.h>
    2.30 +#include <xen/api/xen_vbd_metrics.h>
    2.31 +#include <xen/api/xen_vbd_mode.h>
    2.32 +#include <xen/api/xen_vbd_type.h>
    2.33 +#include <xen/api/xen_vdi.h>
    2.34 +#include <xen/api/xen_vdi_type.h>
    2.35 +#include <xen/api/xen_vif.h>
    2.36 +#include <xen/api/xen_vif_metrics.h>
    2.37 +#include <xen/api/xen_vm_guest_metrics.h>
    2.38 +#include <xen/api/xen_vm.h>
    2.39 +#include <xen/api/xen_vm_metrics.h>
    2.40 +#include <xen/api/xen_vm_power_state.h>
    2.41 +#include <xen/api/xen_vtpm.h>
    2.42 +#endif
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/libxen/include/xen/api/xen_common.h	Sat Apr 21 12:21:06 2007 -0700
     3.3 @@ -0,0 +1,211 @@
     3.4 +/*
     3.5 + * Copyright (c) 2006 XenSource, Inc.
     3.6 + *
     3.7 + * This library is free software; you can redistribute it and/or
     3.8 + * modify it under the terms of the GNU Lesser General Public
     3.9 + * License as published by the Free Software Foundation; either
    3.10 + * version 2.1 of the License, or (at your option) any later version.
    3.11 + *
    3.12 + * This library is distributed in the hope that it will be useful,
    3.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.15 + * Lesser General Public License for more details.
    3.16 + *
    3.17 + * You should have received a copy of the GNU Lesser General Public
    3.18 + * License along with this library; if not, write to the Free Software
    3.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    3.20 + */
    3.21 +
    3.22 +#ifndef XEN_COMMON_H
    3.23 +#define XEN_COMMON_H
    3.24 +
    3.25 +
    3.26 +#include <stdbool.h>
    3.27 +#include <stddef.h>
    3.28 +#include <stdint.h>
    3.29 +#include <time.h>
    3.30 +
    3.31 +#include "xen/api/xen_host_decl.h"
    3.32 +
    3.33 +
    3.34 +typedef bool (*xen_result_func)(const void *data, size_t len,
    3.35 +                                void *result_handle);
    3.36 +
    3.37 +
    3.38 +/**
    3.39 + * len does not include a terminating \0.
    3.40 + */
    3.41 +typedef int (*xen_call_func)(const void *, size_t len, void *user_handle,
    3.42 +                             void *result_handle,
    3.43 +                             xen_result_func result_func);
    3.44 +
    3.45 +
    3.46 +typedef struct
    3.47 +{
    3.48 +    xen_call_func call_func;
    3.49 +    void *handle;
    3.50 +    const char *session_id;
    3.51 +    bool ok;
    3.52 +    char **error_description;
    3.53 +    int error_description_count;
    3.54 +} xen_session;
    3.55 +
    3.56 +
    3.57 +typedef struct xen_session_record
    3.58 +{
    3.59 +    char *uuid;
    3.60 +    struct xen_host_record_opt *this_host;
    3.61 +    char *this_user;
    3.62 +    time_t last_active;
    3.63 +} xen_session_record;
    3.64 +
    3.65 +
    3.66 +/**
    3.67 + * Allocate a xen_session_record.
    3.68 + */
    3.69 +extern xen_session_record *
    3.70 +xen_session_record_alloc(void);
    3.71 +
    3.72 +
    3.73 +/**
    3.74 + * Free the given xen_session_record, and all referenced values.  The
    3.75 + * given record must have been allocated by this library.
    3.76 + */
    3.77 +extern void
    3.78 +xen_session_record_free(xen_session_record *record);
    3.79 +
    3.80 +
    3.81 +struct xen_task_;
    3.82 +typedef struct xen_task_ * xen_task_id;
    3.83 +
    3.84 +
    3.85 +typedef struct
    3.86 +{
    3.87 +    int progress;
    3.88 +    long eta;
    3.89 +    /* !!! RESULT */
    3.90 +}  xen_task_status;
    3.91 +
    3.92 +
    3.93 +typedef struct
    3.94 +{
    3.95 +    int major;
    3.96 +    int minor;
    3.97 +    int patch;
    3.98 +    char *extraversion;
    3.99 +} xen_version;
   3.100 +
   3.101 +
   3.102 +/**
   3.103 + * Free the given xen_version, and all referenced values.
   3.104 + */
   3.105 +extern void xen_version_free(xen_version *version);
   3.106 +
   3.107 +
   3.108 +/**
   3.109 + * Return the version of this client-side library.  This will be the major,
   3.110 + * minor, and extraversion of the Xen release with which it was released,
   3.111 + * plus the library's own version as the patch.
   3.112 + */
   3.113 +extern xen_version *xen_get_client_side_version();
   3.114 +
   3.115 +
   3.116 +extern bool
   3.117 +xen_uuid_string_to_bytes(char *uuid, char **bytes);
   3.118 +
   3.119 +
   3.120 +extern bool
   3.121 +xen_uuid_bytes_to_string(char *bytes, char **uuid);
   3.122 +
   3.123 +
   3.124 +extern void
   3.125 +xen_uuid_free(char *uuid);
   3.126 +
   3.127 +
   3.128 +extern void
   3.129 +xen_uuid_bytes_free(char *bytes);
   3.130 +
   3.131 +
   3.132 +/**
   3.133 + * Initialise this library.  Call this before starting to use this library.
   3.134 + * Note that since this library depends upon libxml2, you should also call
   3.135 + * xmlInitParser as appropriate for your program.
   3.136 + */
   3.137 +extern
   3.138 +void xen_init(void);
   3.139 +
   3.140 +
   3.141 +/**
   3.142 + * Clear up this library.  Call when you have finished using this library.
   3.143 + * Note that since this library depends upon libxml2, you should also call
   3.144 + * xmlCleanupParser as appropriate for your program.
   3.145 + */
   3.146 +extern
   3.147 +void xen_fini(void);
   3.148 +
   3.149 +
   3.150 +/**
   3.151 + * Log in at the server, and allocate a xen_session to represent this session.
   3.152 + */
   3.153 +extern xen_session *
   3.154 +xen_session_login_with_password(xen_call_func call_func, void *handle,
   3.155 +                                const char *uname, const char *pwd);
   3.156 +
   3.157 +
   3.158 +/**
   3.159 + * Log out at the server, and free the xen_session.
   3.160 + */
   3.161 +extern void
   3.162 +xen_session_logout(xen_session *session);
   3.163 +
   3.164 +
   3.165 +/**
   3.166 + * Clear any error condition recorded on this session.
   3.167 + */
   3.168 +void
   3.169 +xen_session_clear_error(xen_session *session);
   3.170 +
   3.171 +
   3.172 +/**
   3.173 + * Get the UUID of the second given session.  Set *result to point at a
   3.174 + * string, yours to free.
   3.175 + */
   3.176 +extern bool
   3.177 +xen_session_get_uuid(xen_session *session, char **result,
   3.178 +                     xen_session *self_session);
   3.179 +
   3.180 +
   3.181 +/**
   3.182 + * Get the this_host field of the second given session.  Set *result to be a
   3.183 + * handle to that host.
   3.184 + */
   3.185 +extern bool
   3.186 +xen_session_get_this_host(xen_session *session, xen_host *result,
   3.187 +                          xen_session *self_session);
   3.188 +
   3.189 +
   3.190 +/**
   3.191 + * Get the this_user field of the second given session.  Set *result to point
   3.192 + * at a string, yours to free.
   3.193 + */
   3.194 +extern bool
   3.195 +xen_session_get_this_user(xen_session *session, char **result,
   3.196 +                          xen_session *self_session);
   3.197 +
   3.198 +
   3.199 +/**
   3.200 + * Get the last_active field of the given session, and place it in *result.
   3.201 + */
   3.202 +extern bool
   3.203 +xen_session_get_last_active(xen_session *session, time_t *result,
   3.204 +                            xen_session *self_session);
   3.205 +
   3.206 +/**
   3.207 + * Get a record containing the current state of the second given session.
   3.208 + */
   3.209 +extern bool
   3.210 +xen_session_get_record(xen_session *session, xen_session_record **result,
   3.211 +                       xen_session *self_session);
   3.212 +
   3.213 +
   3.214 +#endif
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/libxen/include/xen/api/xen_console.h	Sat Apr 21 12:21:06 2007 -0700
     4.3 @@ -0,0 +1,247 @@
     4.4 +/*
     4.5 + * Copyright (c) 2006-2007, XenSource Inc.
     4.6 + *
     4.7 + * This library is free software; you can redistribute it and/or
     4.8 + * modify it under the terms of the GNU Lesser General Public
     4.9 + * License as published by the Free Software Foundation; either
    4.10 + * version 2.1 of the License, or (at your option) any later version.
    4.11 + *
    4.12 + * This library is distributed in the hope that it will be useful,
    4.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.15 + * Lesser General Public License for more details.
    4.16 + *
    4.17 + * You should have received a copy of the GNU Lesser General Public
    4.18 + * License along with this library; if not, write to the Free Software
    4.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    4.20 + */
    4.21 +
    4.22 +#ifndef XEN_CONSOLE_H
    4.23 +#define XEN_CONSOLE_H
    4.24 +
    4.25 +#include <xen/api/xen_common.h>
    4.26 +#include <xen/api/xen_console_decl.h>
    4.27 +#include <xen/api/xen_console_protocol.h>
    4.28 +#include <xen/api/xen_string_string_map.h>
    4.29 +#include <xen/api/xen_vm_decl.h>
    4.30 +
    4.31 +
    4.32 +/*
    4.33 + * The console class.
    4.34 + * 
    4.35 + * A console.
    4.36 + */
    4.37 +
    4.38 +
    4.39 +/**
    4.40 + * Free the given xen_console.  The given handle must have been
    4.41 + * allocated by this library.
    4.42 + */
    4.43 +extern void
    4.44 +xen_console_free(xen_console console);
    4.45 +
    4.46 +
    4.47 +typedef struct xen_console_set
    4.48 +{
    4.49 +    size_t size;
    4.50 +    xen_console *contents[];
    4.51 +} xen_console_set;
    4.52 +
    4.53 +/**
    4.54 + * Allocate a xen_console_set of the given size.
    4.55 + */
    4.56 +extern xen_console_set *
    4.57 +xen_console_set_alloc(size_t size);
    4.58 +
    4.59 +/**
    4.60 + * Free the given xen_console_set.  The given set must have been
    4.61 + * allocated by this library.
    4.62 + */
    4.63 +extern void
    4.64 +xen_console_set_free(xen_console_set *set);
    4.65 +
    4.66 +
    4.67 +typedef struct xen_console_record
    4.68 +{
    4.69 +    xen_console handle;
    4.70 +    char *uuid;
    4.71 +    enum xen_console_protocol protocol;
    4.72 +    char *location;
    4.73 +    struct xen_vm_record_opt *vm;
    4.74 +    xen_string_string_map *other_config;
    4.75 +} xen_console_record;
    4.76 +
    4.77 +/**
    4.78 + * Allocate a xen_console_record.
    4.79 + */
    4.80 +extern xen_console_record *
    4.81 +xen_console_record_alloc(void);
    4.82 +
    4.83 +/**
    4.84 + * Free the given xen_console_record, and all referenced values.  The
    4.85 + * given record must have been allocated by this library.
    4.86 + */
    4.87 +extern void
    4.88 +xen_console_record_free(xen_console_record *record);
    4.89 +
    4.90 +
    4.91 +typedef struct xen_console_record_opt
    4.92 +{
    4.93 +    bool is_record;
    4.94 +    union
    4.95 +    {
    4.96 +        xen_console handle;
    4.97 +        xen_console_record *record;
    4.98 +    } u;
    4.99 +} xen_console_record_opt;
   4.100 +
   4.101 +/**
   4.102 + * Allocate a xen_console_record_opt.
   4.103 + */
   4.104 +extern xen_console_record_opt *
   4.105 +xen_console_record_opt_alloc(void);
   4.106 +
   4.107 +/**
   4.108 + * Free the given xen_console_record_opt, and all referenced values. 
   4.109 + * The given record_opt must have been allocated by this library.
   4.110 + */
   4.111 +extern void
   4.112 +xen_console_record_opt_free(xen_console_record_opt *record_opt);
   4.113 +
   4.114 +
   4.115 +typedef struct xen_console_record_set
   4.116 +{
   4.117 +    size_t size;
   4.118 +    xen_console_record *contents[];
   4.119 +} xen_console_record_set;
   4.120 +
   4.121 +/**
   4.122 + * Allocate a xen_console_record_set of the given size.
   4.123 + */
   4.124 +extern xen_console_record_set *
   4.125 +xen_console_record_set_alloc(size_t size);
   4.126 +
   4.127 +/**
   4.128 + * Free the given xen_console_record_set, and all referenced values. 
   4.129 + * The given set must have been allocated by this library.
   4.130 + */
   4.131 +extern void
   4.132 +xen_console_record_set_free(xen_console_record_set *set);
   4.133 +
   4.134 +
   4.135 +
   4.136 +typedef struct xen_console_record_opt_set
   4.137 +{
   4.138 +    size_t size;
   4.139 +    xen_console_record_opt *contents[];
   4.140 +} xen_console_record_opt_set;
   4.141 +
   4.142 +/**
   4.143 + * Allocate a xen_console_record_opt_set of the given size.
   4.144 + */
   4.145 +extern xen_console_record_opt_set *
   4.146 +xen_console_record_opt_set_alloc(size_t size);
   4.147 +
   4.148 +/**
   4.149 + * Free the given xen_console_record_opt_set, and all referenced
   4.150 + * values.  The given set must have been allocated by this library.
   4.151 + */
   4.152 +extern void
   4.153 +xen_console_record_opt_set_free(xen_console_record_opt_set *set);
   4.154 +
   4.155 +
   4.156 +/**
   4.157 + * Get a record containing the current state of the given console.
   4.158 + */
   4.159 +extern bool
   4.160 +xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
   4.161 +
   4.162 +
   4.163 +/**
   4.164 + * Get a reference to the console instance with the specified UUID.
   4.165 + */
   4.166 +extern bool
   4.167 +xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
   4.168 +
   4.169 +
   4.170 +/**
   4.171 + * Create a new console instance, and return its handle.
   4.172 + */
   4.173 +extern bool
   4.174 +xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
   4.175 +
   4.176 +
   4.177 +/**
   4.178 + * Destroy the specified console instance.
   4.179 + */
   4.180 +extern bool
   4.181 +xen_console_destroy(xen_session *session, xen_console console);
   4.182 +
   4.183 +
   4.184 +/**
   4.185 + * Get the uuid field of the given console.
   4.186 + */
   4.187 +extern bool
   4.188 +xen_console_get_uuid(xen_session *session, char **result, xen_console console);
   4.189 +
   4.190 +
   4.191 +/**
   4.192 + * Get the protocol field of the given console.
   4.193 + */
   4.194 +extern bool
   4.195 +xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
   4.196 +
   4.197 +
   4.198 +/**
   4.199 + * Get the location field of the given console.
   4.200 + */
   4.201 +extern bool
   4.202 +xen_console_get_location(xen_session *session, char **result, xen_console console);
   4.203 +
   4.204 +
   4.205 +/**
   4.206 + * Get the VM field of the given console.
   4.207 + */
   4.208 +extern bool
   4.209 +xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
   4.210 +
   4.211 +
   4.212 +/**
   4.213 + * Get the other_config field of the given console.
   4.214 + */
   4.215 +extern bool
   4.216 +xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
   4.217 +
   4.218 +
   4.219 +/**
   4.220 + * Set the other_config field of the given console.
   4.221 + */
   4.222 +extern bool
   4.223 +xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
   4.224 +
   4.225 +
   4.226 +/**
   4.227 + * Add the given key-value pair to the other_config field of the given
   4.228 + * console.
   4.229 + */
   4.230 +extern bool
   4.231 +xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
   4.232 +
   4.233 +
   4.234 +/**
   4.235 + * Remove the given key and its corresponding value from the
   4.236 + * other_config field of the given console.  If the key is not in that Map,
   4.237 + * then do nothing.
   4.238 + */
   4.239 +extern bool
   4.240 +xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
   4.241 +
   4.242 +
   4.243 +/**
   4.244 + * Return a list of all the consoles known to the system.
   4.245 + */
   4.246 +extern bool
   4.247 +xen_console_get_all(xen_session *session, struct xen_console_set **result);
   4.248 +
   4.249 +
   4.250 +#endif
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/libxen/include/xen/api/xen_console_decl.h	Sat Apr 21 12:21:06 2007 -0700
     5.3 @@ -0,0 +1,30 @@
     5.4 +/*
     5.5 + * Copyright (c) 2006-2007, XenSource Inc.
     5.6 + *
     5.7 + * This library is free software; you can redistribute it and/or
     5.8 + * modify it under the terms of the GNU Lesser General Public
     5.9 + * License as published by the Free Software Foundation; either
    5.10 + * version 2.1 of the License, or (at your option) any later version.
    5.11 + *
    5.12 + * This library is distributed in the hope that it will be useful,
    5.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.15 + * Lesser General Public License for more details.
    5.16 + *
    5.17 + * You should have received a copy of the GNU Lesser General Public
    5.18 + * License along with this library; if not, write to the Free Software
    5.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    5.20 + */
    5.21 +
    5.22 +#ifndef XEN_CONSOLE_DECL_H
    5.23 +#define XEN_CONSOLE_DECL_H
    5.24 +
    5.25 +typedef void *xen_console;
    5.26 +
    5.27 +struct xen_console_set;
    5.28 +struct xen_console_record;
    5.29 +struct xen_console_record_set;
    5.30 +struct xen_console_record_opt;
    5.31 +struct xen_console_record_opt_set;
    5.32 +
    5.33 +#endif
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tools/libxen/include/xen/api/xen_console_protocol.h	Sat Apr 21 12:21:06 2007 -0700
     6.3 @@ -0,0 +1,82 @@
     6.4 +/*
     6.5 + * Copyright (c) 2006-2007, XenSource Inc.
     6.6 + *
     6.7 + * This library is free software; you can redistribute it and/or
     6.8 + * modify it under the terms of the GNU Lesser General Public
     6.9 + * License as published by the Free Software Foundation; either
    6.10 + * version 2.1 of the License, or (at your option) any later version.
    6.11 + *
    6.12 + * This library is distributed in the hope that it will be useful,
    6.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.15 + * Lesser General Public License for more details.
    6.16 + *
    6.17 + * You should have received a copy of the GNU Lesser General Public
    6.18 + * License along with this library; if not, write to the Free Software
    6.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    6.20 + */
    6.21 +
    6.22 +#ifndef XEN_CONSOLE_PROTOCOL_H
    6.23 +#define XEN_CONSOLE_PROTOCOL_H
    6.24 +
    6.25 +
    6.26 +#include <xen/api/xen_common.h>
    6.27 +
    6.28 +
    6.29 +enum xen_console_protocol
    6.30 +{
    6.31 +    /**
    6.32 +     * VT100 terminal
    6.33 +     */
    6.34 +    XEN_CONSOLE_PROTOCOL_VT100,
    6.35 +
    6.36 +    /**
    6.37 +     * Remote FrameBuffer protocol (as used in VNC)
    6.38 +     */
    6.39 +    XEN_CONSOLE_PROTOCOL_RFB,
    6.40 +
    6.41 +    /**
    6.42 +     * Remote Desktop Protocol
    6.43 +     */
    6.44 +    XEN_CONSOLE_PROTOCOL_RDP
    6.45 +};
    6.46 +
    6.47 +
    6.48 +typedef struct xen_console_protocol_set
    6.49 +{
    6.50 +    size_t size;
    6.51 +    enum xen_console_protocol contents[];
    6.52 +} xen_console_protocol_set;
    6.53 +
    6.54 +/**
    6.55 + * Allocate a xen_console_protocol_set of the given size.
    6.56 + */
    6.57 +extern xen_console_protocol_set *
    6.58 +xen_console_protocol_set_alloc(size_t size);
    6.59 +
    6.60 +/**
    6.61 + * Free the given xen_console_protocol_set.  The given set must have
    6.62 + * been allocated by this library.
    6.63 + */
    6.64 +extern void
    6.65 +xen_console_protocol_set_free(xen_console_protocol_set *set);
    6.66 +
    6.67 +
    6.68 +/**
    6.69 + * Return the name corresponding to the given code.  This string must
    6.70 + * not be modified or freed.
    6.71 + */
    6.72 +extern const char *
    6.73 +xen_console_protocol_to_string(enum xen_console_protocol val);
    6.74 +
    6.75 +
    6.76 +/**
    6.77 + * Return the correct code for the given string, or set the session
    6.78 + * object to failure and return an undefined value if the given string does
    6.79 + * not match a known code.
    6.80 + */
    6.81 +extern enum xen_console_protocol
    6.82 +xen_console_protocol_from_string(xen_session *session, const char *str);
    6.83 +
    6.84 +
    6.85 +#endif
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/tools/libxen/include/xen/api/xen_crashdump.h	Sat Apr 21 12:21:06 2007 -0700
     7.3 @@ -0,0 +1,199 @@
     7.4 +/*
     7.5 + * Copyright (c) 2006-2007, XenSource Inc.
     7.6 + *
     7.7 + * This library is free software; you can redistribute it and/or
     7.8 + * modify it under the terms of the GNU Lesser General Public
     7.9 + * License as published by the Free Software Foundation; either
    7.10 + * version 2.1 of the License, or (at your option) any later version.
    7.11 + *
    7.12 + * This library is distributed in the hope that it will be useful,
    7.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.15 + * Lesser General Public License for more details.
    7.16 + *
    7.17 + * You should have received a copy of the GNU Lesser General Public
    7.18 + * License along with this library; if not, write to the Free Software
    7.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    7.20 + */
    7.21 +
    7.22 +#ifndef XEN_CRASHDUMP_H
    7.23 +#define XEN_CRASHDUMP_H
    7.24 +
    7.25 +#include <xen/api/xen_common.h>
    7.26 +#include <xen/api/xen_crashdump_decl.h>
    7.27 +#include <xen/api/xen_vdi_decl.h>
    7.28 +#include <xen/api/xen_vm_decl.h>
    7.29 +
    7.30 +
    7.31 +/*
    7.32 + * The crashdump class.
    7.33 + * 
    7.34 + * A VM crashdump.
    7.35 + */
    7.36 +
    7.37 +
    7.38 +/**
    7.39 + * Free the given xen_crashdump.  The given handle must have been
    7.40 + * allocated by this library.
    7.41 + */
    7.42 +extern void
    7.43 +xen_crashdump_free(xen_crashdump crashdump);
    7.44 +
    7.45 +
    7.46 +typedef struct xen_crashdump_set
    7.47 +{
    7.48 +    size_t size;
    7.49 +    xen_crashdump *contents[];
    7.50 +} xen_crashdump_set;
    7.51 +
    7.52 +/**
    7.53 + * Allocate a xen_crashdump_set of the given size.
    7.54 + */
    7.55 +extern xen_crashdump_set *
    7.56 +xen_crashdump_set_alloc(size_t size);
    7.57 +
    7.58 +/**
    7.59 + * Free the given xen_crashdump_set.  The given set must have been
    7.60 + * allocated by this library.
    7.61 + */
    7.62 +extern void
    7.63 +xen_crashdump_set_free(xen_crashdump_set *set);
    7.64 +
    7.65 +
    7.66 +typedef struct xen_crashdump_record
    7.67 +{
    7.68 +    xen_crashdump handle;
    7.69 +    char *uuid;
    7.70 +    struct xen_vm_record_opt *vm;
    7.71 +    struct xen_vdi_record_opt *vdi;
    7.72 +} xen_crashdump_record;
    7.73 +
    7.74 +/**
    7.75 + * Allocate a xen_crashdump_record.
    7.76 + */
    7.77 +extern xen_crashdump_record *
    7.78 +xen_crashdump_record_alloc(void);
    7.79 +
    7.80 +/**
    7.81 + * Free the given xen_crashdump_record, and all referenced values.  The
    7.82 + * given record must have been allocated by this library.
    7.83 + */
    7.84 +extern void
    7.85 +xen_crashdump_record_free(xen_crashdump_record *record);
    7.86 +
    7.87 +
    7.88 +typedef struct xen_crashdump_record_opt
    7.89 +{
    7.90 +    bool is_record;
    7.91 +    union
    7.92 +    {
    7.93 +        xen_crashdump handle;
    7.94 +        xen_crashdump_record *record;
    7.95 +    } u;
    7.96 +} xen_crashdump_record_opt;
    7.97 +
    7.98 +/**
    7.99 + * Allocate a xen_crashdump_record_opt.
   7.100 + */
   7.101 +extern xen_crashdump_record_opt *
   7.102 +xen_crashdump_record_opt_alloc(void);
   7.103 +
   7.104 +/**
   7.105 + * Free the given xen_crashdump_record_opt, and all referenced values. 
   7.106 + * The given record_opt must have been allocated by this library.
   7.107 + */
   7.108 +extern void
   7.109 +xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
   7.110 +
   7.111 +
   7.112 +typedef struct xen_crashdump_record_set
   7.113 +{
   7.114 +    size_t size;
   7.115 +    xen_crashdump_record *contents[];
   7.116 +} xen_crashdump_record_set;
   7.117 +
   7.118 +/**
   7.119 + * Allocate a xen_crashdump_record_set of the given size.
   7.120 + */
   7.121 +extern xen_crashdump_record_set *
   7.122 +xen_crashdump_record_set_alloc(size_t size);
   7.123 +
   7.124 +/**
   7.125 + * Free the given xen_crashdump_record_set, and all referenced values. 
   7.126 + * The given set must have been allocated by this library.
   7.127 + */
   7.128 +extern void
   7.129 +xen_crashdump_record_set_free(xen_crashdump_record_set *set);
   7.130 +
   7.131 +
   7.132 +
   7.133 +typedef struct xen_crashdump_record_opt_set
   7.134 +{
   7.135 +    size_t size;
   7.136 +    xen_crashdump_record_opt *contents[];
   7.137 +} xen_crashdump_record_opt_set;
   7.138 +
   7.139 +/**
   7.140 + * Allocate a xen_crashdump_record_opt_set of the given size.
   7.141 + */
   7.142 +extern xen_crashdump_record_opt_set *
   7.143 +xen_crashdump_record_opt_set_alloc(size_t size);
   7.144 +
   7.145 +/**
   7.146 + * Free the given xen_crashdump_record_opt_set, and all referenced
   7.147 + * values.  The given set must have been allocated by this library.
   7.148 + */
   7.149 +extern void
   7.150 +xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
   7.151 +
   7.152 +
   7.153 +/**
   7.154 + * Get a record containing the current state of the given crashdump.
   7.155 + */
   7.156 +extern bool
   7.157 +xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
   7.158 +
   7.159 +
   7.160 +/**
   7.161 + * Get a reference to the crashdump instance with the specified UUID.
   7.162 + */
   7.163 +extern bool
   7.164 +xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
   7.165 +
   7.166 +
   7.167 +/**
   7.168 + * Get the uuid field of the given crashdump.
   7.169 + */
   7.170 +extern bool
   7.171 +xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
   7.172 +
   7.173 +
   7.174 +/**
   7.175 + * Get the VM field of the given crashdump.
   7.176 + */
   7.177 +extern bool
   7.178 +xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
   7.179 +
   7.180 +
   7.181 +/**
   7.182 + * Get the VDI field of the given crashdump.
   7.183 + */
   7.184 +extern bool
   7.185 +xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
   7.186 +
   7.187 +
   7.188 +/**
   7.189 + * Destroy the specified crashdump.
   7.190 + */
   7.191 +extern bool
   7.192 +xen_crashdump_destroy(xen_session *session, xen_crashdump self);
   7.193 +
   7.194 +
   7.195 +/**
   7.196 + * Return a list of all the crashdumps known to the system.
   7.197 + */
   7.198 +extern bool
   7.199 +xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
   7.200 +
   7.201 +
   7.202 +#endif
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tools/libxen/include/xen/api/xen_crashdump_decl.h	Sat Apr 21 12:21:06 2007 -0700
     8.3 @@ -0,0 +1,30 @@
     8.4 +/*
     8.5 + * Copyright (c) 2006-2007, XenSource Inc.
     8.6 + *
     8.7 + * This library is free software; you can redistribute it and/or
     8.8 + * modify it under the terms of the GNU Lesser General Public
     8.9 + * License as published by the Free Software Foundation; either
    8.10 + * version 2.1 of the License, or (at your option) any later version.
    8.11 + *
    8.12 + * This library is distributed in the hope that it will be useful,
    8.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.15 + * Lesser General Public License for more details.
    8.16 + *
    8.17 + * You should have received a copy of the GNU Lesser General Public
    8.18 + * License along with this library; if not, write to the Free Software
    8.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    8.20 + */
    8.21 +
    8.22 +#ifndef XEN_CRASHDUMP_DECL_H
    8.23 +#define XEN_CRASHDUMP_DECL_H
    8.24 +
    8.25 +typedef void *xen_crashdump;
    8.26 +
    8.27 +struct xen_crashdump_set;
    8.28 +struct xen_crashdump_record;
    8.29 +struct xen_crashdump_record_set;
    8.30 +struct xen_crashdump_record_opt;
    8.31 +struct xen_crashdump_record_opt_set;
    8.32 +
    8.33 +#endif
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/tools/libxen/include/xen/api/xen_event.h	Sat Apr 21 12:21:06 2007 -0700
     9.3 @@ -0,0 +1,102 @@
     9.4 +/*
     9.5 + * Copyright (c) 2006-2007, XenSource Inc.
     9.6 + *
     9.7 + * This library is free software; you can redistribute it and/or
     9.8 + * modify it under the terms of the GNU Lesser General Public
     9.9 + * License as published by the Free Software Foundation; either
    9.10 + * version 2.1 of the License, or (at your option) any later version.
    9.11 + *
    9.12 + * This library is distributed in the hope that it will be useful,
    9.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.15 + * Lesser General Public License for more details.
    9.16 + *
    9.17 + * You should have received a copy of the GNU Lesser General Public
    9.18 + * License along with this library; if not, write to the Free Software
    9.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    9.20 + */
    9.21 +
    9.22 +#ifndef XEN_EVENT_H
    9.23 +#define XEN_EVENT_H
    9.24 +
    9.25 +#include <xen/api/xen_common.h>
    9.26 +#include <xen/api/xen_event_decl.h>
    9.27 +#include <xen/api/xen_event_operation.h>
    9.28 +#include <xen/api/xen_string_set.h>
    9.29 +
    9.30 +
    9.31 +/*
    9.32 + * The event class.
    9.33 + * 
    9.34 + * Asynchronous event registration and handling.
    9.35 + */
    9.36 +
    9.37 +
    9.38 +
    9.39 +typedef struct xen_event_record
    9.40 +{
    9.41 +    int64_t id;
    9.42 +    time_t timestamp;
    9.43 +    char *class;
    9.44 +    enum xen_event_operation operation;
    9.45 +    char *ref;
    9.46 +    char *obj_uuid;
    9.47 +} xen_event_record;
    9.48 +
    9.49 +/**
    9.50 + * Allocate a xen_event_record.
    9.51 + */
    9.52 +extern xen_event_record *
    9.53 +xen_event_record_alloc(void);
    9.54 +
    9.55 +/**
    9.56 + * Free the given xen_event_record, and all referenced values.  The
    9.57 + * given record must have been allocated by this library.
    9.58 + */
    9.59 +extern void
    9.60 +xen_event_record_free(xen_event_record *record);
    9.61 +
    9.62 +
    9.63 +typedef struct xen_event_record_set
    9.64 +{
    9.65 +    size_t size;
    9.66 +    xen_event_record *contents[];
    9.67 +} xen_event_record_set;
    9.68 +
    9.69 +/**
    9.70 + * Allocate a xen_event_record_set of the given size.
    9.71 + */
    9.72 +extern xen_event_record_set *
    9.73 +xen_event_record_set_alloc(size_t size);
    9.74 +
    9.75 +/**
    9.76 + * Free the given xen_event_record_set, and all referenced values.  The
    9.77 + * given set must have been allocated by this library.
    9.78 + */
    9.79 +extern void
    9.80 +xen_event_record_set_free(xen_event_record_set *set);
    9.81 +
    9.82 +
    9.83 +/**
    9.84 + * Registers this session with the event system.  Specifying the empty
    9.85 + * list will register for all classes.
    9.86 + */
    9.87 +extern bool
    9.88 +xen_event_register(xen_session *session, struct xen_string_set *classes);
    9.89 +
    9.90 +
    9.91 +/**
    9.92 + * Unregisters this session with the event system.
    9.93 + */
    9.94 +extern bool
    9.95 +xen_event_unregister(xen_session *session, struct xen_string_set *classes);
    9.96 +
    9.97 +
    9.98 +/**
    9.99 + * Blocking call which returns a (possibly empty) batch of events.
   9.100 + */
   9.101 +extern bool
   9.102 +xen_event_next(xen_session *session, struct xen_event_record_set **result);
   9.103 +
   9.104 +
   9.105 +#endif
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/tools/libxen/include/xen/api/xen_event_decl.h	Sat Apr 21 12:21:06 2007 -0700
    10.3 @@ -0,0 +1,25 @@
    10.4 +/*
    10.5 + * Copyright (c) 2006-2007, XenSource Inc.
    10.6 + *
    10.7 + * This library is free software; you can redistribute it and/or
    10.8 + * modify it under the terms of the GNU Lesser General Public
    10.9 + * License as published by the Free Software Foundation; either
   10.10 + * version 2.1 of the License, or (at your option) any later version.
   10.11 + *
   10.12 + * This library is distributed in the hope that it will be useful,
   10.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   10.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   10.15 + * Lesser General Public License for more details.
   10.16 + *
   10.17 + * You should have received a copy of the GNU Lesser General Public
   10.18 + * License along with this library; if not, write to the Free Software
   10.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   10.20 + */
   10.21 +
   10.22 +#ifndef XEN_EVENT_DECL_H
   10.23 +#define XEN_EVENT_DECL_H
   10.24 +
   10.25 +struct xen_event_record;
   10.26 +struct xen_event_record_set;
   10.27 +
   10.28 +#endif
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/tools/libxen/include/xen/api/xen_event_operation.h	Sat Apr 21 12:21:06 2007 -0700
    11.3 @@ -0,0 +1,82 @@
    11.4 +/*
    11.5 + * Copyright (c) 2006-2007, XenSource Inc.
    11.6 + *
    11.7 + * This library is free software; you can redistribute it and/or
    11.8 + * modify it under the terms of the GNU Lesser General Public
    11.9 + * License as published by the Free Software Foundation; either
   11.10 + * version 2.1 of the License, or (at your option) any later version.
   11.11 + *
   11.12 + * This library is distributed in the hope that it will be useful,
   11.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11.15 + * Lesser General Public License for more details.
   11.16 + *
   11.17 + * You should have received a copy of the GNU Lesser General Public
   11.18 + * License along with this library; if not, write to the Free Software
   11.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   11.20 + */
   11.21 +
   11.22 +#ifndef XEN_EVENT_OPERATION_H
   11.23 +#define XEN_EVENT_OPERATION_H
   11.24 +
   11.25 +
   11.26 +#include <xen/api/xen_common.h>
   11.27 +
   11.28 +
   11.29 +enum xen_event_operation
   11.30 +{
   11.31 +    /**
   11.32 +     * An object has been created
   11.33 +     */
   11.34 +    XEN_EVENT_OPERATION_ADD,
   11.35 +
   11.36 +    /**
   11.37 +     * An object has been deleted
   11.38 +     */
   11.39 +    XEN_EVENT_OPERATION_DEL,
   11.40 +
   11.41 +    /**
   11.42 +     * An object has been modified
   11.43 +     */
   11.44 +    XEN_EVENT_OPERATION_MOD
   11.45 +};
   11.46 +
   11.47 +
   11.48 +typedef struct xen_event_operation_set
   11.49 +{
   11.50 +    size_t size;
   11.51 +    enum xen_event_operation contents[];
   11.52 +} xen_event_operation_set;
   11.53 +
   11.54 +/**
   11.55 + * Allocate a xen_event_operation_set of the given size.
   11.56 + */
   11.57 +extern xen_event_operation_set *
   11.58 +xen_event_operation_set_alloc(size_t size);
   11.59 +
   11.60 +/**
   11.61 + * Free the given xen_event_operation_set.  The given set must have
   11.62 + * been allocated by this library.
   11.63 + */
   11.64 +extern void
   11.65 +xen_event_operation_set_free(xen_event_operation_set *set);
   11.66 +
   11.67 +
   11.68 +/**
   11.69 + * Return the name corresponding to the given code.  This string must
   11.70 + * not be modified or freed.
   11.71 + */
   11.72 +extern const char *
   11.73 +xen_event_operation_to_string(enum xen_event_operation val);
   11.74 +
   11.75 +
   11.76 +/**
   11.77 + * Return the correct code for the given string, or set the session
   11.78 + * object to failure and return an undefined value if the given string does
   11.79 + * not match a known code.
   11.80 + */
   11.81 +extern enum xen_event_operation
   11.82 +xen_event_operation_from_string(xen_session *session, const char *str);
   11.83 +
   11.84 +
   11.85 +#endif
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/tools/libxen/include/xen/api/xen_host.h	Sat Apr 21 12:21:06 2007 -0700
    12.3 @@ -0,0 +1,497 @@
    12.4 +/*
    12.5 + * Copyright (c) 2006-2007, XenSource Inc.
    12.6 + *
    12.7 + * This library is free software; you can redistribute it and/or
    12.8 + * modify it under the terms of the GNU Lesser General Public
    12.9 + * License as published by the Free Software Foundation; either
   12.10 + * version 2.1 of the License, or (at your option) any later version.
   12.11 + *
   12.12 + * This library is distributed in the hope that it will be useful,
   12.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   12.15 + * Lesser General Public License for more details.
   12.16 + *
   12.17 + * You should have received a copy of the GNU Lesser General Public
   12.18 + * License along with this library; if not, write to the Free Software
   12.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   12.20 + */
   12.21 +
   12.22 +#ifndef XEN_HOST_H
   12.23 +#define XEN_HOST_H
   12.24 +
   12.25 +#include <xen/api/xen_common.h>
   12.26 +#include <xen/api/xen_host_cpu_decl.h>
   12.27 +#include <xen/api/xen_host_decl.h>
   12.28 +#include <xen/api/xen_host_metrics_decl.h>
   12.29 +#include <xen/api/xen_pbd_decl.h>
   12.30 +#include <xen/api/xen_pif_decl.h>
   12.31 +#include <xen/api/xen_sr_decl.h>
   12.32 +#include <xen/api/xen_string_set.h>
   12.33 +#include <xen/api/xen_string_string_map.h>
   12.34 +#include <xen/api/xen_vm_decl.h>
   12.35 +
   12.36 +
   12.37 +/*
   12.38 + * The host class.
   12.39 + * 
   12.40 + * A physical host.
   12.41 + */
   12.42 +
   12.43 +
   12.44 +/**
   12.45 + * Free the given xen_host.  The given handle must have been allocated
   12.46 + * by this library.
   12.47 + */
   12.48 +extern void
   12.49 +xen_host_free(xen_host host);
   12.50 +
   12.51 +
   12.52 +typedef struct xen_host_set
   12.53 +{
   12.54 +    size_t size;
   12.55 +    xen_host *contents[];
   12.56 +} xen_host_set;
   12.57 +
   12.58 +/**
   12.59 + * Allocate a xen_host_set of the given size.
   12.60 + */
   12.61 +extern xen_host_set *
   12.62 +xen_host_set_alloc(size_t size);
   12.63 +
   12.64 +/**
   12.65 + * Free the given xen_host_set.  The given set must have been allocated
   12.66 + * by this library.
   12.67 + */
   12.68 +extern void
   12.69 +xen_host_set_free(xen_host_set *set);
   12.70 +
   12.71 +
   12.72 +typedef struct xen_host_record
   12.73 +{
   12.74 +    xen_host handle;
   12.75 +    char *uuid;
   12.76 +    char *name_label;
   12.77 +    char *name_description;
   12.78 +    int64_t api_version_major;
   12.79 +    int64_t api_version_minor;
   12.80 +    char *api_version_vendor;
   12.81 +    xen_string_string_map *api_version_vendor_implementation;
   12.82 +    bool enabled;
   12.83 +    xen_string_string_map *software_version;
   12.84 +    xen_string_string_map *other_config;
   12.85 +    struct xen_string_set *capabilities;
   12.86 +    xen_string_string_map *cpu_configuration;
   12.87 +    char *sched_policy;
   12.88 +    struct xen_string_set *supported_bootloaders;
   12.89 +    struct xen_vm_record_opt_set *resident_vms;
   12.90 +    xen_string_string_map *logging;
   12.91 +    struct xen_pif_record_opt_set *pifs;
   12.92 +    struct xen_sr_record_opt *suspend_image_sr;
   12.93 +    struct xen_sr_record_opt *crash_dump_sr;
   12.94 +    struct xen_pbd_record_opt_set *pbds;
   12.95 +    struct xen_host_cpu_record_opt_set *host_cpus;
   12.96 +    struct xen_host_metrics_record_opt *metrics;
   12.97 +} xen_host_record;
   12.98 +
   12.99 +/**
  12.100 + * Allocate a xen_host_record.
  12.101 + */
  12.102 +extern xen_host_record *
  12.103 +xen_host_record_alloc(void);
  12.104 +
  12.105 +/**
  12.106 + * Free the given xen_host_record, and all referenced values.  The
  12.107 + * given record must have been allocated by this library.
  12.108 + */
  12.109 +extern void
  12.110 +xen_host_record_free(xen_host_record *record);
  12.111 +
  12.112 +
  12.113 +typedef struct xen_host_record_opt
  12.114 +{
  12.115 +    bool is_record;
  12.116 +    union
  12.117 +    {
  12.118 +        xen_host handle;
  12.119 +        xen_host_record *record;
  12.120 +    } u;
  12.121 +} xen_host_record_opt;
  12.122 +
  12.123 +/**
  12.124 + * Allocate a xen_host_record_opt.
  12.125 + */
  12.126 +extern xen_host_record_opt *
  12.127 +xen_host_record_opt_alloc(void);
  12.128 +
  12.129 +/**
  12.130 + * Free the given xen_host_record_opt, and all referenced values.  The
  12.131 + * given record_opt must have been allocated by this library.
  12.132 + */
  12.133 +extern void
  12.134 +xen_host_record_opt_free(xen_host_record_opt *record_opt);
  12.135 +
  12.136 +
  12.137 +typedef struct xen_host_record_set
  12.138 +{
  12.139 +    size_t size;
  12.140 +    xen_host_record *contents[];
  12.141 +} xen_host_record_set;
  12.142 +
  12.143 +/**
  12.144 + * Allocate a xen_host_record_set of the given size.
  12.145 + */
  12.146 +extern xen_host_record_set *
  12.147 +xen_host_record_set_alloc(size_t size);
  12.148 +
  12.149 +/**
  12.150 + * Free the given xen_host_record_set, and all referenced values.  The
  12.151 + * given set must have been allocated by this library.
  12.152 + */
  12.153 +extern void
  12.154 +xen_host_record_set_free(xen_host_record_set *set);
  12.155 +
  12.156 +
  12.157 +
  12.158 +typedef struct xen_host_record_opt_set
  12.159 +{
  12.160 +    size_t size;
  12.161 +    xen_host_record_opt *contents[];
  12.162 +} xen_host_record_opt_set;
  12.163 +
  12.164 +/**
  12.165 + * Allocate a xen_host_record_opt_set of the given size.
  12.166 + */
  12.167 +extern xen_host_record_opt_set *
  12.168 +xen_host_record_opt_set_alloc(size_t size);
  12.169 +
  12.170 +/**
  12.171 + * Free the given xen_host_record_opt_set, and all referenced values. 
  12.172 + * The given set must have been allocated by this library.
  12.173 + */
  12.174 +extern void
  12.175 +xen_host_record_opt_set_free(xen_host_record_opt_set *set);
  12.176 +
  12.177 +
  12.178 +/**
  12.179 + * Get a record containing the current state of the given host.
  12.180 + */
  12.181 +extern bool
  12.182 +xen_host_get_record(xen_session *session, xen_host_record **result, xen_host host);
  12.183 +
  12.184 +
  12.185 +/**
  12.186 + * Get a reference to the host instance with the specified UUID.
  12.187 + */
  12.188 +extern bool
  12.189 +xen_host_get_by_uuid(xen_session *session, xen_host *result, char *uuid);
  12.190 +
  12.191 +
  12.192 +/**
  12.193 + * Get all the host instances with the given label.
  12.194 + */
  12.195 +extern bool
  12.196 +xen_host_get_by_name_label(xen_session *session, struct xen_host_set **result, char *label);
  12.197 +
  12.198 +
  12.199 +/**
  12.200 + * Get the uuid field of the given host.
  12.201 + */
  12.202 +extern bool
  12.203 +xen_host_get_uuid(xen_session *session, char **result, xen_host host);
  12.204 +
  12.205 +
  12.206 +/**
  12.207 + * Get the name/label field of the given host.
  12.208 + */
  12.209 +extern bool
  12.210 +xen_host_get_name_label(xen_session *session, char **result, xen_host host);
  12.211 +
  12.212 +
  12.213 +/**
  12.214 + * Get the name/description field of the given host.
  12.215 + */
  12.216 +extern bool
  12.217 +xen_host_get_name_description(xen_session *session, char **result, xen_host host);
  12.218 +
  12.219 +
  12.220 +/**
  12.221 + * Get the API_version/major field of the given host.
  12.222 + */
  12.223 +extern bool
  12.224 +xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host);
  12.225 +
  12.226 +
  12.227 +/**
  12.228 + * Get the API_version/minor field of the given host.
  12.229 + */
  12.230 +extern bool
  12.231 +xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host);
  12.232 +
  12.233 +
  12.234 +/**
  12.235 + * Get the API_version/vendor field of the given host.
  12.236 + */
  12.237 +extern bool
  12.238 +xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host);
  12.239 +
  12.240 +
  12.241 +/**
  12.242 + * Get the API_version/vendor_implementation field of the given host.
  12.243 + */
  12.244 +extern bool
  12.245 +xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host);
  12.246 +
  12.247 +
  12.248 +/**
  12.249 + * Get the enabled field of the given host.
  12.250 + */
  12.251 +extern bool
  12.252 +xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
  12.253 +
  12.254 +
  12.255 +/**
  12.256 + * Get the software_version field of the given host.
  12.257 + */
  12.258 +extern bool
  12.259 +xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host);
  12.260 +
  12.261 +
  12.262 +/**
  12.263 + * Get the other_config field of the given host.
  12.264 + */
  12.265 +extern bool
  12.266 +xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
  12.267 +
  12.268 +
  12.269 +/**
  12.270 + * Get the capabilities field of the given host.
  12.271 + */
  12.272 +extern bool
  12.273 +xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
  12.274 +
  12.275 +
  12.276 +/**
  12.277 + * Get the cpu_configuration field of the given host.
  12.278 + */
  12.279 +extern bool
  12.280 +xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map **result, xen_host host);
  12.281 +
  12.282 +
  12.283 +/**
  12.284 + * Get the sched_policy field of the given host.
  12.285 + */
  12.286 +extern bool
  12.287 +xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
  12.288 +
  12.289 +
  12.290 +/**
  12.291 + * Get the supported_bootloaders field of the given host.
  12.292 + */
  12.293 +extern bool
  12.294 +xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host);
  12.295 +
  12.296 +
  12.297 +/**
  12.298 + * Get the resident_VMs field of the given host.
  12.299 + */
  12.300 +extern bool
  12.301 +xen_host_get_resident_vms(xen_session *session, struct xen_vm_set **result, xen_host host);
  12.302 +
  12.303 +
  12.304 +/**
  12.305 + * Get the logging field of the given host.
  12.306 + */
  12.307 +extern bool
  12.308 +xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host);
  12.309 +
  12.310 +
  12.311 +/**
  12.312 + * Get the PIFs field of the given host.
  12.313 + */
  12.314 +extern bool
  12.315 +xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
  12.316 +
  12.317 +
  12.318 +/**
  12.319 + * Get the suspend_image_sr field of the given host.
  12.320 + */
  12.321 +extern bool
  12.322 +xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
  12.323 +
  12.324 +
  12.325 +/**
  12.326 + * Get the crash_dump_sr field of the given host.
  12.327 + */
  12.328 +extern bool
  12.329 +xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
  12.330 +
  12.331 +
  12.332 +/**
  12.333 + * Get the PBDs field of the given host.
  12.334 + */
  12.335 +extern bool
  12.336 +xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
  12.337 +
  12.338 +
  12.339 +/**
  12.340 + * Get the host_CPUs field of the given host.
  12.341 + */
  12.342 +extern bool
  12.343 +xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host);
  12.344 +
  12.345 +
  12.346 +/**
  12.347 + * Get the metrics field of the given host.
  12.348 + */
  12.349 +extern bool
  12.350 +xen_host_get_metrics(xen_session *session, xen_host_metrics *result, xen_host host);
  12.351 +
  12.352 +
  12.353 +/**
  12.354 + * Set the name/label field of the given host.
  12.355 + */
  12.356 +extern bool
  12.357 +xen_host_set_name_label(xen_session *session, xen_host host, char *label);
  12.358 +
  12.359 +
  12.360 +/**
  12.361 + * Set the name/description field of the given host.
  12.362 + */
  12.363 +extern bool
  12.364 +xen_host_set_name_description(xen_session *session, xen_host host, char *description);
  12.365 +
  12.366 +
  12.367 +/**
  12.368 + * Set the other_config field of the given host.
  12.369 + */
  12.370 +extern bool
  12.371 +xen_host_set_other_config(xen_session *session, xen_host host, xen_string_string_map *other_config);
  12.372 +
  12.373 +
  12.374 +/**
  12.375 + * Add the given key-value pair to the other_config field of the given
  12.376 + * host.
  12.377 + */
  12.378 +extern bool
  12.379 +xen_host_add_to_other_config(xen_session *session, xen_host host, char *key, char *value);
  12.380 +
  12.381 +
  12.382 +/**
  12.383 + * Remove the given key and its corresponding value from the
  12.384 + * other_config field of the given host.  If the key is not in that Map, then
  12.385 + * do nothing.
  12.386 + */
  12.387 +extern bool
  12.388 +xen_host_remove_from_other_config(xen_session *session, xen_host host, char *key);
  12.389 +
  12.390 +
  12.391 +/**
  12.392 + * Set the logging field of the given host.
  12.393 + */
  12.394 +extern bool
  12.395 +xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging);
  12.396 +
  12.397 +
  12.398 +/**
  12.399 + * Add the given key-value pair to the logging field of the given host.
  12.400 + */
  12.401 +extern bool
  12.402 +xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value);
  12.403 +
  12.404 +
  12.405 +/**
  12.406 + * Remove the given key and its corresponding value from the logging
  12.407 + * field of the given host.  If the key is not in that Map, then do nothing.
  12.408 + */
  12.409 +extern bool
  12.410 +xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
  12.411 +
  12.412 +
  12.413 +/**
  12.414 + * Set the suspend_image_sr field of the given host.
  12.415 + */
  12.416 +extern bool
  12.417 +xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
  12.418 +
  12.419 +
  12.420 +/**
  12.421 + * Set the crash_dump_sr field of the given host.
  12.422 + */
  12.423 +extern bool
  12.424 +xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
  12.425 +
  12.426 +
  12.427 +/**
  12.428 + * Puts the host into a state in which no new VMs can be started.
  12.429 + * Currently active VMs on the host continue to execute.
  12.430 + */
  12.431 +extern bool
  12.432 +xen_host_disable(xen_session *session, xen_host host);
  12.433 +
  12.434 +
  12.435 +/**
  12.436 + * Puts the host into a state in which new VMs can be started.
  12.437 + */
  12.438 +extern bool
  12.439 +xen_host_enable(xen_session *session, xen_host host);
  12.440 +
  12.441 +
  12.442 +/**
  12.443 + * Shutdown the host. (This function can only be called if there are no
  12.444 + * currently running VMs on the host and it is disabled.).
  12.445 + */
  12.446 +extern bool
  12.447 +xen_host_shutdown(xen_session *session, xen_host host);
  12.448 +
  12.449 +
  12.450 +/**
  12.451 + * Reboot the host. (This function can only be called if there are no
  12.452 + * currently running VMs on the host and it is disabled.).
  12.453 + */
  12.454 +extern bool
  12.455 +xen_host_reboot(xen_session *session, xen_host host);
  12.456 +
  12.457 +
  12.458 +/**
  12.459 + * Get the host xen dmesg.
  12.460 + */
  12.461 +extern bool
  12.462 +xen_host_dmesg(xen_session *session, char **result, xen_host host);
  12.463 +
  12.464 +
  12.465 +/**
  12.466 + * Get the host xen dmesg, and clear the buffer.
  12.467 + */
  12.468 +extern bool
  12.469 +xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
  12.470 +
  12.471 +
  12.472 +/**
  12.473 + * Get the host's log file.
  12.474 + */
  12.475 +extern bool
  12.476 +xen_host_get_log(xen_session *session, char **result, xen_host host);
  12.477 +
  12.478 +
  12.479 +/**
  12.480 + * Inject the given string as debugging keys into Xen.
  12.481 + */
  12.482 +extern bool
  12.483 +xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
  12.484 +
  12.485 +
  12.486 +/**
  12.487 + * List all supported methods.
  12.488 + */
  12.489 +extern bool
  12.490 +xen_host_list_methods(xen_session *session, struct xen_string_set **result);
  12.491 +
  12.492 +
  12.493 +/**
  12.494 + * Return a list of all the hosts known to the system.
  12.495 + */
  12.496 +extern bool
  12.497 +xen_host_get_all(xen_session *session, struct xen_host_set **result);
  12.498 +
  12.499 +
  12.500 +#endif
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/tools/libxen/include/xen/api/xen_host_cpu.h	Sat Apr 21 12:21:06 2007 -0700
    13.3 @@ -0,0 +1,247 @@
    13.4 +/*
    13.5 + * Copyright (c) 2006-2007, XenSource Inc.
    13.6 + *
    13.7 + * This library is free software; you can redistribute it and/or
    13.8 + * modify it under the terms of the GNU Lesser General Public
    13.9 + * License as published by the Free Software Foundation; either
   13.10 + * version 2.1 of the License, or (at your option) any later version.
   13.11 + *
   13.12 + * This library is distributed in the hope that it will be useful,
   13.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13.15 + * Lesser General Public License for more details.
   13.16 + *
   13.17 + * You should have received a copy of the GNU Lesser General Public
   13.18 + * License along with this library; if not, write to the Free Software
   13.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   13.20 + */
   13.21 +
   13.22 +#ifndef XEN_HOST_CPU_H
   13.23 +#define XEN_HOST_CPU_H
   13.24 +
   13.25 +#include <xen/api/xen_common.h>
   13.26 +#include <xen/api/xen_host_cpu_decl.h>
   13.27 +#include <xen/api/xen_host_decl.h>
   13.28 +
   13.29 +
   13.30 +/*
   13.31 + * The host_cpu class.
   13.32 + * 
   13.33 + * A physical CPU.
   13.34 + */
   13.35 +
   13.36 +
   13.37 +/**
   13.38 + * Free the given xen_host_cpu.  The given handle must have been
   13.39 + * allocated by this library.
   13.40 + */
   13.41 +extern void
   13.42 +xen_host_cpu_free(xen_host_cpu host_cpu);
   13.43 +
   13.44 +
   13.45 +typedef struct xen_host_cpu_set
   13.46 +{
   13.47 +    size_t size;
   13.48 +    xen_host_cpu *contents[];
   13.49 +} xen_host_cpu_set;
   13.50 +
   13.51 +/**
   13.52 + * Allocate a xen_host_cpu_set of the given size.
   13.53 + */
   13.54 +extern xen_host_cpu_set *
   13.55 +xen_host_cpu_set_alloc(size_t size);
   13.56 +
   13.57 +/**
   13.58 + * Free the given xen_host_cpu_set.  The given set must have been
   13.59 + * allocated by this library.
   13.60 + */
   13.61 +extern void
   13.62 +xen_host_cpu_set_free(xen_host_cpu_set *set);
   13.63 +
   13.64 +
   13.65 +typedef struct xen_host_cpu_record
   13.66 +{
   13.67 +    xen_host_cpu handle;
   13.68 +    char *uuid;
   13.69 +    struct xen_host_record_opt *host;
   13.70 +    int64_t number;
   13.71 +    char *vendor;
   13.72 +    int64_t speed;
   13.73 +    char *modelname;
   13.74 +    char *stepping;
   13.75 +    char *flags;
   13.76 +    char *features;
   13.77 +    double utilisation;
   13.78 +} xen_host_cpu_record;
   13.79 +
   13.80 +/**
   13.81 + * Allocate a xen_host_cpu_record.
   13.82 + */
   13.83 +extern xen_host_cpu_record *
   13.84 +xen_host_cpu_record_alloc(void);
   13.85 +
   13.86 +/**
   13.87 + * Free the given xen_host_cpu_record, and all referenced values.  The
   13.88 + * given record must have been allocated by this library.
   13.89 + */
   13.90 +extern void
   13.91 +xen_host_cpu_record_free(xen_host_cpu_record *record);
   13.92 +
   13.93 +
   13.94 +typedef struct xen_host_cpu_record_opt
   13.95 +{
   13.96 +    bool is_record;
   13.97 +    union
   13.98 +    {
   13.99 +        xen_host_cpu handle;
  13.100 +        xen_host_cpu_record *record;
  13.101 +    } u;
  13.102 +} xen_host_cpu_record_opt;
  13.103 +
  13.104 +/**
  13.105 + * Allocate a xen_host_cpu_record_opt.
  13.106 + */
  13.107 +extern xen_host_cpu_record_opt *
  13.108 +xen_host_cpu_record_opt_alloc(void);
  13.109 +
  13.110 +/**
  13.111 + * Free the given xen_host_cpu_record_opt, and all referenced values. 
  13.112 + * The given record_opt must have been allocated by this library.
  13.113 + */
  13.114 +extern void
  13.115 +xen_host_cpu_record_opt_free(xen_host_cpu_record_opt *record_opt);
  13.116 +
  13.117 +
  13.118 +typedef struct xen_host_cpu_record_set
  13.119 +{
  13.120 +    size_t size;
  13.121 +    xen_host_cpu_record *contents[];
  13.122 +} xen_host_cpu_record_set;
  13.123 +
  13.124 +/**
  13.125 + * Allocate a xen_host_cpu_record_set of the given size.
  13.126 + */
  13.127 +extern xen_host_cpu_record_set *
  13.128 +xen_host_cpu_record_set_alloc(size_t size);
  13.129 +
  13.130 +/**
  13.131 + * Free the given xen_host_cpu_record_set, and all referenced values. 
  13.132 + * The given set must have been allocated by this library.
  13.133 + */
  13.134 +extern void
  13.135 +xen_host_cpu_record_set_free(xen_host_cpu_record_set *set);
  13.136 +
  13.137 +
  13.138 +
  13.139 +typedef struct xen_host_cpu_record_opt_set
  13.140 +{
  13.141 +    size_t size;
  13.142 +    xen_host_cpu_record_opt *contents[];
  13.143 +} xen_host_cpu_record_opt_set;
  13.144 +
  13.145 +/**
  13.146 + * Allocate a xen_host_cpu_record_opt_set of the given size.
  13.147 + */
  13.148 +extern xen_host_cpu_record_opt_set *
  13.149 +xen_host_cpu_record_opt_set_alloc(size_t size);
  13.150 +
  13.151 +/**
  13.152 + * Free the given xen_host_cpu_record_opt_set, and all referenced
  13.153 + * values.  The given set must have been allocated by this library.
  13.154 + */
  13.155 +extern void
  13.156 +xen_host_cpu_record_opt_set_free(xen_host_cpu_record_opt_set *set);
  13.157 +
  13.158 +
  13.159 +/**
  13.160 + * Get a record containing the current state of the given host_cpu.
  13.161 + */
  13.162 +extern bool
  13.163 +xen_host_cpu_get_record(xen_session *session, xen_host_cpu_record **result, xen_host_cpu host_cpu);
  13.164 +
  13.165 +
  13.166 +/**
  13.167 + * Get a reference to the host_cpu instance with the specified UUID.
  13.168 + */
  13.169 +extern bool
  13.170 +xen_host_cpu_get_by_uuid(xen_session *session, xen_host_cpu *result, char *uuid);
  13.171 +
  13.172 +
  13.173 +/**
  13.174 + * Get the uuid field of the given host_cpu.
  13.175 + */
  13.176 +extern bool
  13.177 +xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu);
  13.178 +
  13.179 +
  13.180 +/**
  13.181 + * Get the host field of the given host_cpu.
  13.182 + */
  13.183 +extern bool
  13.184 +xen_host_cpu_get_host(xen_session *session, xen_host *result, xen_host_cpu host_cpu);
  13.185 +
  13.186 +
  13.187 +/**
  13.188 + * Get the number field of the given host_cpu.
  13.189 + */
  13.190 +extern bool
  13.191 +xen_host_cpu_get_number(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
  13.192 +
  13.193 +
  13.194 +/**
  13.195 + * Get the vendor field of the given host_cpu.
  13.196 + */
  13.197 +extern bool
  13.198 +xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu host_cpu);
  13.199 +
  13.200 +
  13.201 +/**
  13.202 + * Get the speed field of the given host_cpu.
  13.203 + */
  13.204 +extern bool
  13.205 +xen_host_cpu_get_speed(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
  13.206 +
  13.207 +
  13.208 +/**
  13.209 + * Get the modelname field of the given host_cpu.
  13.210 + */
  13.211 +extern bool
  13.212 +xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu host_cpu);
  13.213 +
  13.214 +
  13.215 +/**
  13.216 + * Get the stepping field of the given host_cpu.
  13.217 + */
  13.218 +extern bool
  13.219 +xen_host_cpu_get_stepping(xen_session *session, char **result, xen_host_cpu host_cpu);
  13.220 +
  13.221 +
  13.222 +/**
  13.223 + * Get the flags field of the given host_cpu.
  13.224 + */
  13.225 +extern bool
  13.226 +xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cpu);
  13.227 +
  13.228 +
  13.229 +/**
  13.230 + * Get the features field of the given host_cpu.
  13.231 + */
  13.232 +extern bool
  13.233 +xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
  13.234 +
  13.235 +
  13.236 +/**
  13.237 + * Get the utilisation field of the given host_cpu.
  13.238 + */
  13.239 +extern bool
  13.240 +xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu);
  13.241 +
  13.242 +
  13.243 +/**
  13.244 + * Return a list of all the host_cpus known to the system.
  13.245 + */
  13.246 +extern bool
  13.247 +xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result);
  13.248 +
  13.249 +
  13.250 +#endif
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/tools/libxen/include/xen/api/xen_host_cpu_decl.h	Sat Apr 21 12:21:06 2007 -0700
    14.3 @@ -0,0 +1,30 @@
    14.4 +/*
    14.5 + * Copyright (c) 2006-2007, XenSource Inc.
    14.6 + *
    14.7 + * This library is free software; you can redistribute it and/or
    14.8 + * modify it under the terms of the GNU Lesser General Public
    14.9 + * License as published by the Free Software Foundation; either
   14.10 + * version 2.1 of the License, or (at your option) any later version.
   14.11 + *
   14.12 + * This library is distributed in the hope that it will be useful,
   14.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14.15 + * Lesser General Public License for more details.
   14.16 + *
   14.17 + * You should have received a copy of the GNU Lesser General Public
   14.18 + * License along with this library; if not, write to the Free Software
   14.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   14.20 + */
   14.21 +
   14.22 +#ifndef XEN_HOST_CPU_DECL_H
   14.23 +#define XEN_HOST_CPU_DECL_H
   14.24 +
   14.25 +typedef void *xen_host_cpu;
   14.26 +
   14.27 +struct xen_host_cpu_set;
   14.28 +struct xen_host_cpu_record;
   14.29 +struct xen_host_cpu_record_set;
   14.30 +struct xen_host_cpu_record_opt;
   14.31 +struct xen_host_cpu_record_opt_set;
   14.32 +
   14.33 +#endif
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/tools/libxen/include/xen/api/xen_host_decl.h	Sat Apr 21 12:21:06 2007 -0700
    15.3 @@ -0,0 +1,30 @@
    15.4 +/*
    15.5 + * Copyright (c) 2006-2007, XenSource Inc.
    15.6 + *
    15.7 + * This library is free software; you can redistribute it and/or
    15.8 + * modify it under the terms of the GNU Lesser General Public
    15.9 + * License as published by the Free Software Foundation; either
   15.10 + * version 2.1 of the License, or (at your option) any later version.
   15.11 + *
   15.12 + * This library is distributed in the hope that it will be useful,
   15.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15.15 + * Lesser General Public License for more details.
   15.16 + *
   15.17 + * You should have received a copy of the GNU Lesser General Public
   15.18 + * License along with this library; if not, write to the Free Software
   15.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   15.20 + */
   15.21 +
   15.22 +#ifndef XEN_HOST_DECL_H
   15.23 +#define XEN_HOST_DECL_H
   15.24 +
   15.25 +typedef void *xen_host;
   15.26 +
   15.27 +struct xen_host_set;
   15.28 +struct xen_host_record;
   15.29 +struct xen_host_record_set;
   15.30 +struct xen_host_record_opt;
   15.31 +struct xen_host_record_opt_set;
   15.32 +
   15.33 +#endif
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tools/libxen/include/xen/api/xen_host_metrics.h	Sat Apr 21 12:21:06 2007 -0700
    16.3 @@ -0,0 +1,199 @@
    16.4 +/*
    16.5 + * Copyright (c) 2006-2007, XenSource Inc.
    16.6 + *
    16.7 + * This library is free software; you can redistribute it and/or
    16.8 + * modify it under the terms of the GNU Lesser General Public
    16.9 + * License as published by the Free Software Foundation; either
   16.10 + * version 2.1 of the License, or (at your option) any later version.
   16.11 + *
   16.12 + * This library is distributed in the hope that it will be useful,
   16.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16.15 + * Lesser General Public License for more details.
   16.16 + *
   16.17 + * You should have received a copy of the GNU Lesser General Public
   16.18 + * License along with this library; if not, write to the Free Software
   16.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   16.20 + */
   16.21 +
   16.22 +#ifndef XEN_HOST_METRICS_H
   16.23 +#define XEN_HOST_METRICS_H
   16.24 +
   16.25 +#include <xen/api/xen_common.h>
   16.26 +#include <xen/api/xen_host_metrics_decl.h>
   16.27 +
   16.28 +
   16.29 +/*
   16.30 + * The host_metrics class.
   16.31 + * 
   16.32 + * The metrics associated with a host.
   16.33 + */
   16.34 +
   16.35 +
   16.36 +/**
   16.37 + * Free the given xen_host_metrics.  The given handle must have been
   16.38 + * allocated by this library.
   16.39 + */
   16.40 +extern void
   16.41 +xen_host_metrics_free(xen_host_metrics host_metrics);
   16.42 +
   16.43 +
   16.44 +typedef struct xen_host_metrics_set
   16.45 +{
   16.46 +    size_t size;
   16.47 +    xen_host_metrics *contents[];
   16.48 +} xen_host_metrics_set;
   16.49 +
   16.50 +/**
   16.51 + * Allocate a xen_host_metrics_set of the given size.
   16.52 + */
   16.53 +extern xen_host_metrics_set *
   16.54 +xen_host_metrics_set_alloc(size_t size);
   16.55 +
   16.56 +/**
   16.57 + * Free the given xen_host_metrics_set.  The given set must have been
   16.58 + * allocated by this library.
   16.59 + */
   16.60 +extern void
   16.61 +xen_host_metrics_set_free(xen_host_metrics_set *set);
   16.62 +
   16.63 +
   16.64 +typedef struct xen_host_metrics_record
   16.65 +{
   16.66 +    xen_host_metrics handle;
   16.67 +    char *uuid;
   16.68 +    int64_t memory_total;
   16.69 +    int64_t memory_free;
   16.70 +    time_t last_updated;
   16.71 +} xen_host_metrics_record;
   16.72 +
   16.73 +/**
   16.74 + * Allocate a xen_host_metrics_record.
   16.75 + */
   16.76 +extern xen_host_metrics_record *
   16.77 +xen_host_metrics_record_alloc(void);
   16.78 +
   16.79 +/**
   16.80 + * Free the given xen_host_metrics_record, and all referenced values. 
   16.81 + * The given record must have been allocated by this library.
   16.82 + */
   16.83 +extern void
   16.84 +xen_host_metrics_record_free(xen_host_metrics_record *record);
   16.85 +
   16.86 +
   16.87 +typedef struct xen_host_metrics_record_opt
   16.88 +{
   16.89 +    bool is_record;
   16.90 +    union
   16.91 +    {
   16.92 +        xen_host_metrics handle;
   16.93 +        xen_host_metrics_record *record;
   16.94 +    } u;
   16.95 +} xen_host_metrics_record_opt;
   16.96 +
   16.97 +/**
   16.98 + * Allocate a xen_host_metrics_record_opt.
   16.99 + */
  16.100 +extern xen_host_metrics_record_opt *
  16.101 +xen_host_metrics_record_opt_alloc(void);
  16.102 +
  16.103 +/**
  16.104 + * Free the given xen_host_metrics_record_opt, and all referenced
  16.105 + * values.  The given record_opt must have been allocated by this library.
  16.106 + */
  16.107 +extern void
  16.108 +xen_host_metrics_record_opt_free(xen_host_metrics_record_opt *record_opt);
  16.109 +
  16.110 +
  16.111 +typedef struct xen_host_metrics_record_set
  16.112 +{
  16.113 +    size_t size;
  16.114 +    xen_host_metrics_record *contents[];
  16.115 +} xen_host_metrics_record_set;
  16.116 +
  16.117 +/**
  16.118 + * Allocate a xen_host_metrics_record_set of the given size.
  16.119 + */
  16.120 +extern xen_host_metrics_record_set *
  16.121 +xen_host_metrics_record_set_alloc(size_t size);
  16.122 +
  16.123 +/**
  16.124 + * Free the given xen_host_metrics_record_set, and all referenced
  16.125 + * values.  The given set must have been allocated by this library.
  16.126 + */
  16.127 +extern void
  16.128 +xen_host_metrics_record_set_free(xen_host_metrics_record_set *set);
  16.129 +
  16.130 +
  16.131 +
  16.132 +typedef struct xen_host_metrics_record_opt_set
  16.133 +{
  16.134 +    size_t size;
  16.135 +    xen_host_metrics_record_opt *contents[];
  16.136 +} xen_host_metrics_record_opt_set;
  16.137 +
  16.138 +/**
  16.139 + * Allocate a xen_host_metrics_record_opt_set of the given size.
  16.140 + */
  16.141 +extern xen_host_metrics_record_opt_set *
  16.142 +xen_host_metrics_record_opt_set_alloc(size_t size);
  16.143 +
  16.144 +/**
  16.145 + * Free the given xen_host_metrics_record_opt_set, and all referenced
  16.146 + * values.  The given set must have been allocated by this library.
  16.147 + */
  16.148 +extern void
  16.149 +xen_host_metrics_record_opt_set_free(xen_host_metrics_record_opt_set *set);
  16.150 +
  16.151 +
  16.152 +/**
  16.153 + * Get a record containing the current state of the given host_metrics.
  16.154 + */
  16.155 +extern bool
  16.156 +xen_host_metrics_get_record(xen_session *session, xen_host_metrics_record **result, xen_host_metrics host_metrics);
  16.157 +
  16.158 +
  16.159 +/**
  16.160 + * Get a reference to the host_metrics instance with the specified
  16.161 + * UUID.
  16.162 + */
  16.163 +extern bool
  16.164 +xen_host_metrics_get_by_uuid(xen_session *session, xen_host_metrics *result, char *uuid);
  16.165 +
  16.166 +
  16.167 +/**
  16.168 + * Get the uuid field of the given host_metrics.
  16.169 + */
  16.170 +extern bool
  16.171 +xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics);
  16.172 +
  16.173 +
  16.174 +/**
  16.175 + * Get the memory/total field of the given host_metrics.
  16.176 + */
  16.177 +extern bool
  16.178 +xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
  16.179 +
  16.180 +
  16.181 +/**
  16.182 + * Get the memory/free field of the given host_metrics.
  16.183 + */
  16.184 +extern bool
  16.185 +xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
  16.186 +
  16.187 +
  16.188 +/**
  16.189 + * Get the last_updated field of the given host_metrics.
  16.190 + */
  16.191 +extern bool
  16.192 +xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics);
  16.193 +
  16.194 +
  16.195 +/**
  16.196 + * Return a list of all the host_metrics instances known to the system.
  16.197 + */
  16.198 +extern bool
  16.199 +xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result);
  16.200 +
  16.201 +
  16.202 +#endif
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tools/libxen/include/xen/api/xen_host_metrics_decl.h	Sat Apr 21 12:21:06 2007 -0700
    17.3 @@ -0,0 +1,30 @@
    17.4 +/*
    17.5 + * Copyright (c) 2006-2007, XenSource Inc.
    17.6 + *
    17.7 + * This library is free software; you can redistribute it and/or
    17.8 + * modify it under the terms of the GNU Lesser General Public
    17.9 + * License as published by the Free Software Foundation; either
   17.10 + * version 2.1 of the License, or (at your option) any later version.
   17.11 + *
   17.12 + * This library is distributed in the hope that it will be useful,
   17.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   17.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   17.15 + * Lesser General Public License for more details.
   17.16 + *
   17.17 + * You should have received a copy of the GNU Lesser General Public
   17.18 + * License along with this library; if not, write to the Free Software
   17.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   17.20 + */
   17.21 +
   17.22 +#ifndef XEN_HOST_METRICS_DECL_H
   17.23 +#define XEN_HOST_METRICS_DECL_H
   17.24 +
   17.25 +typedef void *xen_host_metrics;
   17.26 +
   17.27 +struct xen_host_metrics_set;
   17.28 +struct xen_host_metrics_record;
   17.29 +struct xen_host_metrics_record_set;
   17.30 +struct xen_host_metrics_record_opt;
   17.31 +struct xen_host_metrics_record_opt_set;
   17.32 +
   17.33 +#endif
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tools/libxen/include/xen/api/xen_int_float_map.h	Sat Apr 21 12:21:06 2007 -0700
    18.3 @@ -0,0 +1,53 @@
    18.4 +/*
    18.5 + * Copyright (c) 2006-2007, XenSource Inc.
    18.6 + *
    18.7 + * This library is free software; you can redistribute it and/or
    18.8 + * modify it under the terms of the GNU Lesser General Public
    18.9 + * License as published by the Free Software Foundation; either
   18.10 + * version 2.1 of the License, or (at your option) any later version.
   18.11 + *
   18.12 + * This library is distributed in the hope that it will be useful,
   18.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18.15 + * Lesser General Public License for more details.
   18.16 + *
   18.17 + * You should have received a copy of the GNU Lesser General Public
   18.18 + * License along with this library; if not, write to the Free Software
   18.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   18.20 + */
   18.21 +
   18.22 +#ifndef XEN_INT_FLOAT_MAP_H
   18.23 +#define XEN_INT_FLOAT_MAP_H
   18.24 +
   18.25 +
   18.26 +#include <xen/api/xen_common.h>
   18.27 +
   18.28 +
   18.29 +typedef struct xen_int_float_map_contents
   18.30 +{
   18.31 +  int64_t key;
   18.32 +  double val;
   18.33 +} xen_int_float_map_contents;
   18.34 +
   18.35 +
   18.36 +typedef struct xen_int_float_map
   18.37 +{
   18.38 +    size_t size;
   18.39 +    xen_int_float_map_contents contents[];
   18.40 +} xen_int_float_map;
   18.41 +
   18.42 +/**
   18.43 + * Allocate a xen_int_float_map of the given size.
   18.44 + */
   18.45 +extern xen_int_float_map *
   18.46 +xen_int_float_map_alloc(size_t size);
   18.47 +
   18.48 +/**
   18.49 + * Free the given xen_int_float_map, and all referenced values.  The
   18.50 + * given map must have been allocated by this library.
   18.51 + */
   18.52 +extern void
   18.53 +xen_int_float_map_free(xen_int_float_map *map);
   18.54 +
   18.55 +
   18.56 +#endif
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tools/libxen/include/xen/api/xen_int_int_map.h	Sat Apr 21 12:21:06 2007 -0700
    19.3 @@ -0,0 +1,53 @@
    19.4 +/*
    19.5 + * Copyright (c) 2006-2007, XenSource Inc.
    19.6 + *
    19.7 + * This library is free software; you can redistribute it and/or
    19.8 + * modify it under the terms of the GNU Lesser General Public
    19.9 + * License as published by the Free Software Foundation; either
   19.10 + * version 2.1 of the License, or (at your option) any later version.
   19.11 + *
   19.12 + * This library is distributed in the hope that it will be useful,
   19.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   19.15 + * Lesser General Public License for more details.
   19.16 + *
   19.17 + * You should have received a copy of the GNU Lesser General Public
   19.18 + * License along with this library; if not, write to the Free Software
   19.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   19.20 + */
   19.21 +
   19.22 +#ifndef XEN_INT_INT_MAP_H
   19.23 +#define XEN_INT_INT_MAP_H
   19.24 +
   19.25 +
   19.26 +#include <xen/api/xen_common.h>
   19.27 +
   19.28 +
   19.29 +typedef struct xen_int_int_map_contents
   19.30 +{
   19.31 +  int64_t key;
   19.32 +  int64_t val;
   19.33 +} xen_int_int_map_contents;
   19.34 +
   19.35 +
   19.36 +typedef struct xen_int_int_map
   19.37 +{
   19.38 +    size_t size;
   19.39 +    xen_int_int_map_contents contents[];
   19.40 +} xen_int_int_map;
   19.41 +
   19.42 +/**
   19.43 + * Allocate a xen_int_int_map of the given size.
   19.44 + */
   19.45 +extern xen_int_int_map *
   19.46 +xen_int_int_map_alloc(size_t size);
   19.47 +
   19.48 +/**
   19.49 + * Free the given xen_int_int_map, and all referenced values.  The
   19.50 + * given map must have been allocated by this library.
   19.51 + */
   19.52 +extern void
   19.53 +xen_int_int_map_free(xen_int_int_map *map);
   19.54 +
   19.55 +
   19.56 +#endif
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tools/libxen/include/xen/api/xen_int_string_set_map.h	Sat Apr 21 12:21:06 2007 -0700
    20.3 @@ -0,0 +1,53 @@
    20.4 +/*
    20.5 + * Copyright (c) 2006-2007, XenSource Inc.
    20.6 + *
    20.7 + * This library is free software; you can redistribute it and/or
    20.8 + * modify it under the terms of the GNU Lesser General Public
    20.9 + * License as published by the Free Software Foundation; either
   20.10 + * version 2.1 of the License, or (at your option) any later version.
   20.11 + *
   20.12 + * This library is distributed in the hope that it will be useful,
   20.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20.15 + * Lesser General Public License for more details.
   20.16 + *
   20.17 + * You should have received a copy of the GNU Lesser General Public
   20.18 + * License along with this library; if not, write to the Free Software
   20.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   20.20 + */
   20.21 +
   20.22 +#ifndef XEN_INT_STRING_SET_MAP_H
   20.23 +#define XEN_INT_STRING_SET_MAP_H
   20.24 +
   20.25 +
   20.26 +#include <xen/api/xen_common.h>
   20.27 +
   20.28 +
   20.29 +typedef struct xen_int_string_set_map_contents
   20.30 +{
   20.31 +  int64_t key;
   20.32 +  struct xen_string_set *val;
   20.33 +} xen_int_string_set_map_contents;
   20.34 +
   20.35 +
   20.36 +typedef struct xen_int_string_set_map
   20.37 +{
   20.38 +    size_t size;
   20.39 +    xen_int_string_set_map_contents contents[];
   20.40 +} xen_int_string_set_map;
   20.41 +
   20.42 +/**
   20.43 + * Allocate a xen_int_string_set_map of the given size.
   20.44 + */
   20.45 +extern xen_int_string_set_map *
   20.46 +xen_int_string_set_map_alloc(size_t size);
   20.47 +
   20.48 +/**
   20.49 + * Free the given xen_int_string_set_map, and all referenced values. 
   20.50 + * The given map must have been allocated by this library.
   20.51 + */
   20.52 +extern void
   20.53 +xen_int_string_set_map_free(xen_int_string_set_map *map);
   20.54 +
   20.55 +
   20.56 +#endif
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tools/libxen/include/xen/api/xen_network.h	Sat Apr 21 12:21:06 2007 -0700
    21.3 @@ -0,0 +1,276 @@
    21.4 +/*
    21.5 + * Copyright (c) 2006-2007, XenSource Inc.
    21.6 + *
    21.7 + * This library is free software; you can redistribute it and/or
    21.8 + * modify it under the terms of the GNU Lesser General Public
    21.9 + * License as published by the Free Software Foundation; either
   21.10 + * version 2.1 of the License, or (at your option) any later version.
   21.11 + *
   21.12 + * This library is distributed in the hope that it will be useful,
   21.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   21.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   21.15 + * Lesser General Public License for more details.
   21.16 + *
   21.17 + * You should have received a copy of the GNU Lesser General Public
   21.18 + * License along with this library; if not, write to the Free Software
   21.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   21.20 + */
   21.21 +
   21.22 +#ifndef XEN_NETWORK_H
   21.23 +#define XEN_NETWORK_H
   21.24 +
   21.25 +#include <xen/api/xen_common.h>
   21.26 +#include <xen/api/xen_network_decl.h>
   21.27 +#include <xen/api/xen_pif_decl.h>
   21.28 +#include <xen/api/xen_string_string_map.h>
   21.29 +#include <xen/api/xen_vif_decl.h>
   21.30 +
   21.31 +
   21.32 +/*
   21.33 + * The network class.
   21.34 + * 
   21.35 + * A virtual network.
   21.36 + */
   21.37 +
   21.38 +
   21.39 +/**
   21.40 + * Free the given xen_network.  The given handle must have been
   21.41 + * allocated by this library.
   21.42 + */
   21.43 +extern void
   21.44 +xen_network_free(xen_network network);
   21.45 +
   21.46 +
   21.47 +typedef struct xen_network_set
   21.48 +{
   21.49 +    size_t size;
   21.50 +    xen_network *contents[];
   21.51 +} xen_network_set;
   21.52 +
   21.53 +/**
   21.54 + * Allocate a xen_network_set of the given size.
   21.55 + */
   21.56 +extern xen_network_set *
   21.57 +xen_network_set_alloc(size_t size);
   21.58 +
   21.59 +/**
   21.60 + * Free the given xen_network_set.  The given set must have been
   21.61 + * allocated by this library.
   21.62 + */
   21.63 +extern void
   21.64 +xen_network_set_free(xen_network_set *set);
   21.65 +
   21.66 +
   21.67 +typedef struct xen_network_record
   21.68 +{
   21.69 +    xen_network handle;
   21.70 +    char *uuid;
   21.71 +    char *name_label;
   21.72 +    char *name_description;
   21.73 +    struct xen_vif_record_opt_set *vifs;
   21.74 +    struct xen_pif_record_opt_set *pifs;
   21.75 +    xen_string_string_map *other_config;
   21.76 +} xen_network_record;
   21.77 +
   21.78 +/**
   21.79 + * Allocate a xen_network_record.
   21.80 + */
   21.81 +extern xen_network_record *
   21.82 +xen_network_record_alloc(void);
   21.83 +
   21.84 +/**
   21.85 + * Free the given xen_network_record, and all referenced values.  The
   21.86 + * given record must have been allocated by this library.
   21.87 + */
   21.88 +extern void
   21.89 +xen_network_record_free(xen_network_record *record);
   21.90 +
   21.91 +
   21.92 +typedef struct xen_network_record_opt
   21.93 +{
   21.94 +    bool is_record;
   21.95 +    union
   21.96 +    {
   21.97 +        xen_network handle;
   21.98 +        xen_network_record *record;
   21.99 +    } u;
  21.100 +} xen_network_record_opt;
  21.101 +
  21.102 +/**
  21.103 + * Allocate a xen_network_record_opt.
  21.104 + */
  21.105 +extern xen_network_record_opt *
  21.106 +xen_network_record_opt_alloc(void);
  21.107 +
  21.108 +/**
  21.109 + * Free the given xen_network_record_opt, and all referenced values. 
  21.110 + * The given record_opt must have been allocated by this library.
  21.111 + */
  21.112 +extern void
  21.113 +xen_network_record_opt_free(xen_network_record_opt *record_opt);
  21.114 +
  21.115 +
  21.116 +typedef struct xen_network_record_set
  21.117 +{
  21.118 +    size_t size;
  21.119 +    xen_network_record *contents[];
  21.120 +} xen_network_record_set;
  21.121 +
  21.122 +/**
  21.123 + * Allocate a xen_network_record_set of the given size.
  21.124 + */
  21.125 +extern xen_network_record_set *
  21.126 +xen_network_record_set_alloc(size_t size);
  21.127 +
  21.128 +/**
  21.129 + * Free the given xen_network_record_set, and all referenced values. 
  21.130 + * The given set must have been allocated by this library.
  21.131 + */
  21.132 +extern void
  21.133 +xen_network_record_set_free(xen_network_record_set *set);
  21.134 +
  21.135 +
  21.136 +
  21.137 +typedef struct xen_network_record_opt_set
  21.138 +{
  21.139 +    size_t size;
  21.140 +    xen_network_record_opt *contents[];
  21.141 +} xen_network_record_opt_set;
  21.142 +
  21.143 +/**
  21.144 + * Allocate a xen_network_record_opt_set of the given size.
  21.145 + */
  21.146 +extern xen_network_record_opt_set *
  21.147 +xen_network_record_opt_set_alloc(size_t size);
  21.148 +
  21.149 +/**
  21.150 + * Free the given xen_network_record_opt_set, and all referenced
  21.151 + * values.  The given set must have been allocated by this library.
  21.152 + */
  21.153 +extern void
  21.154 +xen_network_record_opt_set_free(xen_network_record_opt_set *set);
  21.155 +
  21.156 +
  21.157 +/**
  21.158 + * Get a record containing the current state of the given network.
  21.159 + */
  21.160 +extern bool
  21.161 +xen_network_get_record(xen_session *session, xen_network_record **result, xen_network network);
  21.162 +
  21.163 +
  21.164 +/**
  21.165 + * Get a reference to the network instance with the specified UUID.
  21.166 + */
  21.167 +extern bool
  21.168 +xen_network_get_by_uuid(xen_session *session, xen_network *result, char *uuid);
  21.169 +
  21.170 +
  21.171 +/**
  21.172 + * Create a new network instance, and return its handle.
  21.173 + */
  21.174 +extern bool
  21.175 +xen_network_create(xen_session *session, xen_network *result, xen_network_record *record);
  21.176 +
  21.177 +
  21.178 +/**
  21.179 + * Destroy the specified network instance.
  21.180 + */
  21.181 +extern bool
  21.182 +xen_network_destroy(xen_session *session, xen_network network);
  21.183 +
  21.184 +
  21.185 +/**
  21.186 + * Get all the network instances with the given label.
  21.187 + */
  21.188 +extern bool
  21.189 +xen_network_get_by_name_label(xen_session *session, struct xen_network_set **result, char *label);
  21.190 +
  21.191 +
  21.192 +/**
  21.193 + * Get the uuid field of the given network.
  21.194 + */
  21.195 +extern bool
  21.196 +xen_network_get_uuid(xen_session *session, char **result, xen_network network);
  21.197 +
  21.198 +
  21.199 +/**
  21.200 + * Get the name/label field of the given network.
  21.201 + */
  21.202 +extern bool
  21.203 +xen_network_get_name_label(xen_session *session, char **result, xen_network network);
  21.204 +
  21.205 +
  21.206 +/**
  21.207 + * Get the name/description field of the given network.
  21.208 + */
  21.209 +extern bool
  21.210 +xen_network_get_name_description(xen_session *session, char **result, xen_network network);
  21.211 +
  21.212 +
  21.213 +/**
  21.214 + * Get the VIFs field of the given network.
  21.215 + */
  21.216 +extern bool
  21.217 +xen_network_get_vifs(xen_session *session, struct xen_vif_set **result, xen_network network);
  21.218 +
  21.219 +
  21.220 +/**
  21.221 + * Get the PIFs field of the given network.
  21.222 + */
  21.223 +extern bool
  21.224 +xen_network_get_pifs(xen_session *session, struct xen_pif_set **result, xen_network network);
  21.225 +
  21.226 +
  21.227 +/**
  21.228 + * Get the other_config field of the given network.
  21.229 + */
  21.230 +extern bool
  21.231 +xen_network_get_other_config(xen_session *session, xen_string_string_map **result, xen_network network);
  21.232 +
  21.233 +
  21.234 +/**
  21.235 + * Set the name/label field of the given network.
  21.236 + */
  21.237 +extern bool
  21.238 +xen_network_set_name_label(xen_session *session, xen_network network, char *label);
  21.239 +
  21.240 +
  21.241 +/**
  21.242 + * Set the name/description field of the given network.
  21.243 + */
  21.244 +extern bool
  21.245 +xen_network_set_name_description(xen_session *session, xen_network network, char *description);
  21.246 +
  21.247 +
  21.248 +/**
  21.249 + * Set the other_config field of the given network.
  21.250 + */
  21.251 +extern bool
  21.252 +xen_network_set_other_config(xen_session *session, xen_network network, xen_string_string_map *other_config);
  21.253 +
  21.254 +
  21.255 +/**
  21.256 + * Add the given key-value pair to the other_config field of the given
  21.257 + * network.
  21.258 + */
  21.259 +extern bool
  21.260 +xen_network_add_to_other_config(xen_session *session, xen_network network, char *key, char *value);
  21.261 +
  21.262 +
  21.263 +/**
  21.264 + * Remove the given key and its corresponding value from the
  21.265 + * other_config field of the given network.  If the key is not in that Map,
  21.266 + * then do nothing.
  21.267 + */
  21.268 +extern bool
  21.269 +xen_network_remove_from_other_config(xen_session *session, xen_network network, char *key);
  21.270 +
  21.271 +
  21.272 +/**
  21.273 + * Return a list of all the networks known to the system.
  21.274 + */
  21.275 +extern bool
  21.276 +xen_network_get_all(xen_session *session, struct xen_network_set **result);
  21.277 +
  21.278 +
  21.279 +#endif
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/tools/libxen/include/xen/api/xen_network_decl.h	Sat Apr 21 12:21:06 2007 -0700
    22.3 @@ -0,0 +1,30 @@
    22.4 +/*
    22.5 + * Copyright (c) 2006-2007, XenSource Inc.
    22.6 + *
    22.7 + * This library is free software; you can redistribute it and/or
    22.8 + * modify it under the terms of the GNU Lesser General Public
    22.9 + * License as published by the Free Software Foundation; either
   22.10 + * version 2.1 of the License, or (at your option) any later version.
   22.11 + *
   22.12 + * This library is distributed in the hope that it will be useful,
   22.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   22.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   22.15 + * Lesser General Public License for more details.
   22.16 + *
   22.17 + * You should have received a copy of the GNU Lesser General Public
   22.18 + * License along with this library; if not, write to the Free Software
   22.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   22.20 + */
   22.21 +
   22.22 +#ifndef XEN_NETWORK_DECL_H
   22.23 +#define XEN_NETWORK_DECL_H
   22.24 +
   22.25 +typedef void *xen_network;
   22.26 +
   22.27 +struct xen_network_set;
   22.28 +struct xen_network_record;
   22.29 +struct xen_network_record_set;
   22.30 +struct xen_network_record_opt;
   22.31 +struct xen_network_record_opt_set;
   22.32 +
   22.33 +#endif
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tools/libxen/include/xen/api/xen_on_crash_behaviour.h	Sat Apr 21 12:21:06 2007 -0700
    23.3 @@ -0,0 +1,97 @@
    23.4 +/*
    23.5 + * Copyright (c) 2006-2007, XenSource Inc.
    23.6 + *
    23.7 + * This library is free software; you can redistribute it and/or
    23.8 + * modify it under the terms of the GNU Lesser General Public
    23.9 + * License as published by the Free Software Foundation; either
   23.10 + * version 2.1 of the License, or (at your option) any later version.
   23.11 + *
   23.12 + * This library is distributed in the hope that it will be useful,
   23.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   23.15 + * Lesser General Public License for more details.
   23.16 + *
   23.17 + * You should have received a copy of the GNU Lesser General Public
   23.18 + * License along with this library; if not, write to the Free Software
   23.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   23.20 + */
   23.21 +
   23.22 +#ifndef XEN_ON_CRASH_BEHAVIOUR_H
   23.23 +#define XEN_ON_CRASH_BEHAVIOUR_H
   23.24 +
   23.25 +
   23.26 +#include <xen/api/xen_common.h>
   23.27 +
   23.28 +
   23.29 +enum xen_on_crash_behaviour
   23.30 +{
   23.31 +    /**
   23.32 +     * destroy the VM state
   23.33 +     */
   23.34 +    XEN_ON_CRASH_BEHAVIOUR_DESTROY,
   23.35 +
   23.36 +    /**
   23.37 +     * record a coredump and then destroy the VM state
   23.38 +     */
   23.39 +    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_DESTROY,
   23.40 +
   23.41 +    /**
   23.42 +     * restart the VM
   23.43 +     */
   23.44 +    XEN_ON_CRASH_BEHAVIOUR_RESTART,
   23.45 +
   23.46 +    /**
   23.47 +     * record a coredump and then restart the VM
   23.48 +     */
   23.49 +    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_RESTART,
   23.50 +
   23.51 +    /**
   23.52 +     * leave the crashed VM as-is
   23.53 +     */
   23.54 +    XEN_ON_CRASH_BEHAVIOUR_PRESERVE,
   23.55 +
   23.56 +    /**
   23.57 +     * rename the crashed VM and start a new copy
   23.58 +     */
   23.59 +    XEN_ON_CRASH_BEHAVIOUR_RENAME_RESTART
   23.60 +};
   23.61 +
   23.62 +
   23.63 +typedef struct xen_on_crash_behaviour_set
   23.64 +{
   23.65 +    size_t size;
   23.66 +    enum xen_on_crash_behaviour contents[];
   23.67 +} xen_on_crash_behaviour_set;
   23.68 +
   23.69 +/**
   23.70 + * Allocate a xen_on_crash_behaviour_set of the given size.
   23.71 + */
   23.72 +extern xen_on_crash_behaviour_set *
   23.73 +xen_on_crash_behaviour_set_alloc(size_t size);
   23.74 +
   23.75 +/**
   23.76 + * Free the given xen_on_crash_behaviour_set.  The given set must have
   23.77 + * been allocated by this library.
   23.78 + */
   23.79 +extern void
   23.80 +xen_on_crash_behaviour_set_free(xen_on_crash_behaviour_set *set);
   23.81 +
   23.82 +
   23.83 +/**
   23.84 + * Return the name corresponding to the given code.  This string must
   23.85 + * not be modified or freed.
   23.86 + */
   23.87 +extern const char *
   23.88 +xen_on_crash_behaviour_to_string(enum xen_on_crash_behaviour val);
   23.89 +
   23.90 +
   23.91 +/**
   23.92 + * Return the correct code for the given string, or set the session
   23.93 + * object to failure and return an undefined value if the given string does
   23.94 + * not match a known code.
   23.95 + */
   23.96 +extern enum xen_on_crash_behaviour
   23.97 +xen_on_crash_behaviour_from_string(xen_session *session, const char *str);
   23.98 +
   23.99 +
  23.100 +#endif
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/tools/libxen/include/xen/api/xen_on_normal_exit.h	Sat Apr 21 12:21:06 2007 -0700
    24.3 @@ -0,0 +1,77 @@
    24.4 +/*
    24.5 + * Copyright (c) 2006-2007, XenSource Inc.
    24.6 + *
    24.7 + * This library is free software; you can redistribute it and/or
    24.8 + * modify it under the terms of the GNU Lesser General Public
    24.9 + * License as published by the Free Software Foundation; either
   24.10 + * version 2.1 of the License, or (at your option) any later version.
   24.11 + *
   24.12 + * This library is distributed in the hope that it will be useful,
   24.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   24.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   24.15 + * Lesser General Public License for more details.
   24.16 + *
   24.17 + * You should have received a copy of the GNU Lesser General Public
   24.18 + * License along with this library; if not, write to the Free Software
   24.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   24.20 + */
   24.21 +
   24.22 +#ifndef XEN_ON_NORMAL_EXIT_H
   24.23 +#define XEN_ON_NORMAL_EXIT_H
   24.24 +
   24.25 +
   24.26 +#include <xen/api/xen_common.h>
   24.27 +
   24.28 +
   24.29 +enum xen_on_normal_exit
   24.30 +{
   24.31 +    /**
   24.32 +     * destroy the VM state
   24.33 +     */
   24.34 +    XEN_ON_NORMAL_EXIT_DESTROY,
   24.35 +
   24.36 +    /**
   24.37 +     * restart the VM
   24.38 +     */
   24.39 +    XEN_ON_NORMAL_EXIT_RESTART
   24.40 +};
   24.41 +
   24.42 +
   24.43 +typedef struct xen_on_normal_exit_set
   24.44 +{
   24.45 +    size_t size;
   24.46 +    enum xen_on_normal_exit contents[];
   24.47 +} xen_on_normal_exit_set;
   24.48 +
   24.49 +/**
   24.50 + * Allocate a xen_on_normal_exit_set of the given size.
   24.51 + */
   24.52 +extern xen_on_normal_exit_set *
   24.53 +xen_on_normal_exit_set_alloc(size_t size);
   24.54 +
   24.55 +/**
   24.56 + * Free the given xen_on_normal_exit_set.  The given set must have been
   24.57 + * allocated by this library.
   24.58 + */
   24.59 +extern void
   24.60 +xen_on_normal_exit_set_free(xen_on_normal_exit_set *set);
   24.61 +
   24.62 +
   24.63 +/**
   24.64 + * Return the name corresponding to the given code.  This string must
   24.65 + * not be modified or freed.
   24.66 + */
   24.67 +extern const char *
   24.68 +xen_on_normal_exit_to_string(enum xen_on_normal_exit val);
   24.69 +
   24.70 +
   24.71 +/**
   24.72 + * Return the correct code for the given string, or set the session
   24.73 + * object to failure and return an undefined value if the given string does
   24.74 + * not match a known code.
   24.75 + */
   24.76 +extern enum xen_on_normal_exit
   24.77 +xen_on_normal_exit_from_string(xen_session *session, const char *str);
   24.78 +
   24.79 +
   24.80 +#endif
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/tools/libxen/include/xen/api/xen_pbd.h	Sat Apr 21 12:21:06 2007 -0700
    25.3 @@ -0,0 +1,223 @@
    25.4 +/*
    25.5 + * Copyright (c) 2006-2007, XenSource Inc.
    25.6 + *
    25.7 + * This library is free software; you can redistribute it and/or
    25.8 + * modify it under the terms of the GNU Lesser General Public
    25.9 + * License as published by the Free Software Foundation; either
   25.10 + * version 2.1 of the License, or (at your option) any later version.
   25.11 + *
   25.12 + * This library is distributed in the hope that it will be useful,
   25.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   25.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   25.15 + * Lesser General Public License for more details.
   25.16 + *
   25.17 + * You should have received a copy of the GNU Lesser General Public
   25.18 + * License along with this library; if not, write to the Free Software
   25.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   25.20 + */
   25.21 +
   25.22 +#ifndef XEN_PBD_H
   25.23 +#define XEN_PBD_H
   25.24 +
   25.25 +#include <xen/api/xen_common.h>
   25.26 +#include <xen/api/xen_host_decl.h>
   25.27 +#include <xen/api/xen_pbd_decl.h>
   25.28 +#include <xen/api/xen_sr_decl.h>
   25.29 +#include <xen/api/xen_string_string_map.h>
   25.30 +
   25.31 +
   25.32 +/*
   25.33 + * The PBD class.
   25.34 + * 
   25.35 + * The physical block devices through which hosts access SRs.
   25.36 + */
   25.37 +
   25.38 +
   25.39 +/**
   25.40 + * Free the given xen_pbd.  The given handle must have been allocated
   25.41 + * by this library.
   25.42 + */
   25.43 +extern void
   25.44 +xen_pbd_free(xen_pbd pbd);
   25.45 +
   25.46 +
   25.47 +typedef struct xen_pbd_set
   25.48 +{
   25.49 +    size_t size;
   25.50 +    xen_pbd *contents[];
   25.51 +} xen_pbd_set;
   25.52 +
   25.53 +/**
   25.54 + * Allocate a xen_pbd_set of the given size.
   25.55 + */
   25.56 +extern xen_pbd_set *
   25.57 +xen_pbd_set_alloc(size_t size);
   25.58 +
   25.59 +/**
   25.60 + * Free the given xen_pbd_set.  The given set must have been allocated
   25.61 + * by this library.
   25.62 + */
   25.63 +extern void
   25.64 +xen_pbd_set_free(xen_pbd_set *set);
   25.65 +
   25.66 +
   25.67 +typedef struct xen_pbd_record
   25.68 +{
   25.69 +    xen_pbd handle;
   25.70 +    char *uuid;
   25.71 +    struct xen_host_record_opt *host;
   25.72 +    struct xen_sr_record_opt *sr;
   25.73 +    xen_string_string_map *device_config;
   25.74 +    bool currently_attached;
   25.75 +} xen_pbd_record;
   25.76 +
   25.77 +/**
   25.78 + * Allocate a xen_pbd_record.
   25.79 + */
   25.80 +extern xen_pbd_record *
   25.81 +xen_pbd_record_alloc(void);
   25.82 +
   25.83 +/**
   25.84 + * Free the given xen_pbd_record, and all referenced values.  The given
   25.85 + * record must have been allocated by this library.
   25.86 + */
   25.87 +extern void
   25.88 +xen_pbd_record_free(xen_pbd_record *record);
   25.89 +
   25.90 +
   25.91 +typedef struct xen_pbd_record_opt
   25.92 +{
   25.93 +    bool is_record;
   25.94 +    union
   25.95 +    {
   25.96 +        xen_pbd handle;
   25.97 +        xen_pbd_record *record;
   25.98 +    } u;
   25.99 +} xen_pbd_record_opt;
  25.100 +
  25.101 +/**
  25.102 + * Allocate a xen_pbd_record_opt.
  25.103 + */
  25.104 +extern xen_pbd_record_opt *
  25.105 +xen_pbd_record_opt_alloc(void);
  25.106 +
  25.107 +/**
  25.108 + * Free the given xen_pbd_record_opt, and all referenced values.  The
  25.109 + * given record_opt must have been allocated by this library.
  25.110 + */
  25.111 +extern void
  25.112 +xen_pbd_record_opt_free(xen_pbd_record_opt *record_opt);
  25.113 +
  25.114 +
  25.115 +typedef struct xen_pbd_record_set
  25.116 +{
  25.117 +    size_t size;
  25.118 +    xen_pbd_record *contents[];
  25.119 +} xen_pbd_record_set;
  25.120 +
  25.121 +/**
  25.122 + * Allocate a xen_pbd_record_set of the given size.
  25.123 + */
  25.124 +extern xen_pbd_record_set *
  25.125 +xen_pbd_record_set_alloc(size_t size);
  25.126 +
  25.127 +/**
  25.128 + * Free the given xen_pbd_record_set, and all referenced values.  The
  25.129 + * given set must have been allocated by this library.
  25.130 + */
  25.131 +extern void
  25.132 +xen_pbd_record_set_free(xen_pbd_record_set *set);
  25.133 +
  25.134 +
  25.135 +
  25.136 +typedef struct xen_pbd_record_opt_set
  25.137 +{
  25.138 +    size_t size;
  25.139 +    xen_pbd_record_opt *contents[];
  25.140 +} xen_pbd_record_opt_set;
  25.141 +
  25.142 +/**
  25.143 + * Allocate a xen_pbd_record_opt_set of the given size.
  25.144 + */
  25.145 +extern xen_pbd_record_opt_set *
  25.146 +xen_pbd_record_opt_set_alloc(size_t size);
  25.147 +
  25.148 +/**
  25.149 + * Free the given xen_pbd_record_opt_set, and all referenced values. 
  25.150 + * The given set must have been allocated by this library.
  25.151 + */
  25.152 +extern void
  25.153 +xen_pbd_record_opt_set_free(xen_pbd_record_opt_set *set);
  25.154 +
  25.155 +
  25.156 +/**
  25.157 + * Get a record containing the current state of the given PBD.
  25.158 + */
  25.159 +extern bool
  25.160 +xen_pbd_get_record(xen_session *session, xen_pbd_record **result, xen_pbd pbd);
  25.161 +
  25.162 +
  25.163 +/**
  25.164 + * Get a reference to the PBD instance with the specified UUID.
  25.165 + */
  25.166 +extern bool
  25.167 +xen_pbd_get_by_uuid(xen_session *session, xen_pbd *result, char *uuid);
  25.168 +
  25.169 +
  25.170 +/**
  25.171 + * Create a new PBD instance, and return its handle.
  25.172 + */
  25.173 +extern bool
  25.174 +xen_pbd_create(xen_session *session, xen_pbd *result, xen_pbd_record *record);
  25.175 +
  25.176 +
  25.177 +/**
  25.178 + * Destroy the specified PBD instance.
  25.179 + */
  25.180 +extern bool
  25.181 +xen_pbd_destroy(xen_session *session, xen_pbd pbd);
  25.182 +
  25.183 +
  25.184 +/**
  25.185 + * Get the uuid field of the given PBD.
  25.186 + */
  25.187 +extern bool
  25.188 +xen_pbd_get_uuid(xen_session *session, char **result, xen_pbd pbd);
  25.189 +
  25.190 +
  25.191 +/**
  25.192 + * Get the host field of the given PBD.
  25.193 + */
  25.194 +extern bool
  25.195 +xen_pbd_get_host(xen_session *session, xen_host *result, xen_pbd pbd);
  25.196 +
  25.197 +
  25.198 +/**
  25.199 + * Get the SR field of the given PBD.
  25.200 + */
  25.201 +extern bool
  25.202 +xen_pbd_get_sr(xen_session *session, xen_sr *result, xen_pbd pbd);
  25.203 +
  25.204 +
  25.205 +/**
  25.206 + * Get the device_config field of the given PBD.
  25.207 + */
  25.208 +extern bool
  25.209 +xen_pbd_get_device_config(xen_session *session, xen_string_string_map **result, xen_pbd pbd);
  25.210 +
  25.211 +
  25.212 +/**
  25.213 + * Get the currently_attached field of the given PBD.
  25.214 + */
  25.215 +extern bool
  25.216 +xen_pbd_get_currently_attached(xen_session *session, bool *result, xen_pbd pbd);
  25.217 +
  25.218 +
  25.219 +/**
  25.220 + * Return a list of all the PBDs known to the system.
  25.221 + */
  25.222 +extern bool
  25.223 +xen_pbd_get_all(xen_session *session, struct xen_pbd_set **result);
  25.224 +
  25.225 +
  25.226 +#endif
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/tools/libxen/include/xen/api/xen_pbd_decl.h	Sat Apr 21 12:21:06 2007 -0700
    26.3 @@ -0,0 +1,30 @@
    26.4 +/*
    26.5 + * Copyright (c) 2006-2007, XenSource Inc.
    26.6 + *
    26.7 + * This library is free software; you can redistribute it and/or
    26.8 + * modify it under the terms of the GNU Lesser General Public
    26.9 + * License as published by the Free Software Foundation; either
   26.10 + * version 2.1 of the License, or (at your option) any later version.
   26.11 + *
   26.12 + * This library is distributed in the hope that it will be useful,
   26.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   26.15 + * Lesser General Public License for more details.
   26.16 + *
   26.17 + * You should have received a copy of the GNU Lesser General Public
   26.18 + * License along with this library; if not, write to the Free Software
   26.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   26.20 + */
   26.21 +
   26.22 +#ifndef XEN_PBD_DECL_H
   26.23 +#define XEN_PBD_DECL_H
   26.24 +
   26.25 +typedef void *xen_pbd;
   26.26 +
   26.27 +struct xen_pbd_set;
   26.28 +struct xen_pbd_record;
   26.29 +struct xen_pbd_record_set;
   26.30 +struct xen_pbd_record_opt;
   26.31 +struct xen_pbd_record_opt_set;
   26.32 +
   26.33 +#endif
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/tools/libxen/include/xen/api/xen_pif.h	Sat Apr 21 12:21:06 2007 -0700
    27.3 @@ -0,0 +1,277 @@
    27.4 +/*
    27.5 + * Copyright (c) 2006-2007, XenSource Inc.
    27.6 + *
    27.7 + * This library is free software; you can redistribute it and/or
    27.8 + * modify it under the terms of the GNU Lesser General Public
    27.9 + * License as published by the Free Software Foundation; either
   27.10 + * version 2.1 of the License, or (at your option) any later version.
   27.11 + *
   27.12 + * This library is distributed in the hope that it will be useful,
   27.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   27.15 + * Lesser General Public License for more details.
   27.16 + *
   27.17 + * You should have received a copy of the GNU Lesser General Public
   27.18 + * License along with this library; if not, write to the Free Software
   27.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   27.20 + */
   27.21 +
   27.22 +#ifndef XEN_PIF_H
   27.23 +#define XEN_PIF_H
   27.24 +
   27.25 +#include <xen/api/xen_common.h>
   27.26 +#include <xen/api/xen_host_decl.h>
   27.27 +#include <xen/api/xen_network_decl.h>
   27.28 +#include <xen/api/xen_pif_decl.h>
   27.29 +#include <xen/api/xen_pif_metrics_decl.h>
   27.30 +
   27.31 +
   27.32 +/*
   27.33 + * The PIF class.
   27.34 + * 
   27.35 + * A physical network interface (note separate VLANs are represented as
   27.36 + * several PIFs).
   27.37 + */
   27.38 +
   27.39 +
   27.40 +/**
   27.41 + * Free the given xen_pif.  The given handle must have been allocated
   27.42 + * by this library.
   27.43 + */
   27.44 +extern void
   27.45 +xen_pif_free(xen_pif pif);
   27.46 +
   27.47 +
   27.48 +typedef struct xen_pif_set
   27.49 +{
   27.50 +    size_t size;
   27.51 +    xen_pif *contents[];
   27.52 +} xen_pif_set;
   27.53 +
   27.54 +/**
   27.55 + * Allocate a xen_pif_set of the given size.
   27.56 + */
   27.57 +extern xen_pif_set *
   27.58 +xen_pif_set_alloc(size_t size);
   27.59 +
   27.60 +/**
   27.61 + * Free the given xen_pif_set.  The given set must have been allocated
   27.62 + * by this library.
   27.63 + */
   27.64 +extern void
   27.65 +xen_pif_set_free(xen_pif_set *set);
   27.66 +
   27.67 +
   27.68 +typedef struct xen_pif_record
   27.69 +{
   27.70 +    xen_pif handle;
   27.71 +    char *uuid;
   27.72 +    char *device;
   27.73 +    struct xen_network_record_opt *network;
   27.74 +    struct xen_host_record_opt *host;
   27.75 +    char *mac;
   27.76 +    int64_t mtu;
   27.77 +    int64_t vlan;
   27.78 +    struct xen_pif_metrics_record_opt *metrics;
   27.79 +} xen_pif_record;
   27.80 +
   27.81 +/**
   27.82 + * Allocate a xen_pif_record.
   27.83 + */
   27.84 +extern xen_pif_record *
   27.85 +xen_pif_record_alloc(void);
   27.86 +
   27.87 +/**
   27.88 + * Free the given xen_pif_record, and all referenced values.  The given
   27.89 + * record must have been allocated by this library.
   27.90 + */
   27.91 +extern void
   27.92 +xen_pif_record_free(xen_pif_record *record);
   27.93 +
   27.94 +
   27.95 +typedef struct xen_pif_record_opt
   27.96 +{
   27.97 +    bool is_record;
   27.98 +    union
   27.99 +    {
  27.100 +        xen_pif handle;
  27.101 +        xen_pif_record *record;
  27.102 +    } u;
  27.103 +} xen_pif_record_opt;
  27.104 +
  27.105 +/**
  27.106 + * Allocate a xen_pif_record_opt.
  27.107 + */
  27.108 +extern xen_pif_record_opt *
  27.109 +xen_pif_record_opt_alloc(void);
  27.110 +
  27.111 +/**
  27.112 + * Free the given xen_pif_record_opt, and all referenced values.  The
  27.113 + * given record_opt must have been allocated by this library.
  27.114 + */
  27.115 +extern void
  27.116 +xen_pif_record_opt_free(xen_pif_record_opt *record_opt);
  27.117 +
  27.118 +
  27.119 +typedef struct xen_pif_record_set
  27.120 +{
  27.121 +    size_t size;
  27.122 +    xen_pif_record *contents[];
  27.123 +} xen_pif_record_set;
  27.124 +
  27.125 +/**
  27.126 + * Allocate a xen_pif_record_set of the given size.
  27.127 + */
  27.128 +extern xen_pif_record_set *
  27.129 +xen_pif_record_set_alloc(size_t size);
  27.130 +
  27.131 +/**
  27.132 + * Free the given xen_pif_record_set, and all referenced values.  The
  27.133 + * given set must have been allocated by this library.
  27.134 + */
  27.135 +extern void
  27.136 +xen_pif_record_set_free(xen_pif_record_set *set);
  27.137 +
  27.138 +
  27.139 +
  27.140 +typedef struct xen_pif_record_opt_set
  27.141 +{
  27.142 +    size_t size;
  27.143 +    xen_pif_record_opt *contents[];
  27.144 +} xen_pif_record_opt_set;
  27.145 +
  27.146 +/**
  27.147 + * Allocate a xen_pif_record_opt_set of the given size.
  27.148 + */
  27.149 +extern xen_pif_record_opt_set *
  27.150 +xen_pif_record_opt_set_alloc(size_t size);
  27.151 +
  27.152 +/**
  27.153 + * Free the given xen_pif_record_opt_set, and all referenced values. 
  27.154 + * The given set must have been allocated by this library.
  27.155 + */
  27.156 +extern void
  27.157 +xen_pif_record_opt_set_free(xen_pif_record_opt_set *set);
  27.158 +
  27.159 +
  27.160 +/**
  27.161 + * Get a record containing the current state of the given PIF.
  27.162 + */
  27.163 +extern bool
  27.164 +xen_pif_get_record(xen_session *session, xen_pif_record **result, xen_pif pif);
  27.165 +
  27.166 +
  27.167 +/**
  27.168 + * Get a reference to the PIF instance with the specified UUID.
  27.169 + */
  27.170 +extern bool
  27.171 +xen_pif_get_by_uuid(xen_session *session, xen_pif *result, char *uuid);
  27.172 +
  27.173 +
  27.174 +/**
  27.175 + * Get the uuid field of the given PIF.
  27.176 + */
  27.177 +extern bool
  27.178 +xen_pif_get_uuid(xen_session *session, char **result, xen_pif pif);
  27.179 +
  27.180 +
  27.181 +/**
  27.182 + * Get the device field of the given PIF.
  27.183 + */
  27.184 +extern bool
  27.185 +xen_pif_get_device(xen_session *session, char **result, xen_pif pif);
  27.186 +
  27.187 +
  27.188 +/**
  27.189 + * Get the network field of the given PIF.
  27.190 + */
  27.191 +extern bool
  27.192 +xen_pif_get_network(xen_session *session, xen_network *result, xen_pif pif);
  27.193 +
  27.194 +
  27.195 +/**
  27.196 + * Get the host field of the given PIF.
  27.197 + */
  27.198 +extern bool
  27.199 +xen_pif_get_host(xen_session *session, xen_host *result, xen_pif pif);
  27.200 +
  27.201 +
  27.202 +/**
  27.203 + * Get the MAC field of the given PIF.
  27.204 + */
  27.205 +extern bool
  27.206 +xen_pif_get_mac(xen_session *session, char **result, xen_pif pif);
  27.207 +
  27.208 +
  27.209 +/**
  27.210 + * Get the MTU field of the given PIF.
  27.211 + */
  27.212 +extern bool
  27.213 +xen_pif_get_mtu(xen_session *session, int64_t *result, xen_pif pif);
  27.214 +
  27.215 +
  27.216 +/**
  27.217 + * Get the VLAN field of the given PIF.
  27.218 + */
  27.219 +extern bool
  27.220 +xen_pif_get_vlan(xen_session *session, int64_t *result, xen_pif pif);
  27.221 +
  27.222 +
  27.223 +/**
  27.224 + * Get the metrics field of the given PIF.
  27.225 + */
  27.226 +extern bool
  27.227 +xen_pif_get_metrics(xen_session *session, xen_pif_metrics *result, xen_pif pif);
  27.228 +
  27.229 +
  27.230 +/**
  27.231 + * Set the device field of the given PIF.
  27.232 + */
  27.233 +extern bool
  27.234 +xen_pif_set_device(xen_session *session, xen_pif pif, char *device);
  27.235 +
  27.236 +
  27.237 +/**
  27.238 + * Set the MAC field of the given PIF.
  27.239 + */
  27.240 +extern bool
  27.241 +xen_pif_set_mac(xen_session *session, xen_pif pif, char *mac);
  27.242 +
  27.243 +
  27.244 +/**
  27.245 + * Set the MTU field of the given PIF.
  27.246 + */
  27.247 +extern bool
  27.248 +xen_pif_set_mtu(xen_session *session, xen_pif pif, int64_t mtu);
  27.249 +
  27.250 +
  27.251 +/**
  27.252 + * Set the VLAN field of the given PIF.
  27.253 + */
  27.254 +extern bool
  27.255 +xen_pif_set_vlan(xen_session *session, xen_pif pif, int64_t vlan);
  27.256 +
  27.257 +
  27.258 +/**
  27.259 + * Create a VLAN interface from an existing physical interface.
  27.260 + */
  27.261 +extern bool
  27.262 +xen_pif_create_vlan(xen_session *session, xen_pif *result, char *device, xen_network network, xen_host host, int64_t vlan);
  27.263 +
  27.264 +
  27.265 +/**
  27.266 + * Destroy the interface (provided it is a synthetic interface like a
  27.267 + * VLAN; fail if it is a physical interface).
  27.268 + */
  27.269 +extern bool
  27.270 +xen_pif_destroy(xen_session *session, xen_pif self);
  27.271 +
  27.272 +
  27.273 +/**
  27.274 + * Return a list of all the PIFs known to the system.
  27.275 + */
  27.276 +extern bool
  27.277 +xen_pif_get_all(xen_session *session, struct xen_pif_set **result);
  27.278 +
  27.279 +
  27.280 +#endif
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/tools/libxen/include/xen/api/xen_pif_decl.h	Sat Apr 21 12:21:06 2007 -0700
    28.3 @@ -0,0 +1,30 @@
    28.4 +/*
    28.5 + * Copyright (c) 2006-2007, XenSource Inc.
    28.6 + *
    28.7 + * This library is free software; you can redistribute it and/or
    28.8 + * modify it under the terms of the GNU Lesser General Public
    28.9 + * License as published by the Free Software Foundation; either
   28.10 + * version 2.1 of the License, or (at your option) any later version.
   28.11 + *
   28.12 + * This library is distributed in the hope that it will be useful,
   28.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   28.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   28.15 + * Lesser General Public License for more details.
   28.16 + *
   28.17 + * You should have received a copy of the GNU Lesser General Public
   28.18 + * License along with this library; if not, write to the Free Software
   28.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   28.20 + */
   28.21 +
   28.22 +#ifndef XEN_PIF_DECL_H
   28.23 +#define XEN_PIF_DECL_H
   28.24 +
   28.25 +typedef void *xen_pif;
   28.26 +
   28.27 +struct xen_pif_set;
   28.28 +struct xen_pif_record;
   28.29 +struct xen_pif_record_set;
   28.30 +struct xen_pif_record_opt;
   28.31 +struct xen_pif_record_opt_set;
   28.32 +
   28.33 +#endif
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/tools/libxen/include/xen/api/xen_pif_metrics.h	Sat Apr 21 12:21:06 2007 -0700
    29.3 @@ -0,0 +1,198 @@
    29.4 +/*
    29.5 + * Copyright (c) 2006-2007, XenSource Inc.
    29.6 + *
    29.7 + * This library is free software; you can redistribute it and/or
    29.8 + * modify it under the terms of the GNU Lesser General Public
    29.9 + * License as published by the Free Software Foundation; either
   29.10 + * version 2.1 of the License, or (at your option) any later version.
   29.11 + *
   29.12 + * This library is distributed in the hope that it will be useful,
   29.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   29.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   29.15 + * Lesser General Public License for more details.
   29.16 + *
   29.17 + * You should have received a copy of the GNU Lesser General Public
   29.18 + * License along with this library; if not, write to the Free Software
   29.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   29.20 + */
   29.21 +
   29.22 +#ifndef XEN_PIF_METRICS_H
   29.23 +#define XEN_PIF_METRICS_H
   29.24 +
   29.25 +#include <xen/api/xen_common.h>
   29.26 +#include <xen/api/xen_pif_metrics_decl.h>
   29.27 +
   29.28 +
   29.29 +/*
   29.30 + * The PIF_metrics class.
   29.31 + * 
   29.32 + * The metrics associated with a physical network interface.
   29.33 + */
   29.34 +
   29.35 +
   29.36 +/**
   29.37 + * Free the given xen_pif_metrics.  The given handle must have been
   29.38 + * allocated by this library.
   29.39 + */
   29.40 +extern void
   29.41 +xen_pif_metrics_free(xen_pif_metrics pif_metrics);
   29.42 +
   29.43 +
   29.44 +typedef struct xen_pif_metrics_set
   29.45 +{
   29.46 +    size_t size;
   29.47 +    xen_pif_metrics *contents[];
   29.48 +} xen_pif_metrics_set;
   29.49 +
   29.50 +/**
   29.51 + * Allocate a xen_pif_metrics_set of the given size.
   29.52 + */
   29.53 +extern xen_pif_metrics_set *
   29.54 +xen_pif_metrics_set_alloc(size_t size);
   29.55 +
   29.56 +/**
   29.57 + * Free the given xen_pif_metrics_set.  The given set must have been
   29.58 + * allocated by this library.
   29.59 + */
   29.60 +extern void
   29.61 +xen_pif_metrics_set_free(xen_pif_metrics_set *set);
   29.62 +
   29.63 +
   29.64 +typedef struct xen_pif_metrics_record
   29.65 +{
   29.66 +    xen_pif_metrics handle;
   29.67 +    char *uuid;
   29.68 +    double io_read_kbs;
   29.69 +    double io_write_kbs;
   29.70 +    time_t last_updated;
   29.71 +} xen_pif_metrics_record;
   29.72 +
   29.73 +/**
   29.74 + * Allocate a xen_pif_metrics_record.
   29.75 + */
   29.76 +extern xen_pif_metrics_record *
   29.77 +xen_pif_metrics_record_alloc(void);
   29.78 +
   29.79 +/**
   29.80 + * Free the given xen_pif_metrics_record, and all referenced values. 
   29.81 + * The given record must have been allocated by this library.
   29.82 + */
   29.83 +extern void
   29.84 +xen_pif_metrics_record_free(xen_pif_metrics_record *record);
   29.85 +
   29.86 +
   29.87 +typedef struct xen_pif_metrics_record_opt
   29.88 +{
   29.89 +    bool is_record;
   29.90 +    union
   29.91 +    {
   29.92 +        xen_pif_metrics handle;
   29.93 +        xen_pif_metrics_record *record;
   29.94 +    } u;
   29.95 +} xen_pif_metrics_record_opt;
   29.96 +
   29.97 +/**
   29.98 + * Allocate a xen_pif_metrics_record_opt.
   29.99 + */
  29.100 +extern xen_pif_metrics_record_opt *
  29.101 +xen_pif_metrics_record_opt_alloc(void);
  29.102 +
  29.103 +/**
  29.104 + * Free the given xen_pif_metrics_record_opt, and all referenced
  29.105 + * values.  The given record_opt must have been allocated by this library.
  29.106 + */
  29.107 +extern void
  29.108 +xen_pif_metrics_record_opt_free(xen_pif_metrics_record_opt *record_opt);
  29.109 +
  29.110 +
  29.111 +typedef struct xen_pif_metrics_record_set
  29.112 +{
  29.113 +    size_t size;
  29.114 +    xen_pif_metrics_record *contents[];
  29.115 +} xen_pif_metrics_record_set;
  29.116 +
  29.117 +/**
  29.118 + * Allocate a xen_pif_metrics_record_set of the given size.
  29.119 + */
  29.120 +extern xen_pif_metrics_record_set *
  29.121 +xen_pif_metrics_record_set_alloc(size_t size);
  29.122 +
  29.123 +/**
  29.124 + * Free the given xen_pif_metrics_record_set, and all referenced
  29.125 + * values.  The given set must have been allocated by this library.
  29.126 + */
  29.127 +extern void
  29.128 +xen_pif_metrics_record_set_free(xen_pif_metrics_record_set *set);
  29.129 +
  29.130 +
  29.131 +
  29.132 +typedef struct xen_pif_metrics_record_opt_set
  29.133 +{
  29.134 +    size_t size;
  29.135 +    xen_pif_metrics_record_opt *contents[];
  29.136 +} xen_pif_metrics_record_opt_set;
  29.137 +
  29.138 +/**
  29.139 + * Allocate a xen_pif_metrics_record_opt_set of the given size.
  29.140 + */
  29.141 +extern xen_pif_metrics_record_opt_set *
  29.142 +xen_pif_metrics_record_opt_set_alloc(size_t size);
  29.143 +
  29.144 +/**
  29.145 + * Free the given xen_pif_metrics_record_opt_set, and all referenced
  29.146 + * values.  The given set must have been allocated by this library.
  29.147 + */
  29.148 +extern void
  29.149 +xen_pif_metrics_record_opt_set_free(xen_pif_metrics_record_opt_set *set);
  29.150 +
  29.151 +
  29.152 +/**
  29.153 + * Get a record containing the current state of the given PIF_metrics.
  29.154 + */
  29.155 +extern bool
  29.156 +xen_pif_metrics_get_record(xen_session *session, xen_pif_metrics_record **result, xen_pif_metrics pif_metrics);
  29.157 +
  29.158 +
  29.159 +/**
  29.160 + * Get a reference to the PIF_metrics instance with the specified UUID.
  29.161 + */
  29.162 +extern bool
  29.163 +xen_pif_metrics_get_by_uuid(xen_session *session, xen_pif_metrics *result, char *uuid);
  29.164 +
  29.165 +
  29.166 +/**
  29.167 + * Get the uuid field of the given PIF_metrics.
  29.168 + */
  29.169 +extern bool
  29.170 +xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics);
  29.171 +
  29.172 +
  29.173 +/**
  29.174 + * Get the io/read_kbs field of the given PIF_metrics.
  29.175 + */
  29.176 +extern bool
  29.177 +xen_pif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
  29.178 +
  29.179 +
  29.180 +/**
  29.181 + * Get the io/write_kbs field of the given PIF_metrics.
  29.182 + */
  29.183 +extern bool
  29.184 +xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
  29.185 +
  29.186 +
  29.187 +/**
  29.188 + * Get the last_updated field of the given PIF_metrics.
  29.189 + */
  29.190 +extern bool
  29.191 +xen_pif_metrics_get_last_updated(xen_session *session, time_t *result, xen_pif_metrics pif_metrics);
  29.192 +
  29.193 +
  29.194 +/**
  29.195 + * Return a list of all the PIF_metrics instances known to the system.
  29.196 + */
  29.197 +extern bool
  29.198 +xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result);
  29.199 +
  29.200 +
  29.201 +#endif
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/tools/libxen/include/xen/api/xen_pif_metrics_decl.h	Sat Apr 21 12:21:06 2007 -0700
    30.3 @@ -0,0 +1,30 @@
    30.4 +/*
    30.5 + * Copyright (c) 2006-2007, XenSource Inc.
    30.6 + *
    30.7 + * This library is free software; you can redistribute it and/or
    30.8 + * modify it under the terms of the GNU Lesser General Public
    30.9 + * License as published by the Free Software Foundation; either
   30.10 + * version 2.1 of the License, or (at your option) any later version.
   30.11 + *
   30.12 + * This library is distributed in the hope that it will be useful,
   30.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   30.15 + * Lesser General Public License for more details.
   30.16 + *
   30.17 + * You should have received a copy of the GNU Lesser General Public
   30.18 + * License along with this library; if not, write to the Free Software
   30.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   30.20 + */
   30.21 +
   30.22 +#ifndef XEN_PIF_METRICS_DECL_H
   30.23 +#define XEN_PIF_METRICS_DECL_H
   30.24 +
   30.25 +typedef void *xen_pif_metrics;
   30.26 +
   30.27 +struct xen_pif_metrics_set;
   30.28 +struct xen_pif_metrics_record;
   30.29 +struct xen_pif_metrics_record_set;
   30.30 +struct xen_pif_metrics_record_opt;
   30.31 +struct xen_pif_metrics_record_opt_set;
   30.32 +
   30.33 +#endif
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/tools/libxen/include/xen/api/xen_sr.h	Sat Apr 21 12:21:06 2007 -0700
    31.3 @@ -0,0 +1,277 @@
    31.4 +/*
    31.5 + * Copyright (c) 2006-2007, XenSource Inc.
    31.6 + *
    31.7 + * This library is free software; you can redistribute it and/or
    31.8 + * modify it under the terms of the GNU Lesser General Public
    31.9 + * License as published by the Free Software Foundation; either
   31.10 + * version 2.1 of the License, or (at your option) any later version.
   31.11 + *
   31.12 + * This library is distributed in the hope that it will be useful,
   31.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   31.15 + * Lesser General Public License for more details.
   31.16 + *
   31.17 + * You should have received a copy of the GNU Lesser General Public
   31.18 + * License along with this library; if not, write to the Free Software
   31.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   31.20 + */
   31.21 +
   31.22 +#ifndef XEN_SR_H
   31.23 +#define XEN_SR_H
   31.24 +
   31.25 +#include <xen/api/xen_common.h>
   31.26 +#include <xen/api/xen_pbd_decl.h>
   31.27 +#include <xen/api/xen_sr_decl.h>
   31.28 +#include <xen/api/xen_string_set.h>
   31.29 +#include <xen/api/xen_vdi_decl.h>
   31.30 +
   31.31 +
   31.32 +/*
   31.33 + * The SR class.
   31.34 + * 
   31.35 + * A storage repository.
   31.36 + */
   31.37 +
   31.38 +
   31.39 +/**
   31.40 + * Free the given xen_sr.  The given handle must have been allocated by
   31.41 + * this library.
   31.42 + */
   31.43 +extern void
   31.44 +xen_sr_free(xen_sr sr);
   31.45 +
   31.46 +
   31.47 +typedef struct xen_sr_set
   31.48 +{
   31.49 +    size_t size;
   31.50 +    xen_sr *contents[];
   31.51 +} xen_sr_set;
   31.52 +
   31.53 +/**
   31.54 + * Allocate a xen_sr_set of the given size.
   31.55 + */
   31.56 +extern xen_sr_set *
   31.57 +xen_sr_set_alloc(size_t size);
   31.58 +
   31.59 +/**
   31.60 + * Free the given xen_sr_set.  The given set must have been allocated
   31.61 + * by this library.
   31.62 + */
   31.63 +extern void
   31.64 +xen_sr_set_free(xen_sr_set *set);
   31.65 +
   31.66 +
   31.67 +typedef struct xen_sr_record
   31.68 +{
   31.69 +    xen_sr handle;
   31.70 +    char *uuid;
   31.71 +    char *name_label;
   31.72 +    char *name_description;
   31.73 +    struct xen_vdi_record_opt_set *vdis;
   31.74 +    struct xen_pbd_record_opt_set *pbds;
   31.75 +    int64_t virtual_allocation;
   31.76 +    int64_t physical_utilisation;
   31.77 +    int64_t physical_size;
   31.78 +    char *type;
   31.79 +    char *content_type;
   31.80 +} xen_sr_record;
   31.81 +
   31.82 +/**
   31.83 + * Allocate a xen_sr_record.
   31.84 + */
   31.85 +extern xen_sr_record *
   31.86 +xen_sr_record_alloc(void);
   31.87 +
   31.88 +/**
   31.89 + * Free the given xen_sr_record, and all referenced values.  The given
   31.90 + * record must have been allocated by this library.
   31.91 + */
   31.92 +extern void
   31.93 +xen_sr_record_free(xen_sr_record *record);
   31.94 +
   31.95 +
   31.96 +typedef struct xen_sr_record_opt
   31.97 +{
   31.98 +    bool is_record;
   31.99 +    union
  31.100 +    {
  31.101 +        xen_sr handle;
  31.102 +        xen_sr_record *record;
  31.103 +    } u;
  31.104 +} xen_sr_record_opt;
  31.105 +
  31.106 +/**
  31.107 + * Allocate a xen_sr_record_opt.
  31.108 + */
  31.109 +extern xen_sr_record_opt *
  31.110 +xen_sr_record_opt_alloc(void);
  31.111 +
  31.112 +/**
  31.113 + * Free the given xen_sr_record_opt, and all referenced values.  The
  31.114 + * given record_opt must have been allocated by this library.
  31.115 + */
  31.116 +extern void
  31.117 +xen_sr_record_opt_free(xen_sr_record_opt *record_opt);
  31.118 +
  31.119 +
  31.120 +typedef struct xen_sr_record_set
  31.121 +{
  31.122 +    size_t size;
  31.123 +    xen_sr_record *contents[];
  31.124 +} xen_sr_record_set;
  31.125 +
  31.126 +/**
  31.127 + * Allocate a xen_sr_record_set of the given size.
  31.128 + */
  31.129 +extern xen_sr_record_set *
  31.130 +xen_sr_record_set_alloc(size_t size);
  31.131 +
  31.132 +/**
  31.133 + * Free the given xen_sr_record_set, and all referenced values.  The
  31.134 + * given set must have been allocated by this library.
  31.135 + */
  31.136 +extern void
  31.137 +xen_sr_record_set_free(xen_sr_record_set *set);
  31.138 +
  31.139 +
  31.140 +
  31.141 +typedef struct xen_sr_record_opt_set
  31.142 +{
  31.143 +    size_t size;
  31.144 +    xen_sr_record_opt *contents[];
  31.145 +} xen_sr_record_opt_set;
  31.146 +
  31.147 +/**
  31.148 + * Allocate a xen_sr_record_opt_set of the given size.
  31.149 + */
  31.150 +extern xen_sr_record_opt_set *
  31.151 +xen_sr_record_opt_set_alloc(size_t size);
  31.152 +
  31.153 +/**
  31.154 + * Free the given xen_sr_record_opt_set, and all referenced values. 
  31.155 + * The given set must have been allocated by this library.
  31.156 + */
  31.157 +extern void
  31.158 +xen_sr_record_opt_set_free(xen_sr_record_opt_set *set);
  31.159 +
  31.160 +
  31.161 +/**
  31.162 + * Get a record containing the current state of the given SR.
  31.163 + */
  31.164 +extern bool
  31.165 +xen_sr_get_record(xen_session *session, xen_sr_record **result, xen_sr sr);
  31.166 +
  31.167 +
  31.168 +/**
  31.169 + * Get a reference to the SR instance with the specified UUID.
  31.170 + */
  31.171 +extern bool
  31.172 +xen_sr_get_by_uuid(xen_session *session, xen_sr *result, char *uuid);
  31.173 +
  31.174 +
  31.175 +/**
  31.176 + * Get all the SR instances with the given label.
  31.177 + */
  31.178 +extern bool
  31.179 +xen_sr_get_by_name_label(xen_session *session, struct xen_sr_set **result, char *label);
  31.180 +
  31.181 +
  31.182 +/**
  31.183 + * Get the uuid field of the given SR.
  31.184 + */
  31.185 +extern bool
  31.186 +xen_sr_get_uuid(xen_session *session, char **result, xen_sr sr);
  31.187 +
  31.188 +
  31.189 +/**
  31.190 + * Get the name/label field of the given SR.
  31.191 + */
  31.192 +extern bool
  31.193 +xen_sr_get_name_label(xen_session *session, char **result, xen_sr sr);
  31.194 +
  31.195 +
  31.196 +/**
  31.197 + * Get the name/description field of the given SR.
  31.198 + */
  31.199 +extern bool
  31.200 +xen_sr_get_name_description(xen_session *session, char **result, xen_sr sr);
  31.201 +
  31.202 +
  31.203 +/**
  31.204 + * Get the VDIs field of the given SR.
  31.205 + */
  31.206 +extern bool
  31.207 +xen_sr_get_vdis(xen_session *session, struct xen_vdi_set **result, xen_sr sr);
  31.208 +
  31.209 +
  31.210 +/**
  31.211 + * Get the PBDs field of the given SR.
  31.212 + */
  31.213 +extern bool
  31.214 +xen_sr_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_sr sr);
  31.215 +
  31.216 +
  31.217 +/**
  31.218 + * Get the virtual_allocation field of the given SR.
  31.219 + */
  31.220 +extern bool
  31.221 +xen_sr_get_virtual_allocation(xen_session *session, int64_t *result, xen_sr sr);
  31.222 +
  31.223 +
  31.224 +/**
  31.225 + * Get the physical_utilisation field of the given SR.
  31.226 + */
  31.227 +extern bool
  31.228 +xen_sr_get_physical_utilisation(xen_session *session, int64_t *result, xen_sr sr);
  31.229 +
  31.230 +
  31.231 +/**
  31.232 + * Get the physical_size field of the given SR.
  31.233 + */
  31.234 +extern bool
  31.235 +xen_sr_get_physical_size(xen_session *session, int64_t *result, xen_sr sr);
  31.236 +
  31.237 +
  31.238 +/**
  31.239 + * Get the type field of the given SR.
  31.240 + */
  31.241 +extern bool
  31.242 +xen_sr_get_type(xen_session *session, char **result, xen_sr sr);
  31.243 +
  31.244 +
  31.245 +/**
  31.246 + * Get the content_type field of the given SR.
  31.247 + */
  31.248 +extern bool
  31.249 +xen_sr_get_content_type(xen_session *session, char **result, xen_sr sr);
  31.250 +
  31.251 +
  31.252 +/**
  31.253 + * Set the name/label field of the given SR.
  31.254 + */
  31.255 +extern bool
  31.256 +xen_sr_set_name_label(xen_session *session, xen_sr sr, char *label);
  31.257 +
  31.258 +
  31.259 +/**
  31.260 + * Set the name/description field of the given SR.
  31.261 + */
  31.262 +extern bool
  31.263 +xen_sr_set_name_description(xen_session *session, xen_sr sr, char *description);
  31.264 +
  31.265 +
  31.266 +/**
  31.267 + * Return a set of all the SR types supported by the system.
  31.268 + */
  31.269 +extern bool
  31.270 +xen_sr_get_supported_types(xen_session *session, struct xen_string_set **result);
  31.271 +
  31.272 +
  31.273 +/**
  31.274 + * Return a list of all the SRs known to the system.
  31.275 + */
  31.276 +extern bool
  31.277 +xen_sr_get_all(xen_session *session, struct xen_sr_set **result);
  31.278 +
  31.279 +
  31.280 +#endif
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/tools/libxen/include/xen/api/xen_sr_decl.h	Sat Apr 21 12:21:06 2007 -0700
    32.3 @@ -0,0 +1,30 @@
    32.4 +/*
    32.5 + * Copyright (c) 2006-2007, XenSource Inc.
    32.6 + *
    32.7 + * This library is free software; you can redistribute it and/or
    32.8 + * modify it under the terms of the GNU Lesser General Public
    32.9 + * License as published by the Free Software Foundation; either
   32.10 + * version 2.1 of the License, or (at your option) any later version.
   32.11 + *
   32.12 + * This library is distributed in the hope that it will be useful,
   32.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   32.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   32.15 + * Lesser General Public License for more details.
   32.16 + *
   32.17 + * You should have received a copy of the GNU Lesser General Public
   32.18 + * License along with this library; if not, write to the Free Software
   32.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   32.20 + */
   32.21 +
   32.22 +#ifndef XEN_SR_DECL_H
   32.23 +#define XEN_SR_DECL_H
   32.24 +
   32.25 +typedef void *xen_sr;
   32.26 +
   32.27 +struct xen_sr_set;
   32.28 +struct xen_sr_record;
   32.29 +struct xen_sr_record_set;
   32.30 +struct xen_sr_record_opt;
   32.31 +struct xen_sr_record_opt_set;
   32.32 +
   32.33 +#endif
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/tools/libxen/include/xen/api/xen_string_set.h	Sat Apr 21 12:21:06 2007 -0700
    33.3 @@ -0,0 +1,47 @@
    33.4 +/*
    33.5 + * Copyright (c) 2006-2007, XenSource Inc.
    33.6 + *
    33.7 + * This library is free software; you can redistribute it and/or
    33.8 + * modify it under the terms of the GNU Lesser General Public
    33.9 + * License as published by the Free Software Foundation; either
   33.10 + * version 2.1 of the License, or (at your option) any later version.
   33.11 + *
   33.12 + * This library is distributed in the hope that it will be useful,
   33.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   33.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   33.15 + * Lesser General Public License for more details.
   33.16 + *
   33.17 + * You should have received a copy of the GNU Lesser General Public
   33.18 + * License along with this library; if not, write to the Free Software
   33.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   33.20 + */
   33.21 +
   33.22 +#ifndef XEN_STRING_SET_H
   33.23 +#define XEN_STRING_SET_H
   33.24 +
   33.25 +
   33.26 +#include "xen_common.h"
   33.27 +
   33.28 +
   33.29 +typedef struct xen_string_set
   33.30 +{
   33.31 +    size_t size;
   33.32 +    char *contents[];
   33.33 +} xen_string_set;
   33.34 +
   33.35 +
   33.36 +/**
   33.37 + * Allocate a xen_string_set of the given size.
   33.38 + */
   33.39 +extern xen_string_set *
   33.40 +xen_string_set_alloc(size_t size);
   33.41 +
   33.42 +/**
   33.43 + * Free the given xen_string_set.  The given set must have been allocated
   33.44 + * by this library.
   33.45 + */
   33.46 +extern void
   33.47 +xen_string_set_free(xen_string_set *set);
   33.48 +
   33.49 +
   33.50 +#endif
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/tools/libxen/include/xen/api/xen_string_string_map.h	Sat Apr 21 12:21:06 2007 -0700
    34.3 @@ -0,0 +1,53 @@
    34.4 +/*
    34.5 + * Copyright (c) 2006-2007, XenSource Inc.
    34.6 + *
    34.7 + * This library is free software; you can redistribute it and/or
    34.8 + * modify it under the terms of the GNU Lesser General Public
    34.9 + * License as published by the Free Software Foundation; either
   34.10 + * version 2.1 of the License, or (at your option) any later version.
   34.11 + *
   34.12 + * This library is distributed in the hope that it will be useful,
   34.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   34.15 + * Lesser General Public License for more details.
   34.16 + *
   34.17 + * You should have received a copy of the GNU Lesser General Public
   34.18 + * License along with this library; if not, write to the Free Software
   34.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   34.20 + */
   34.21 +
   34.22 +#ifndef XEN_STRING_STRING_MAP_H
   34.23 +#define XEN_STRING_STRING_MAP_H
   34.24 +
   34.25 +
   34.26 +#include <xen/api/xen_common.h>
   34.27 +
   34.28 +
   34.29 +typedef struct xen_string_string_map_contents
   34.30 +{
   34.31 +  char *key;
   34.32 +  char *val;
   34.33 +} xen_string_string_map_contents;
   34.34 +
   34.35 +
   34.36 +typedef struct xen_string_string_map
   34.37 +{
   34.38 +    size_t size;
   34.39 +    xen_string_string_map_contents contents[];
   34.40 +} xen_string_string_map;
   34.41 +
   34.42 +/**
   34.43 + * Allocate a xen_string_string_map of the given size.
   34.44 + */
   34.45 +extern xen_string_string_map *
   34.46 +xen_string_string_map_alloc(size_t size);
   34.47 +
   34.48 +/**
   34.49 + * Free the given xen_string_string_map, and all referenced values. 
   34.50 + * The given map must have been allocated by this library.
   34.51 + */
   34.52 +extern void
   34.53 +xen_string_string_map_free(xen_string_string_map *map);
   34.54 +
   34.55 +
   34.56 +#endif
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/tools/libxen/include/xen/api/xen_user.h	Sat Apr 21 12:21:06 2007 -0700
    35.3 @@ -0,0 +1,204 @@
    35.4 +/*
    35.5 + * Copyright (c) 2006-2007, XenSource Inc.
    35.6 + *
    35.7 + * This library is free software; you can redistribute it and/or
    35.8 + * modify it under the terms of the GNU Lesser General Public
    35.9 + * License as published by the Free Software Foundation; either
   35.10 + * version 2.1 of the License, or (at your option) any later version.
   35.11 + *
   35.12 + * This library is distributed in the hope that it will be useful,
   35.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   35.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   35.15 + * Lesser General Public License for more details.
   35.16 + *
   35.17 + * You should have received a copy of the GNU Lesser General Public
   35.18 + * License along with this library; if not, write to the Free Software
   35.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   35.20 + */
   35.21 +
   35.22 +#ifndef XEN_USER_H
   35.23 +#define XEN_USER_H
   35.24 +
   35.25 +#include <xen/api/xen_common.h>
   35.26 +#include <xen/api/xen_user_decl.h>
   35.27 +
   35.28 +
   35.29 +/*
   35.30 + * The user class.
   35.31 + * 
   35.32 + * A user of the system.
   35.33 + */
   35.34 +
   35.35 +
   35.36 +/**
   35.37 + * Free the given xen_user.  The given handle must have been allocated
   35.38 + * by this library.
   35.39 + */
   35.40 +extern void
   35.41 +xen_user_free(xen_user user);
   35.42 +
   35.43 +
   35.44 +typedef struct xen_user_set
   35.45 +{
   35.46 +    size_t size;
   35.47 +    xen_user *contents[];
   35.48 +} xen_user_set;
   35.49 +
   35.50 +/**
   35.51 + * Allocate a xen_user_set of the given size.
   35.52 + */
   35.53 +extern xen_user_set *
   35.54 +xen_user_set_alloc(size_t size);
   35.55 +
   35.56 +/**
   35.57 + * Free the given xen_user_set.  The given set must have been allocated
   35.58 + * by this library.
   35.59 + */
   35.60 +extern void
   35.61 +xen_user_set_free(xen_user_set *set);
   35.62 +
   35.63 +
   35.64 +typedef struct xen_user_record
   35.65 +{
   35.66 +    xen_user handle;
   35.67 +    char *uuid;
   35.68 +    char *short_name;
   35.69 +    char *fullname;
   35.70 +} xen_user_record;
   35.71 +
   35.72 +/**
   35.73 + * Allocate a xen_user_record.
   35.74 + */
   35.75 +extern xen_user_record *
   35.76 +xen_user_record_alloc(void);
   35.77 +
   35.78 +/**
   35.79 + * Free the given xen_user_record, and all referenced values.  The
   35.80 + * given record must have been allocated by this library.
   35.81 + */
   35.82 +extern void
   35.83 +xen_user_record_free(xen_user_record *record);
   35.84 +
   35.85 +
   35.86 +typedef struct xen_user_record_opt
   35.87 +{
   35.88 +    bool is_record;
   35.89 +    union
   35.90 +    {
   35.91 +        xen_user handle;
   35.92 +        xen_user_record *record;
   35.93 +    } u;
   35.94 +} xen_user_record_opt;
   35.95 +
   35.96 +/**
   35.97 + * Allocate a xen_user_record_opt.
   35.98 + */
   35.99 +extern xen_user_record_opt *
  35.100 +xen_user_record_opt_alloc(void);
  35.101 +
  35.102 +/**
  35.103 + * Free the given xen_user_record_opt, and all referenced values.  The
  35.104 + * given record_opt must have been allocated by this library.
  35.105 + */
  35.106 +extern void
  35.107 +xen_user_record_opt_free(xen_user_record_opt *record_opt);
  35.108 +
  35.109 +
  35.110 +typedef struct xen_user_record_set
  35.111 +{
  35.112 +    size_t size;
  35.113 +    xen_user_record *contents[];
  35.114 +} xen_user_record_set;
  35.115 +
  35.116 +/**
  35.117 + * Allocate a xen_user_record_set of the given size.
  35.118 + */
  35.119 +extern xen_user_record_set *
  35.120 +xen_user_record_set_alloc(size_t size);
  35.121 +
  35.122 +/**
  35.123 + * Free the given xen_user_record_set, and all referenced values.  The
  35.124 + * given set must have been allocated by this library.
  35.125 + */
  35.126 +extern void
  35.127 +xen_user_record_set_free(xen_user_record_set *set);
  35.128 +
  35.129 +
  35.130 +
  35.131 +typedef struct xen_user_record_opt_set
  35.132 +{
  35.133 +    size_t size;
  35.134 +    xen_user_record_opt *contents[];
  35.135 +} xen_user_record_opt_set;
  35.136 +
  35.137 +/**
  35.138 + * Allocate a xen_user_record_opt_set of the given size.
  35.139 + */
  35.140 +extern xen_user_record_opt_set *
  35.141 +xen_user_record_opt_set_alloc(size_t size);
  35.142 +
  35.143 +/**
  35.144 + * Free the given xen_user_record_opt_set, and all referenced values. 
  35.145 + * The given set must have been allocated by this library.
  35.146 + */
  35.147 +extern void
  35.148 +xen_user_record_opt_set_free(xen_user_record_opt_set *set);
  35.149 +
  35.150 +
  35.151 +/**
  35.152 + * Get a record containing the current state of the given user.
  35.153 + */
  35.154 +extern bool
  35.155 +xen_user_get_record(xen_session *session, xen_user_record **result, xen_user user);
  35.156 +
  35.157 +
  35.158 +/**
  35.159 + * Get a reference to the user instance with the specified UUID.
  35.160 + */
  35.161 +extern bool
  35.162 +xen_user_get_by_uuid(xen_session *session, xen_user *result, char *uuid);
  35.163 +
  35.164 +
  35.165 +/**
  35.166 + * Create a new user instance, and return its handle.
  35.167 + */
  35.168 +extern bool
  35.169 +xen_user_create(xen_session *session, xen_user *result, xen_user_record *record);
  35.170 +
  35.171 +
  35.172 +/**
  35.173 + * Destroy the specified user instance.
  35.174 + */
  35.175 +extern bool
  35.176 +xen_user_destroy(xen_session *session, xen_user user);
  35.177 +
  35.178 +
  35.179 +/**
  35.180 + * Get the uuid field of the given user.
  35.181 + */
  35.182 +extern bool
  35.183 +xen_user_get_uuid(xen_session *session, char **result, xen_user user);
  35.184 +
  35.185 +
  35.186 +/**
  35.187 + * Get the short_name field of the given user.
  35.188 + */
  35.189 +extern bool
  35.190 +xen_user_get_short_name(xen_session *session, char **result, xen_user user);
  35.191 +
  35.192 +
  35.193 +/**
  35.194 + * Get the fullname field of the given user.
  35.195 + */
  35.196 +extern bool
  35.197 +xen_user_get_fullname(xen_session *session, char **result, xen_user user);
  35.198 +
  35.199 +
  35.200 +/**
  35.201 + * Set the fullname field of the given user.
  35.202 + */
  35.203 +extern bool
  35.204 +xen_user_set_fullname(xen_session *session, xen_user user, char *fullname);
  35.205 +
  35.206 +
  35.207 +#endif
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/tools/libxen/include/xen/api/xen_user_decl.h	Sat Apr 21 12:21:06 2007 -0700
    36.3 @@ -0,0 +1,30 @@
    36.4 +/*
    36.5 + * Copyright (c) 2006-2007, XenSource Inc.
    36.6 + *
    36.7 + * This library is free software; you can redistribute it and/or
    36.8 + * modify it under the terms of the GNU Lesser General Public
    36.9 + * License as published by the Free Software Foundation; either
   36.10 + * version 2.1 of the License, or (at your option) any later version.
   36.11 + *
   36.12 + * This library is distributed in the hope that it will be useful,
   36.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   36.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   36.15 + * Lesser General Public License for more details.
   36.16 + *
   36.17 + * You should have received a copy of the GNU Lesser General Public
   36.18 + * License along with this library; if not, write to the Free Software
   36.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   36.20 + */
   36.21 +
   36.22 +#ifndef XEN_USER_DECL_H
   36.23 +#define XEN_USER_DECL_H
   36.24 +
   36.25 +typedef void *xen_user;
   36.26 +
   36.27 +struct xen_user_set;
   36.28 +struct xen_user_record;
   36.29 +struct xen_user_record_set;
   36.30 +struct xen_user_record_opt;
   36.31 +struct xen_user_record_opt_set;
   36.32 +
   36.33 +#endif
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/tools/libxen/include/xen/api/xen_vbd.h	Sat Apr 21 12:21:06 2007 -0700
    37.3 @@ -0,0 +1,390 @@
    37.4 +/*
    37.5 + * Copyright (c) 2006-2007, XenSource Inc.
    37.6 + *
    37.7 + * This library is free software; you can redistribute it and/or
    37.8 + * modify it under the terms of the GNU Lesser General Public
    37.9 + * License as published by the Free Software Foundation; either
   37.10 + * version 2.1 of the License, or (at your option) any later version.
   37.11 + *
   37.12 + * This library is distributed in the hope that it will be useful,
   37.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   37.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   37.15 + * Lesser General Public License for more details.
   37.16 + *
   37.17 + * You should have received a copy of the GNU Lesser General Public
   37.18 + * License along with this library; if not, write to the Free Software
   37.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   37.20 + */
   37.21 +
   37.22 +#ifndef XEN_VBD_H
   37.23 +#define XEN_VBD_H
   37.24 +
   37.25 +#include <xen/api/xen_common.h>
   37.26 +#include <xen/api/xen_string_set.h>
   37.27 +#include <xen/api/xen_string_string_map.h>
   37.28 +#include <xen/api/xen_vbd_decl.h>
   37.29 +#include <xen/api/xen_vbd_metrics_decl.h>
   37.30 +#include <xen/api/xen_vbd_mode.h>
   37.31 +#include <xen/api/xen_vbd_type.h>
   37.32 +#include <xen/api/xen_vdi_decl.h>
   37.33 +#include <xen/api/xen_vm_decl.h>
   37.34 +
   37.35 +
   37.36 +/*
   37.37 + * The VBD class.
   37.38 + * 
   37.39 + * A virtual block device.
   37.40 + */
   37.41 +
   37.42 +
   37.43 +/**
   37.44 + * Free the given xen_vbd.  The given handle must have been allocated
   37.45 + * by this library.
   37.46 + */
   37.47 +extern void
   37.48 +xen_vbd_free(xen_vbd vbd);
   37.49 +
   37.50 +
   37.51 +typedef struct xen_vbd_set
   37.52 +{
   37.53 +    size_t size;
   37.54 +    xen_vbd *contents[];
   37.55 +} xen_vbd_set;
   37.56 +
   37.57 +/**
   37.58 + * Allocate a xen_vbd_set of the given size.
   37.59 + */
   37.60 +extern xen_vbd_set *
   37.61 +xen_vbd_set_alloc(size_t size);
   37.62 +
   37.63 +/**
   37.64 + * Free the given xen_vbd_set.  The given set must have been allocated
   37.65 + * by this library.
   37.66 + */
   37.67 +extern void
   37.68 +xen_vbd_set_free(xen_vbd_set *set);
   37.69 +
   37.70 +
   37.71 +typedef struct xen_vbd_record
   37.72 +{
   37.73 +    xen_vbd handle;
   37.74 +    char *uuid;
   37.75 +    struct xen_vm_record_opt *vm;
   37.76 +    struct xen_vdi_record_opt *vdi;
   37.77 +    char *device;
   37.78 +    bool bootable;
   37.79 +    enum xen_vbd_mode mode;
   37.80 +    enum xen_vbd_type type;
   37.81 +    bool currently_attached;
   37.82 +    int64_t status_code;
   37.83 +    char *status_detail;
   37.84 +    xen_string_string_map *runtime_properties;
   37.85 +    char *qos_algorithm_type;
   37.86 +    xen_string_string_map *qos_algorithm_params;
   37.87 +    struct xen_string_set *qos_supported_algorithms;
   37.88 +    struct xen_vbd_metrics_record_opt *metrics;
   37.89 +} xen_vbd_record;
   37.90 +
   37.91 +/**
   37.92 + * Allocate a xen_vbd_record.
   37.93 + */
   37.94 +extern xen_vbd_record *
   37.95 +xen_vbd_record_alloc(void);
   37.96 +
   37.97 +/**
   37.98 + * Free the given xen_vbd_record, and all referenced values.  The given
   37.99 + * record must have been allocated by this library.
  37.100 + */
  37.101 +extern void
  37.102 +xen_vbd_record_free(xen_vbd_record *record);
  37.103 +
  37.104 +
  37.105 +typedef struct xen_vbd_record_opt
  37.106 +{
  37.107 +    bool is_record;
  37.108 +    union
  37.109 +    {
  37.110 +        xen_vbd handle;
  37.111 +        xen_vbd_record *record;
  37.112 +    } u;
  37.113 +} xen_vbd_record_opt;
  37.114 +
  37.115 +/**
  37.116 + * Allocate a xen_vbd_record_opt.
  37.117 + */
  37.118 +extern xen_vbd_record_opt *
  37.119 +xen_vbd_record_opt_alloc(void);
  37.120 +
  37.121 +/**
  37.122 + * Free the given xen_vbd_record_opt, and all referenced values.  The
  37.123 + * given record_opt must have been allocated by this library.
  37.124 + */
  37.125 +extern void
  37.126 +xen_vbd_record_opt_free(xen_vbd_record_opt *record_opt);
  37.127 +
  37.128 +
  37.129 +typedef struct xen_vbd_record_set
  37.130 +{
  37.131 +    size_t size;
  37.132 +    xen_vbd_record *contents[];
  37.133 +} xen_vbd_record_set;
  37.134 +
  37.135 +/**
  37.136 + * Allocate a xen_vbd_record_set of the given size.
  37.137 + */
  37.138 +extern xen_vbd_record_set *
  37.139 +xen_vbd_record_set_alloc(size_t size);
  37.140 +
  37.141 +/**
  37.142 + * Free the given xen_vbd_record_set, and all referenced values.  The
  37.143 + * given set must have been allocated by this library.
  37.144 + */
  37.145 +extern void
  37.146 +xen_vbd_record_set_free(xen_vbd_record_set *set);
  37.147 +
  37.148 +
  37.149 +
  37.150 +typedef struct xen_vbd_record_opt_set
  37.151 +{
  37.152 +    size_t size;
  37.153 +    xen_vbd_record_opt *contents[];
  37.154 +} xen_vbd_record_opt_set;
  37.155 +
  37.156 +/**
  37.157 + * Allocate a xen_vbd_record_opt_set of the given size.
  37.158 + */
  37.159 +extern xen_vbd_record_opt_set *
  37.160 +xen_vbd_record_opt_set_alloc(size_t size);
  37.161 +
  37.162 +/**
  37.163 + * Free the given xen_vbd_record_opt_set, and all referenced values. 
  37.164 + * The given set must have been allocated by this library.
  37.165 + */
  37.166 +extern void
  37.167 +xen_vbd_record_opt_set_free(xen_vbd_record_opt_set *set);
  37.168 +
  37.169 +
  37.170 +/**
  37.171 + * Get a record containing the current state of the given VBD.
  37.172 + */
  37.173 +extern bool
  37.174 +xen_vbd_get_record(xen_session *session, xen_vbd_record **result, xen_vbd vbd);
  37.175 +
  37.176 +
  37.177 +/**
  37.178 + * Get a reference to the VBD instance with the specified UUID.
  37.179 + */
  37.180 +extern bool
  37.181 +xen_vbd_get_by_uuid(xen_session *session, xen_vbd *result, char *uuid);
  37.182 +
  37.183 +
  37.184 +/**
  37.185 + * Create a new VBD instance, and return its handle.
  37.186 + */
  37.187 +extern bool
  37.188 +xen_vbd_create(xen_session *session, xen_vbd *result, xen_vbd_record *record);
  37.189 +
  37.190 +
  37.191 +/**
  37.192 + * Destroy the specified VBD instance.
  37.193 + */
  37.194 +extern bool
  37.195 +xen_vbd_destroy(xen_session *session, xen_vbd vbd);
  37.196 +
  37.197 +
  37.198 +/**
  37.199 + * Get the uuid field of the given VBD.
  37.200 + */
  37.201 +extern bool
  37.202 +xen_vbd_get_uuid(xen_session *session, char **result, xen_vbd vbd);
  37.203 +
  37.204 +
  37.205 +/**
  37.206 + * Get the VM field of the given VBD.
  37.207 + */
  37.208 +extern bool
  37.209 +xen_vbd_get_vm(xen_session *session, xen_vm *result, xen_vbd vbd);
  37.210 +
  37.211 +
  37.212 +/**
  37.213 + * Get the VDI field of the given VBD.
  37.214 + */
  37.215 +extern bool
  37.216 +xen_vbd_get_vdi(xen_session *session, xen_vdi *result, xen_vbd vbd);
  37.217 +
  37.218 +
  37.219 +/**
  37.220 + * Get the device field of the given VBD.
  37.221 + */
  37.222 +extern bool
  37.223 +xen_vbd_get_device(xen_session *session, char **result, xen_vbd vbd);
  37.224 +
  37.225 +
  37.226 +/**
  37.227 + * Get the bootable field of the given VBD.
  37.228 + */
  37.229 +extern bool
  37.230 +xen_vbd_get_bootable(xen_session *session, bool *result, xen_vbd vbd);
  37.231 +
  37.232 +
  37.233 +/**
  37.234 + * Get the mode field of the given VBD.
  37.235 + */
  37.236 +extern bool
  37.237 +xen_vbd_get_mode(xen_session *session, enum xen_vbd_mode *result, xen_vbd vbd);
  37.238 +
  37.239 +
  37.240 +/**
  37.241 + * Get the type field of the given VBD.
  37.242 + */
  37.243 +extern bool
  37.244 +xen_vbd_get_type(xen_session *session, enum xen_vbd_type *result, xen_vbd vbd);
  37.245 +
  37.246 +
  37.247 +/**
  37.248 + * Get the currently_attached field of the given VBD.
  37.249 + */
  37.250 +extern bool
  37.251 +xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd);
  37.252 +
  37.253 +
  37.254 +/**
  37.255 + * Get the status_code field of the given VBD.
  37.256 + */
  37.257 +extern bool
  37.258 +xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd);
  37.259 +
  37.260 +
  37.261 +/**
  37.262 + * Get the status_detail field of the given VBD.
  37.263 + */
  37.264 +extern bool
  37.265 +xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd);
  37.266 +
  37.267 +
  37.268 +/**
  37.269 + * Get the runtime_properties field of the given VBD.
  37.270 + */
  37.271 +extern bool
  37.272 +xen_vbd_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
  37.273 +
  37.274 +
  37.275 +/**
  37.276 + * Get the qos/algorithm_type field of the given VBD.
  37.277 + */
  37.278 +extern bool
  37.279 +xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd);
  37.280 +
  37.281 +
  37.282 +/**
  37.283 + * Get the qos/algorithm_params field of the given VBD.
  37.284 + */
  37.285 +extern bool
  37.286 +xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
  37.287 +
  37.288 +
  37.289 +/**
  37.290 + * Get the qos/supported_algorithms field of the given VBD.
  37.291 + */
  37.292 +extern bool
  37.293 +xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd);
  37.294 +
  37.295 +
  37.296 +/**
  37.297 + * Get the metrics field of the given VBD.
  37.298 + */
  37.299 +extern bool
  37.300 +xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd);
  37.301 +
  37.302 +
  37.303 +/**
  37.304 + * Set the device field of the given VBD.
  37.305 + */
  37.306 +extern bool
  37.307 +xen_vbd_set_device(xen_session *session, xen_vbd vbd, char *device);
  37.308 +
  37.309 +
  37.310 +/**
  37.311 + * Set the bootable field of the given VBD.
  37.312 + */
  37.313 +extern bool
  37.314 +xen_vbd_set_bootable(xen_session *session, xen_vbd vbd, bool bootable);
  37.315 +
  37.316 +
  37.317 +/**
  37.318 + * Set the mode field of the given VBD.
  37.319 + */
  37.320 +extern bool
  37.321 +xen_vbd_set_mode(xen_session *session, xen_vbd vbd, enum xen_vbd_mode mode);
  37.322 +
  37.323 +
  37.324 +/**
  37.325 + * Set the type field of the given VBD.
  37.326 + */
  37.327 +extern bool
  37.328 +xen_vbd_set_type(xen_session *session, xen_vbd vbd, enum xen_vbd_type type);
  37.329 +
  37.330 +
  37.331 +/**
  37.332 + * Set the qos/algorithm_type field of the given VBD.
  37.333 + */
  37.334 +extern bool
  37.335 +xen_vbd_set_qos_algorithm_type(xen_session *session, xen_vbd vbd, char *algorithm_type);
  37.336 +
  37.337 +
  37.338 +/**
  37.339 + * Set the qos/algorithm_params field of the given VBD.
  37.340 + */
  37.341 +extern bool
  37.342 +xen_vbd_set_qos_algorithm_params(xen_session *session, xen_vbd vbd, xen_string_string_map *algorithm_params);
  37.343 +
  37.344 +
  37.345 +/**
  37.346 + * Add the given key-value pair to the qos/algorithm_params field of
  37.347 + * the given VBD.
  37.348 + */
  37.349 +extern bool
  37.350 +xen_vbd_add_to_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key, char *value);
  37.351 +
  37.352 +
  37.353 +/**
  37.354 + * Remove the given key and its corresponding value from the
  37.355 + * qos/algorithm_params field of the given VBD.  If the key is not in that
  37.356 + * Map, then do nothing.
  37.357 + */
  37.358 +extern bool
  37.359 +xen_vbd_remove_from_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key);
  37.360 +
  37.361 +
  37.362 +/**
  37.363 + * Change the media in the device for CDROM-like devices only. For
  37.364 + * other devices, detach the VBD and attach a new one.
  37.365 + */
  37.366 +extern bool
  37.367 +xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi);
  37.368 +
  37.369 +
  37.370 +/**
  37.371 + * Hotplug the specified VBD, dynamically attaching it to the running
  37.372 + * VM.
  37.373 + */
  37.374 +extern bool
  37.375 +xen_vbd_plug(xen_session *session, xen_vbd self);
  37.376 +
  37.377 +
  37.378 +/**
  37.379 + * Hot-unplug the specified VBD, dynamically unattaching it from the
  37.380 + * running VM.
  37.381 + */
  37.382 +extern bool
  37.383 +xen_vbd_unplug(xen_session *session, xen_vbd self);
  37.384 +
  37.385 +
  37.386 +/**
  37.387 + * Return a list of all the VBDs known to the system.
  37.388 + */
  37.389 +extern bool
  37.390 +xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result);
  37.391 +
  37.392 +
  37.393 +#endif
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/tools/libxen/include/xen/api/xen_vbd_decl.h	Sat Apr 21 12:21:06 2007 -0700
    38.3 @@ -0,0 +1,30 @@
    38.4 +/*
    38.5 + * Copyright (c) 2006-2007, XenSource Inc.
    38.6 + *
    38.7 + * This library is free software; you can redistribute it and/or
    38.8 + * modify it under the terms of the GNU Lesser General Public
    38.9 + * License as published by the Free Software Foundation; either
   38.10 + * version 2.1 of the License, or (at your option) any later version.
   38.11 + *
   38.12 + * This library is distributed in the hope that it will be useful,
   38.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   38.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   38.15 + * Lesser General Public License for more details.
   38.16 + *
   38.17 + * You should have received a copy of the GNU Lesser General Public
   38.18 + * License along with this library; if not, write to the Free Software
   38.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   38.20 + */
   38.21 +
   38.22 +#ifndef XEN_VBD_DECL_H
   38.23 +#define XEN_VBD_DECL_H
   38.24 +
   38.25 +typedef void *xen_vbd;
   38.26 +
   38.27 +struct xen_vbd_set;
   38.28 +struct xen_vbd_record;
   38.29 +struct xen_vbd_record_set;
   38.30 +struct xen_vbd_record_opt;
   38.31 +struct xen_vbd_record_opt_set;
   38.32 +
   38.33 +#endif
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/tools/libxen/include/xen/api/xen_vbd_metrics.h	Sat Apr 21 12:21:06 2007 -0700
    39.3 @@ -0,0 +1,198 @@
    39.4 +/*
    39.5 + * Copyright (c) 2006-2007, XenSource Inc.
    39.6 + *
    39.7 + * This library is free software; you can redistribute it and/or
    39.8 + * modify it under the terms of the GNU Lesser General Public
    39.9 + * License as published by the Free Software Foundation; either
   39.10 + * version 2.1 of the License, or (at your option) any later version.
   39.11 + *
   39.12 + * This library is distributed in the hope that it will be useful,
   39.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   39.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   39.15 + * Lesser General Public License for more details.
   39.16 + *
   39.17 + * You should have received a copy of the GNU Lesser General Public
   39.18 + * License along with this library; if not, write to the Free Software
   39.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   39.20 + */
   39.21 +
   39.22 +#ifndef XEN_VBD_METRICS_H
   39.23 +#define XEN_VBD_METRICS_H
   39.24 +
   39.25 +#include <xen/api/xen_common.h>
   39.26 +#include <xen/api/xen_vbd_metrics_decl.h>
   39.27 +
   39.28 +
   39.29 +/*
   39.30 + * The VBD_metrics class.
   39.31 + * 
   39.32 + * The metrics associated with a virtual block device.
   39.33 + */
   39.34 +
   39.35 +
   39.36 +/**
   39.37 + * Free the given xen_vbd_metrics.  The given handle must have been
   39.38 + * allocated by this library.
   39.39 + */
   39.40 +extern void
   39.41 +xen_vbd_metrics_free(xen_vbd_metrics vbd_metrics);
   39.42 +
   39.43 +
   39.44 +typedef struct xen_vbd_metrics_set
   39.45 +{
   39.46 +    size_t size;
   39.47 +    xen_vbd_metrics *contents[];
   39.48 +} xen_vbd_metrics_set;
   39.49 +
   39.50 +/**
   39.51 + * Allocate a xen_vbd_metrics_set of the given size.
   39.52 + */
   39.53 +extern xen_vbd_metrics_set *
   39.54 +xen_vbd_metrics_set_alloc(size_t size);
   39.55 +
   39.56 +/**
   39.57 + * Free the given xen_vbd_metrics_set.  The given set must have been
   39.58 + * allocated by this library.
   39.59 + */
   39.60 +extern void
   39.61 +xen_vbd_metrics_set_free(xen_vbd_metrics_set *set);
   39.62 +
   39.63 +
   39.64 +typedef struct xen_vbd_metrics_record
   39.65 +{
   39.66 +    xen_vbd_metrics handle;
   39.67 +    char *uuid;
   39.68 +    double io_read_kbs;
   39.69 +    double io_write_kbs;
   39.70 +    time_t last_updated;
   39.71 +} xen_vbd_metrics_record;
   39.72 +
   39.73 +/**
   39.74 + * Allocate a xen_vbd_metrics_record.
   39.75 + */
   39.76 +extern xen_vbd_metrics_record *
   39.77 +xen_vbd_metrics_record_alloc(void);
   39.78 +
   39.79 +/**
   39.80 + * Free the given xen_vbd_metrics_record, and all referenced values. 
   39.81 + * The given record must have been allocated by this library.
   39.82 + */
   39.83 +extern void
   39.84 +xen_vbd_metrics_record_free(xen_vbd_metrics_record *record);
   39.85 +
   39.86 +
   39.87 +typedef struct xen_vbd_metrics_record_opt
   39.88 +{
   39.89 +    bool is_record;
   39.90 +    union
   39.91 +    {
   39.92 +        xen_vbd_metrics handle;
   39.93 +        xen_vbd_metrics_record *record;
   39.94 +    } u;
   39.95 +} xen_vbd_metrics_record_opt;
   39.96 +
   39.97 +/**
   39.98 + * Allocate a xen_vbd_metrics_record_opt.
   39.99 + */
  39.100 +extern xen_vbd_metrics_record_opt *
  39.101 +xen_vbd_metrics_record_opt_alloc(void);
  39.102 +
  39.103 +/**
  39.104 + * Free the given xen_vbd_metrics_record_opt, and all referenced
  39.105 + * values.  The given record_opt must have been allocated by this library.
  39.106 + */
  39.107 +extern void
  39.108 +xen_vbd_metrics_record_opt_free(xen_vbd_metrics_record_opt *record_opt);
  39.109 +
  39.110 +
  39.111 +typedef struct xen_vbd_metrics_record_set
  39.112 +{
  39.113 +    size_t size;
  39.114 +    xen_vbd_metrics_record *contents[];
  39.115 +} xen_vbd_metrics_record_set;
  39.116 +
  39.117 +/**
  39.118 + * Allocate a xen_vbd_metrics_record_set of the given size.
  39.119 + */
  39.120 +extern xen_vbd_metrics_record_set *
  39.121 +xen_vbd_metrics_record_set_alloc(size_t size);
  39.122 +
  39.123 +/**
  39.124 + * Free the given xen_vbd_metrics_record_set, and all referenced
  39.125 + * values.  The given set must have been allocated by this library.
  39.126 + */
  39.127 +extern void
  39.128 +xen_vbd_metrics_record_set_free(xen_vbd_metrics_record_set *set);
  39.129 +
  39.130 +
  39.131 +
  39.132 +typedef struct xen_vbd_metrics_record_opt_set
  39.133 +{
  39.134 +    size_t size;
  39.135 +    xen_vbd_metrics_record_opt *contents[];
  39.136 +} xen_vbd_metrics_record_opt_set;
  39.137 +
  39.138 +/**
  39.139 + * Allocate a xen_vbd_metrics_record_opt_set of the given size.
  39.140 + */
  39.141 +extern xen_vbd_metrics_record_opt_set *
  39.142 +xen_vbd_metrics_record_opt_set_alloc(size_t size);
  39.143 +
  39.144 +/**
  39.145 + * Free the given xen_vbd_metrics_record_opt_set, and all referenced
  39.146 + * values.  The given set must have been allocated by this library.
  39.147 + */
  39.148 +extern void
  39.149 +xen_vbd_metrics_record_opt_set_free(xen_vbd_metrics_record_opt_set *set);
  39.150 +
  39.151 +
  39.152 +/**
  39.153 + * Get a record containing the current state of the given VBD_metrics.
  39.154 + */
  39.155 +extern bool
  39.156 +xen_vbd_metrics_get_record(xen_session *session, xen_vbd_metrics_record **result, xen_vbd_metrics vbd_metrics);
  39.157 +
  39.158 +
  39.159 +/**
  39.160 + * Get a reference to the VBD_metrics instance with the specified UUID.
  39.161 + */
  39.162 +extern bool
  39.163 +xen_vbd_metrics_get_by_uuid(xen_session *session, xen_vbd_metrics *result, char *uuid);
  39.164 +
  39.165 +
  39.166 +/**
  39.167 + * Get the uuid field of the given VBD_metrics.
  39.168 + */
  39.169 +extern bool
  39.170 +xen_vbd_metrics_get_uuid(xen_session *session, char **result, xen_vbd_metrics vbd_metrics);
  39.171 +
  39.172 +
  39.173 +/**
  39.174 + * Get the io/read_kbs field of the given VBD_metrics.
  39.175 + */
  39.176 +extern bool
  39.177 +xen_vbd_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
  39.178 +
  39.179 +
  39.180 +/**
  39.181 + * Get the io/write_kbs field of the given VBD_metrics.
  39.182 + */
  39.183 +extern bool
  39.184 +xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
  39.185 +
  39.186 +
  39.187 +/**
  39.188 + * Get the last_updated field of the given VBD_metrics.
  39.189 + */
  39.190 +extern bool
  39.191 +xen_vbd_metrics_get_last_updated(xen_session *session, time_t *result, xen_vbd_metrics vbd_metrics);
  39.192 +
  39.193 +
  39.194 +/**
  39.195 + * Return a list of all the VBD_metrics instances known to the system.
  39.196 + */
  39.197 +extern bool
  39.198 +xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result);
  39.199 +
  39.200 +
  39.201 +#endif
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/tools/libxen/include/xen/api/xen_vbd_metrics_decl.h	Sat Apr 21 12:21:06 2007 -0700
    40.3 @@ -0,0 +1,30 @@
    40.4 +/*
    40.5 + * Copyright (c) 2006-2007, XenSource Inc.
    40.6 + *
    40.7 + * This library is free software; you can redistribute it and/or
    40.8 + * modify it under the terms of the GNU Lesser General Public
    40.9 + * License as published by the Free Software Foundation; either
   40.10 + * version 2.1 of the License, or (at your option) any later version.
   40.11 + *
   40.12 + * This library is distributed in the hope that it will be useful,
   40.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   40.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   40.15 + * Lesser General Public License for more details.
   40.16 + *
   40.17 + * You should have received a copy of the GNU Lesser General Public
   40.18 + * License along with this library; if not, write to the Free Software
   40.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   40.20 + */
   40.21 +
   40.22 +#ifndef XEN_VBD_METRICS_DECL_H
   40.23 +#define XEN_VBD_METRICS_DECL_H
   40.24 +
   40.25 +typedef void *xen_vbd_metrics;
   40.26 +
   40.27 +struct xen_vbd_metrics_set;
   40.28 +struct xen_vbd_metrics_record;
   40.29 +struct xen_vbd_metrics_record_set;
   40.30 +struct xen_vbd_metrics_record_opt;
   40.31 +struct xen_vbd_metrics_record_opt_set;
   40.32 +
   40.33 +#endif
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/tools/libxen/include/xen/api/xen_vbd_mode.h	Sat Apr 21 12:21:06 2007 -0700
    41.3 @@ -0,0 +1,77 @@
    41.4 +/*
    41.5 + * Copyright (c) 2006-2007, XenSource Inc.
    41.6 + *
    41.7 + * This library is free software; you can redistribute it and/or
    41.8 + * modify it under the terms of the GNU Lesser General Public
    41.9 + * License as published by the Free Software Foundation; either
   41.10 + * version 2.1 of the License, or (at your option) any later version.
   41.11 + *
   41.12 + * This library is distributed in the hope that it will be useful,
   41.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   41.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   41.15 + * Lesser General Public License for more details.
   41.16 + *
   41.17 + * You should have received a copy of the GNU Lesser General Public
   41.18 + * License along with this library; if not, write to the Free Software
   41.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   41.20 + */
   41.21 +
   41.22 +#ifndef XEN_VBD_MODE_H
   41.23 +#define XEN_VBD_MODE_H
   41.24 +
   41.25 +
   41.26 +#include <xen/api/xen_common.h>
   41.27 +
   41.28 +
   41.29 +enum xen_vbd_mode
   41.30 +{
   41.31 +    /**
   41.32 +     * disk is mounted read-only
   41.33 +     */
   41.34 +    XEN_VBD_MODE_RO,
   41.35 +
   41.36 +    /**
   41.37 +     * disk is mounted read-write
   41.38 +     */
   41.39 +    XEN_VBD_MODE_RW
   41.40 +};
   41.41 +
   41.42 +
   41.43 +typedef struct xen_vbd_mode_set
   41.44 +{
   41.45 +    size_t size;
   41.46 +    enum xen_vbd_mode contents[];
   41.47 +} xen_vbd_mode_set;
   41.48 +
   41.49 +/**
   41.50 + * Allocate a xen_vbd_mode_set of the given size.
   41.51 + */
   41.52 +extern xen_vbd_mode_set *
   41.53 +xen_vbd_mode_set_alloc(size_t size);
   41.54 +
   41.55 +/**
   41.56 + * Free the given xen_vbd_mode_set.  The given set must have been
   41.57 + * allocated by this library.
   41.58 + */
   41.59 +extern void
   41.60 +xen_vbd_mode_set_free(xen_vbd_mode_set *set);
   41.61 +
   41.62 +
   41.63 +/**
   41.64 + * Return the name corresponding to the given code.  This string must
   41.65 + * not be modified or freed.
   41.66 + */
   41.67 +extern const char *
   41.68 +xen_vbd_mode_to_string(enum xen_vbd_mode val);
   41.69 +
   41.70 +
   41.71 +/**
   41.72 + * Return the correct code for the given string, or set the session
   41.73 + * object to failure and return an undefined value if the given string does
   41.74 + * not match a known code.
   41.75 + */
   41.76 +extern enum xen_vbd_mode
   41.77 +xen_vbd_mode_from_string(xen_session *session, const char *str);
   41.78 +
   41.79 +
   41.80 +#endif
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/tools/libxen/include/xen/api/xen_vbd_type.h	Sat Apr 21 12:21:06 2007 -0700
    42.3 @@ -0,0 +1,77 @@
    42.4 +/*
    42.5 + * Copyright (c) 2006-2007, XenSource Inc.
    42.6 + *
    42.7 + * This library is free software; you can redistribute it and/or
    42.8 + * modify it under the terms of the GNU Lesser General Public
    42.9 + * License as published by the Free Software Foundation; either
   42.10 + * version 2.1 of the License, or (at your option) any later version.
   42.11 + *
   42.12 + * This library is distributed in the hope that it will be useful,
   42.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   42.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   42.15 + * Lesser General Public License for more details.
   42.16 + *
   42.17 + * You should have received a copy of the GNU Lesser General Public
   42.18 + * License along with this library; if not, write to the Free Software
   42.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   42.20 + */
   42.21 +
   42.22 +#ifndef XEN_VBD_TYPE_H
   42.23 +#define XEN_VBD_TYPE_H
   42.24 +
   42.25 +
   42.26 +#include <xen/api/xen_common.h>
   42.27 +
   42.28 +
   42.29 +enum xen_vbd_type
   42.30 +{
   42.31 +    /**
   42.32 +     * VBD will appear to guest as CD
   42.33 +     */
   42.34 +    XEN_VBD_TYPE_CD,
   42.35 +
   42.36 +    /**
   42.37 +     * VBD will appear to guest as disk
   42.38 +     */
   42.39 +    XEN_VBD_TYPE_DISK
   42.40 +};
   42.41 +
   42.42 +
   42.43 +typedef struct xen_vbd_type_set
   42.44 +{
   42.45 +    size_t size;
   42.46 +    enum xen_vbd_type contents[];
   42.47 +} xen_vbd_type_set;
   42.48 +
   42.49 +/**
   42.50 + * Allocate a xen_vbd_type_set of the given size.
   42.51 + */
   42.52 +extern xen_vbd_type_set *
   42.53 +xen_vbd_type_set_alloc(size_t size);
   42.54 +
   42.55 +/**
   42.56 + * Free the given xen_vbd_type_set.  The given set must have been
   42.57 + * allocated by this library.
   42.58 + */
   42.59 +extern void
   42.60 +xen_vbd_type_set_free(xen_vbd_type_set *set);
   42.61 +
   42.62 +
   42.63 +/**
   42.64 + * Return the name corresponding to the given code.  This string must
   42.65 + * not be modified or freed.
   42.66 + */
   42.67 +extern const char *
   42.68 +xen_vbd_type_to_string(enum xen_vbd_type val);
   42.69 +
   42.70 +
   42.71 +/**
   42.72 + * Return the correct code for the given string, or set the session
   42.73 + * object to failure and return an undefined value if the given string does
   42.74 + * not match a known code.
   42.75 + */
   42.76 +extern enum xen_vbd_type
   42.77 +xen_vbd_type_from_string(xen_session *session, const char *str);
   42.78 +
   42.79 +
   42.80 +#endif
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/tools/libxen/include/xen/api/xen_vdi.h	Sat Apr 21 12:21:06 2007 -0700
    43.3 @@ -0,0 +1,347 @@
    43.4 +/*
    43.5 + * Copyright (c) 2006-2007, XenSource Inc.
    43.6 + *
    43.7 + * This library is free software; you can redistribute it and/or
    43.8 + * modify it under the terms of the GNU Lesser General Public
    43.9 + * License as published by the Free Software Foundation; either
   43.10 + * version 2.1 of the License, or (at your option) any later version.
   43.11 + *
   43.12 + * This library is distributed in the hope that it will be useful,
   43.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   43.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   43.15 + * Lesser General Public License for more details.
   43.16 + *
   43.17 + * You should have received a copy of the GNU Lesser General Public
   43.18 + * License along with this library; if not, write to the Free Software
   43.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   43.20 + */
   43.21 +
   43.22 +#ifndef XEN_VDI_H
   43.23 +#define XEN_VDI_H
   43.24 +
   43.25 +#include <xen/api/xen_common.h>
   43.26 +#include <xen/api/xen_crashdump_decl.h>
   43.27 +#include <xen/api/xen_sr_decl.h>
   43.28 +#include <xen/api/xen_string_string_map.h>
   43.29 +#include <xen/api/xen_vbd_decl.h>
   43.30 +#include <xen/api/xen_vdi_decl.h>
   43.31 +#include <xen/api/xen_vdi_type.h>
   43.32 +
   43.33 +
   43.34 +/*
   43.35 + * The VDI class.
   43.36 + * 
   43.37 + * A virtual disk image.
   43.38 + */
   43.39 +
   43.40 +
   43.41 +/**
   43.42 + * Free the given xen_vdi.  The given handle must have been allocated
   43.43 + * by this library.
   43.44 + */
   43.45 +extern void
   43.46 +xen_vdi_free(xen_vdi vdi);
   43.47 +
   43.48 +
   43.49 +typedef struct xen_vdi_set
   43.50 +{
   43.51 +    size_t size;
   43.52 +    xen_vdi *contents[];
   43.53 +} xen_vdi_set;
   43.54 +
   43.55 +/**
   43.56 + * Allocate a xen_vdi_set of the given size.
   43.57 + */
   43.58 +extern xen_vdi_set *
   43.59 +xen_vdi_set_alloc(size_t size);
   43.60 +
   43.61 +/**
   43.62 + * Free the given xen_vdi_set.  The given set must have been allocated
   43.63 + * by this library.
   43.64 + */
   43.65 +extern void
   43.66 +xen_vdi_set_free(xen_vdi_set *set);
   43.67 +
   43.68 +
   43.69 +typedef struct xen_vdi_record
   43.70 +{
   43.71 +    xen_vdi handle;
   43.72 +    char *uuid;
   43.73 +    char *name_label;
   43.74 +    char *name_description;
   43.75 +    struct xen_sr_record_opt *sr;
   43.76 +    struct xen_vbd_record_opt_set *vbds;
   43.77 +    struct xen_crashdump_record_opt_set *crash_dumps;
   43.78 +    int64_t virtual_size;
   43.79 +    int64_t physical_utilisation;
   43.80 +    enum xen_vdi_type type;
   43.81 +    bool sharable;
   43.82 +    bool read_only;
   43.83 +    xen_string_string_map *other_config;
   43.84 +} xen_vdi_record;
   43.85 +
   43.86 +/**
   43.87 + * Allocate a xen_vdi_record.
   43.88 + */
   43.89 +extern xen_vdi_record *
   43.90 +xen_vdi_record_alloc(void);
   43.91 +
   43.92 +/**
   43.93 + * Free the given xen_vdi_record, and all referenced values.  The given
   43.94 + * record must have been allocated by this library.
   43.95 + */
   43.96 +extern void
   43.97 +xen_vdi_record_free(xen_vdi_record *record);
   43.98 +
   43.99 +
  43.100 +typedef struct xen_vdi_record_opt
  43.101 +{
  43.102 +    bool is_record;
  43.103 +    union
  43.104 +    {
  43.105 +        xen_vdi handle;
  43.106 +        xen_vdi_record *record;
  43.107 +    } u;
  43.108 +} xen_vdi_record_opt;
  43.109 +
  43.110 +/**
  43.111 + * Allocate a xen_vdi_record_opt.
  43.112 + */
  43.113 +extern xen_vdi_record_opt *
  43.114 +xen_vdi_record_opt_alloc(void);
  43.115 +
  43.116 +/**
  43.117 + * Free the given xen_vdi_record_opt, and all referenced values.  The
  43.118 + * given record_opt must have been allocated by this library.
  43.119 + */
  43.120 +extern void
  43.121 +xen_vdi_record_opt_free(xen_vdi_record_opt *record_opt);
  43.122 +
  43.123 +
  43.124 +typedef struct xen_vdi_record_set
  43.125 +{
  43.126 +    size_t size;
  43.127 +    xen_vdi_record *contents[];
  43.128 +} xen_vdi_record_set;
  43.129 +
  43.130 +/**
  43.131 + * Allocate a xen_vdi_record_set of the given size.
  43.132 + */
  43.133 +extern xen_vdi_record_set *
  43.134 +xen_vdi_record_set_alloc(size_t size);
  43.135 +
  43.136 +/**
  43.137 + * Free the given xen_vdi_record_set, and all referenced values.  The
  43.138 + * given set must have been allocated by this library.
  43.139 + */
  43.140 +extern void
  43.141 +xen_vdi_record_set_free(xen_vdi_record_set *set);
  43.142 +
  43.143 +
  43.144 +
  43.145 +typedef struct xen_vdi_record_opt_set
  43.146 +{
  43.147 +    size_t size;
  43.148 +    xen_vdi_record_opt *contents[];
  43.149 +} xen_vdi_record_opt_set;
  43.150 +
  43.151 +/**
  43.152 + * Allocate a xen_vdi_record_opt_set of the given size.
  43.153 + */
  43.154 +extern xen_vdi_record_opt_set *
  43.155 +xen_vdi_record_opt_set_alloc(size_t size);
  43.156 +
  43.157 +/**
  43.158 + * Free the given xen_vdi_record_opt_set, and all referenced values. 
  43.159 + * The given set must have been allocated by this library.
  43.160 + */
  43.161 +extern void
  43.162 +xen_vdi_record_opt_set_free(xen_vdi_record_opt_set *set);
  43.163 +
  43.164 +
  43.165 +/**
  43.166 + * Get a record containing the current state of the given VDI.
  43.167 + */
  43.168 +extern bool
  43.169 +xen_vdi_get_record(xen_session *session, xen_vdi_record **result, xen_vdi vdi);
  43.170 +
  43.171 +
  43.172 +/**
  43.173 + * Get a reference to the VDI instance with the specified UUID.
  43.174 + */
  43.175 +extern bool
  43.176 +xen_vdi_get_by_uuid(xen_session *session, xen_vdi *result, char *uuid);
  43.177 +
  43.178 +
  43.179 +/**
  43.180 + * Create a new VDI instance, and return its handle.
  43.181 + */
  43.182 +extern bool
  43.183 +xen_vdi_create(xen_session *session, xen_vdi *result, xen_vdi_record *record);
  43.184 +
  43.185 +
  43.186 +/**
  43.187 + * Destroy the specified VDI instance.
  43.188 + */
  43.189 +extern bool
  43.190 +xen_vdi_destroy(xen_session *session, xen_vdi vdi);
  43.191 +
  43.192 +
  43.193 +/**
  43.194 + * Get all the VDI instances with the given label.
  43.195 + */
  43.196 +extern bool
  43.197 +xen_vdi_get_by_name_label(xen_session *session, struct xen_vdi_set **result, char *label);
  43.198 +
  43.199 +
  43.200 +/**
  43.201 + * Get the uuid field of the given VDI.
  43.202 + */
  43.203 +extern bool
  43.204 +xen_vdi_get_uuid(xen_session *session, char **result, xen_vdi vdi);
  43.205 +
  43.206 +
  43.207 +/**
  43.208 + * Get the name/label field of the given VDI.
  43.209 + */
  43.210 +extern bool
  43.211 +xen_vdi_get_name_label(xen_session *session, char **result, xen_vdi vdi);
  43.212 +
  43.213 +
  43.214 +/**
  43.215 + * Get the name/description field of the given VDI.
  43.216 + */
  43.217 +extern bool
  43.218 +xen_vdi_get_name_description(xen_session *session, char **result, xen_vdi vdi);
  43.219 +
  43.220 +
  43.221 +/**
  43.222 + * Get the SR field of the given VDI.
  43.223 + */
  43.224 +extern bool
  43.225 +xen_vdi_get_sr(xen_session *session, xen_sr *result, xen_vdi vdi);
  43.226 +
  43.227 +
  43.228 +/**
  43.229 + * Get the VBDs field of the given VDI.
  43.230 + */
  43.231 +extern bool
  43.232 +xen_vdi_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vdi vdi);
  43.233 +
  43.234 +
  43.235 +/**
  43.236 + * Get the crash_dumps field of the given VDI.
  43.237 + */
  43.238 +extern bool
  43.239 +xen_vdi_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vdi vdi);
  43.240 +
  43.241 +
  43.242 +/**
  43.243 + * Get the virtual_size field of the given VDI.
  43.244 + */
  43.245 +extern bool
  43.246 +xen_vdi_get_virtual_size(xen_session *session, int64_t *result, xen_vdi vdi);
  43.247 +
  43.248 +
  43.249 +/**
  43.250 + * Get the physical_utilisation field of the given VDI.
  43.251 + */
  43.252 +extern bool
  43.253 +xen_vdi_get_physical_utilisation(xen_session *session, int64_t *result, xen_vdi vdi);
  43.254 +
  43.255 +
  43.256 +/**
  43.257 + * Get the type field of the given VDI.
  43.258 + */
  43.259 +extern bool
  43.260 +xen_vdi_get_type(xen_session *session, enum xen_vdi_type *result, xen_vdi vdi);
  43.261 +
  43.262 +
  43.263 +/**
  43.264 + * Get the sharable field of the given VDI.
  43.265 + */
  43.266 +extern bool
  43.267 +xen_vdi_get_sharable(xen_session *session, bool *result, xen_vdi vdi);
  43.268 +
  43.269 +
  43.270 +/**
  43.271 + * Get the read_only field of the given VDI.
  43.272 + */
  43.273 +extern bool
  43.274 +xen_vdi_get_read_only(xen_session *session, bool *result, xen_vdi vdi);
  43.275 +
  43.276 +
  43.277 +/**
  43.278 + * Get the other_config field of the given VDI.
  43.279 + */
  43.280 +extern bool
  43.281 +xen_vdi_get_other_config(xen_session *session, xen_string_string_map **result, xen_vdi vdi);
  43.282 +
  43.283 +
  43.284 +/**
  43.285 + * Set the name/label field of the given VDI.
  43.286 + */
  43.287 +extern bool
  43.288 +xen_vdi_set_name_label(xen_session *session, xen_vdi vdi, char *label);
  43.289 +
  43.290 +
  43.291 +/**
  43.292 + * Set the name/description field of the given VDI.
  43.293 + */
  43.294 +extern bool
  43.295 +xen_vdi_set_name_description(xen_session *session, xen_vdi vdi, char *description);
  43.296 +
  43.297 +
  43.298 +/**
  43.299 + * Set the virtual_size field of the given VDI.
  43.300 + */
  43.301 +extern bool
  43.302 +xen_vdi_set_virtual_size(xen_session *session, xen_vdi vdi, int64_t virtual_size);
  43.303 +
  43.304 +
  43.305 +/**
  43.306 + * Set the sharable field of the given VDI.
  43.307 + */
  43.308 +extern bool
  43.309 +xen_vdi_set_sharable(xen_session *session, xen_vdi vdi, bool sharable);
  43.310 +
  43.311 +
  43.312 +/**
  43.313 + * Set the read_only field of the given VDI.
  43.314 + */
  43.315 +extern bool
  43.316 +xen_vdi_set_read_only(xen_session *session, xen_vdi vdi, bool read_only);
  43.317 +
  43.318 +
  43.319 +/**
  43.320 + * Set the other_config field of the given VDI.
  43.321 + */
  43.322 +extern bool
  43.323 +xen_vdi_set_other_config(xen_session *session, xen_vdi vdi, xen_string_string_map *other_config);
  43.324 +
  43.325 +
  43.326 +/**
  43.327 + * Add the given key-value pair to the other_config field of the given
  43.328 + * VDI.
  43.329 + */
  43.330 +extern bool
  43.331 +xen_vdi_add_to_other_config(xen_session *session, xen_vdi vdi, char *key, char *value);
  43.332 +
  43.333 +
  43.334 +/**
  43.335 + * Remove the given key and its corresponding value from the
  43.336 + * other_config field of the given VDI.  If the key is not in that Map, then
  43.337 + * do nothing.
  43.338 + */
  43.339 +extern bool
  43.340 +xen_vdi_remove_from_other_config(xen_session *session, xen_vdi vdi, char *key);
  43.341 +
  43.342 +
  43.343 +/**
  43.344 + * Return a list of all the VDIs known to the system.
  43.345 + */
  43.346 +extern bool
  43.347 +xen_vdi_get_all(xen_session *session, struct xen_vdi_set **result);
  43.348 +
  43.349 +
  43.350 +#endif
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/tools/libxen/include/xen/api/xen_vdi_decl.h	Sat Apr 21 12:21:06 2007 -0700
    44.3 @@ -0,0 +1,30 @@
    44.4 +/*
    44.5 + * Copyright (c) 2006-2007, XenSource Inc.
    44.6 + *
    44.7 + * This library is free software; you can redistribute it and/or
    44.8 + * modify it under the terms of the GNU Lesser General Public
    44.9 + * License as published by the Free Software Foundation; either
   44.10 + * version 2.1 of the License, or (at your option) any later version.
   44.11 + *
   44.12 + * This library is distributed in the hope that it will be useful,
   44.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   44.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   44.15 + * Lesser General Public License for more details.
   44.16 + *
   44.17 + * You should have received a copy of the GNU Lesser General Public
   44.18 + * License along with this library; if not, write to the Free Software
   44.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   44.20 + */
   44.21 +
   44.22 +#ifndef XEN_VDI_DECL_H
   44.23 +#define XEN_VDI_DECL_H
   44.24 +
   44.25 +typedef void *xen_vdi;
   44.26 +
   44.27 +struct xen_vdi_set;
   44.28 +struct xen_vdi_record;
   44.29 +struct xen_vdi_record_set;
   44.30 +struct xen_vdi_record_opt;
   44.31 +struct xen_vdi_record_opt_set;
   44.32 +
   44.33 +#endif
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/tools/libxen/include/xen/api/xen_vdi_type.h	Sat Apr 21 12:21:06 2007 -0700
    45.3 @@ -0,0 +1,92 @@
    45.4 +/*
    45.5 + * Copyright (c) 2006-2007, XenSource Inc.
    45.6 + *
    45.7 + * This library is free software; you can redistribute it and/or
    45.8 + * modify it under the terms of the GNU Lesser General Public
    45.9 + * License as published by the Free Software Foundation; either
   45.10 + * version 2.1 of the License, or (at your option) any later version.
   45.11 + *
   45.12 + * This library is distributed in the hope that it will be useful,
   45.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   45.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   45.15 + * Lesser General Public License for more details.
   45.16 + *
   45.17 + * You should have received a copy of the GNU Lesser General Public
   45.18 + * License along with this library; if not, write to the Free Software
   45.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   45.20 + */
   45.21 +
   45.22 +#ifndef XEN_VDI_TYPE_H
   45.23 +#define XEN_VDI_TYPE_H
   45.24 +
   45.25 +
   45.26 +#include <xen/api/xen_common.h>
   45.27 +
   45.28 +
   45.29 +enum xen_vdi_type
   45.30 +{
   45.31 +    /**
   45.32 +     * a disk that may be replaced on upgrade
   45.33 +     */
   45.34 +    XEN_VDI_TYPE_SYSTEM,
   45.35 +
   45.36 +    /**
   45.37 +     * a disk that is always preserved on upgrade
   45.38 +     */
   45.39 +    XEN_VDI_TYPE_USER,
   45.40 +
   45.41 +    /**
   45.42 +     * a disk that may be reformatted on upgrade
   45.43 +     */
   45.44 +    XEN_VDI_TYPE_EPHEMERAL,
   45.45 +
   45.46 +    /**
   45.47 +     * a disk that stores a suspend image
   45.48 +     */
   45.49 +    XEN_VDI_TYPE_SUSPEND,
   45.50 +
   45.51 +    /**
   45.52 +     * a disk that stores VM crashdump information
   45.53 +     */
   45.54 +    XEN_VDI_TYPE_CRASHDUMP
   45.55 +};
   45.56 +
   45.57 +
   45.58 +typedef struct xen_vdi_type_set
   45.59 +{
   45.60 +    size_t size;
   45.61 +    enum xen_vdi_type contents[];
   45.62 +} xen_vdi_type_set;
   45.63 +
   45.64 +/**
   45.65 + * Allocate a xen_vdi_type_set of the given size.
   45.66 + */
   45.67 +extern xen_vdi_type_set *
   45.68 +xen_vdi_type_set_alloc(size_t size);
   45.69 +
   45.70 +/**
   45.71 + * Free the given xen_vdi_type_set.  The given set must have been
   45.72 + * allocated by this library.
   45.73 + */
   45.74 +extern void
   45.75 +xen_vdi_type_set_free(xen_vdi_type_set *set);
   45.76 +
   45.77 +
   45.78 +/**
   45.79 + * Return the name corresponding to the given code.  This string must
   45.80 + * not be modified or freed.
   45.81 + */
   45.82 +extern const char *
   45.83 +xen_vdi_type_to_string(enum xen_vdi_type val);
   45.84 +
   45.85 +
   45.86 +/**
   45.87 + * Return the correct code for the given string, or set the session
   45.88 + * object to failure and return an undefined value if the given string does
   45.89 + * not match a known code.
   45.90 + */
   45.91 +extern enum xen_vdi_type
   45.92 +xen_vdi_type_from_string(xen_session *session, const char *str);
   45.93 +
   45.94 +
   45.95 +#endif
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/tools/libxen/include/xen/api/xen_vif.h	Sat Apr 21 12:21:06 2007 -0700
    46.3 @@ -0,0 +1,365 @@
    46.4 +/*
    46.5 + * Copyright (c) 2006-2007, XenSource Inc.
    46.6 + *
    46.7 + * This library is free software; you can redistribute it and/or
    46.8 + * modify it under the terms of the GNU Lesser General Public
    46.9 + * License as published by the Free Software Foundation; either
   46.10 + * version 2.1 of the License, or (at your option) any later version.
   46.11 + *
   46.12 + * This library is distributed in the hope that it will be useful,
   46.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   46.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   46.15 + * Lesser General Public License for more details.
   46.16 + *
   46.17 + * You should have received a copy of the GNU Lesser General Public
   46.18 + * License along with this library; if not, write to the Free Software
   46.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   46.20 + */
   46.21 +
   46.22 +#ifndef XEN_VIF_H
   46.23 +#define XEN_VIF_H
   46.24 +
   46.25 +#include <xen/api/xen_common.h>
   46.26 +#include <xen/api/xen_network_decl.h>
   46.27 +#include <xen/api/xen_string_set.h>
   46.28 +#include <xen/api/xen_string_string_map.h>
   46.29 +#include <xen/api/xen_vif_decl.h>
   46.30 +#include <xen/api/xen_vif_metrics_decl.h>
   46.31 +#include <xen/api/xen_vm_decl.h>
   46.32 +
   46.33 +
   46.34 +/*
   46.35 + * The VIF class.
   46.36 + * 
   46.37 + * A virtual network interface.
   46.38 + */
   46.39 +
   46.40 +
   46.41 +/**
   46.42 + * Free the given xen_vif.  The given handle must have been allocated
   46.43 + * by this library.
   46.44 + */
   46.45 +extern void
   46.46 +xen_vif_free(xen_vif vif);
   46.47 +
   46.48 +
   46.49 +typedef struct xen_vif_set
   46.50 +{
   46.51 +    size_t size;
   46.52 +    xen_vif *contents[];
   46.53 +} xen_vif_set;
   46.54 +
   46.55 +/**
   46.56 + * Allocate a xen_vif_set of the given size.
   46.57 + */
   46.58 +extern xen_vif_set *
   46.59 +xen_vif_set_alloc(size_t size);
   46.60 +
   46.61 +/**
   46.62 + * Free the given xen_vif_set.  The given set must have been allocated
   46.63 + * by this library.
   46.64 + */
   46.65 +extern void
   46.66 +xen_vif_set_free(xen_vif_set *set);
   46.67 +
   46.68 +
   46.69 +typedef struct xen_vif_record
   46.70 +{
   46.71 +    xen_vif handle;
   46.72 +    char *uuid;
   46.73 +    char *device;
   46.74 +    struct xen_network_record_opt *network;
   46.75 +    struct xen_vm_record_opt *vm;
   46.76 +    char *mac;
   46.77 +    int64_t mtu;
   46.78 +    bool currently_attached;
   46.79 +    int64_t status_code;
   46.80 +    char *status_detail;
   46.81 +    xen_string_string_map *runtime_properties;
   46.82 +    char *qos_algorithm_type;
   46.83 +    xen_string_string_map *qos_algorithm_params;
   46.84 +    struct xen_string_set *qos_supported_algorithms;
   46.85 +    struct xen_vif_metrics_record_opt *metrics;
   46.86 +} xen_vif_record;
   46.87 +
   46.88 +/**
   46.89 + * Allocate a xen_vif_record.
   46.90 + */
   46.91 +extern xen_vif_record *
   46.92 +xen_vif_record_alloc(void);
   46.93 +
   46.94 +/**
   46.95 + * Free the given xen_vif_record, and all referenced values.  The given
   46.96 + * record must have been allocated by this library.
   46.97 + */
   46.98 +extern void
   46.99 +xen_vif_record_free(xen_vif_record *record);
  46.100 +
  46.101 +
  46.102 +typedef struct xen_vif_record_opt
  46.103 +{
  46.104 +    bool is_record;
  46.105 +    union
  46.106 +    {
  46.107 +        xen_vif handle;
  46.108 +        xen_vif_record *record;
  46.109 +    } u;
  46.110 +} xen_vif_record_opt;
  46.111 +
  46.112 +/**
  46.113 + * Allocate a xen_vif_record_opt.
  46.114 + */
  46.115 +extern xen_vif_record_opt *
  46.116 +xen_vif_record_opt_alloc(void);
  46.117 +
  46.118 +/**
  46.119 + * Free the given xen_vif_record_opt, and all referenced values.  The
  46.120 + * given record_opt must have been allocated by this library.
  46.121 + */
  46.122 +extern void
  46.123 +xen_vif_record_opt_free(xen_vif_record_opt *record_opt);
  46.124 +
  46.125 +
  46.126 +typedef struct xen_vif_record_set
  46.127 +{
  46.128 +    size_t size;
  46.129 +    xen_vif_record *contents[];
  46.130 +} xen_vif_record_set;
  46.131 +
  46.132 +/**
  46.133 + * Allocate a xen_vif_record_set of the given size.
  46.134 + */
  46.135 +extern xen_vif_record_set *
  46.136 +xen_vif_record_set_alloc(size_t size);
  46.137 +
  46.138 +/**
  46.139 + * Free the given xen_vif_record_set, and all referenced values.  The
  46.140 + * given set must have been allocated by this library.
  46.141 + */
  46.142 +extern void
  46.143 +xen_vif_record_set_free(xen_vif_record_set *set);
  46.144 +
  46.145 +
  46.146 +
  46.147 +typedef struct xen_vif_record_opt_set
  46.148 +{
  46.149 +    size_t size;
  46.150 +    xen_vif_record_opt *contents[];
  46.151 +} xen_vif_record_opt_set;
  46.152 +
  46.153 +/**
  46.154 + * Allocate a xen_vif_record_opt_set of the given size.
  46.155 + */
  46.156 +extern xen_vif_record_opt_set *
  46.157 +xen_vif_record_opt_set_alloc(size_t size);
  46.158 +
  46.159 +/**
  46.160 + * Free the given xen_vif_record_opt_set, and all referenced values. 
  46.161 + * The given set must have been allocated by this library.
  46.162 + */
  46.163 +extern void
  46.164 +xen_vif_record_opt_set_free(xen_vif_record_opt_set *set);
  46.165 +
  46.166 +
  46.167 +/**
  46.168 + * Get a record containing the current state of the given VIF.
  46.169 + */
  46.170 +extern bool
  46.171 +xen_vif_get_record(xen_session *session, xen_vif_record **result, xen_vif vif);
  46.172 +
  46.173 +
  46.174 +/**
  46.175 + * Get a reference to the VIF instance with the specified UUID.
  46.176 + */
  46.177 +extern bool
  46.178 +xen_vif_get_by_uuid(xen_session *session, xen_vif *result, char *uuid);
  46.179 +
  46.180 +
  46.181 +/**
  46.182 + * Create a new VIF instance, and return its handle.
  46.183 + */
  46.184 +extern bool
  46.185 +xen_vif_create(xen_session *session, xen_vif *result, xen_vif_record *record);
  46.186 +
  46.187 +
  46.188 +/**
  46.189 + * Destroy the specified VIF instance.
  46.190 + */
  46.191 +extern bool
  46.192 +xen_vif_destroy(xen_session *session, xen_vif vif);
  46.193 +
  46.194 +
  46.195 +/**
  46.196 + * Get the uuid field of the given VIF.
  46.197 + */
  46.198 +extern bool
  46.199 +xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif);
  46.200 +
  46.201 +
  46.202 +/**
  46.203 + * Get the device field of the given VIF.
  46.204 + */
  46.205 +extern bool
  46.206 +xen_vif_get_device(xen_session *session, char **result, xen_vif vif);
  46.207 +
  46.208 +
  46.209 +/**
  46.210 + * Get the network field of the given VIF.
  46.211 + */
  46.212 +extern bool
  46.213 +xen_vif_get_network(xen_session *session, xen_network *result, xen_vif vif);
  46.214 +
  46.215 +
  46.216 +/**
  46.217 + * Get the VM field of the given VIF.
  46.218 + */
  46.219 +extern bool
  46.220 +xen_vif_get_vm(xen_session *session, xen_vm *result, xen_vif vif);
  46.221 +
  46.222 +
  46.223 +/**
  46.224 + * Get the MAC field of the given VIF.
  46.225 + */
  46.226 +extern bool
  46.227 +xen_vif_get_mac(xen_session *session, char **result, xen_vif vif);
  46.228 +
  46.229 +
  46.230 +/**
  46.231 + * Get the MTU field of the given VIF.
  46.232 + */
  46.233 +extern bool
  46.234 +xen_vif_get_mtu(xen_session *session, int64_t *result, xen_vif vif);
  46.235 +
  46.236 +
  46.237 +/**
  46.238 + * Get the currently_attached field of the given VIF.
  46.239 + */
  46.240 +extern bool
  46.241 +xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif);
  46.242 +
  46.243 +
  46.244 +/**
  46.245 + * Get the status_code field of the given VIF.
  46.246 + */
  46.247 +extern bool
  46.248 +xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif);
  46.249 +
  46.250 +
  46.251 +/**
  46.252 + * Get the status_detail field of the given VIF.
  46.253 + */
  46.254 +extern bool
  46.255 +xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif);
  46.256 +
  46.257 +
  46.258 +/**
  46.259 + * Get the runtime_properties field of the given VIF.
  46.260 + */
  46.261 +extern bool
  46.262 +xen_vif_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vif vif);
  46.263 +
  46.264 +
  46.265 +/**
  46.266 + * Get the qos/algorithm_type field of the given VIF.
  46.267 + */
  46.268 +extern bool
  46.269 +xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif);
  46.270 +
  46.271 +
  46.272 +/**
  46.273 + * Get the qos/algorithm_params field of the given VIF.
  46.274 + */
  46.275 +extern bool
  46.276 +xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif);
  46.277 +
  46.278 +
  46.279 +/**
  46.280 + * Get the qos/supported_algorithms field of the given VIF.
  46.281 + */
  46.282 +extern bool
  46.283 +xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif);
  46.284 +
  46.285 +
  46.286 +/**
  46.287 + * Get the metrics field of the given VIF.
  46.288 + */
  46.289 +extern bool
  46.290 +xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif);
  46.291 +
  46.292 +
  46.293 +/**
  46.294 + * Set the device field of the given VIF.
  46.295 + */
  46.296 +extern bool
  46.297 +xen_vif_set_device(xen_session *session, xen_vif vif, char *device);
  46.298 +
  46.299 +
  46.300 +/**
  46.301 + * Set the MAC field of the given VIF.
  46.302 + */
  46.303 +extern bool
  46.304 +xen_vif_set_mac(xen_session *session, xen_vif vif, char *mac);
  46.305 +
  46.306 +
  46.307 +/**
  46.308 + * Set the MTU field of the given VIF.
  46.309 + */
  46.310 +extern bool
  46.311 +xen_vif_set_mtu(xen_session *session, xen_vif vif, int64_t mtu);
  46.312 +
  46.313 +
  46.314 +/**
  46.315 + * Set the qos/algorithm_type field of the given VIF.
  46.316 + */
  46.317 +extern bool
  46.318 +xen_vif_set_qos_algorithm_type(xen_session *session, xen_vif vif, char *algorithm_type);
  46.319 +
  46.320 +
  46.321 +/**
  46.322 + * Set the qos/algorithm_params field of the given VIF.
  46.323 + */
  46.324 +extern bool
  46.325 +xen_vif_set_qos_algorithm_params(xen_session *session, xen_vif vif, xen_string_string_map *algorithm_params);
  46.326 +
  46.327 +
  46.328 +/**
  46.329 + * Add the given key-value pair to the qos/algorithm_params field of
  46.330 + * the given VIF.
  46.331 + */
  46.332 +extern bool
  46.333 +xen_vif_add_to_qos_algorithm_params(xen_session *session, xen_vif vif, char *key, char *value);
  46.334 +
  46.335 +
  46.336 +/**
  46.337 + * Remove the given key and its corresponding value from the
  46.338 + * qos/algorithm_params field of the given VIF.  If the key is not in that
  46.339 + * Map, then do nothing.
  46.340 + */
  46.341 +extern bool
  46.342 +xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key);
  46.343 +
  46.344 +
  46.345 +/**
  46.346 + * Hotplug the specified VIF, dynamically attaching it to the running
  46.347 + * VM.
  46.348 + */
  46.349 +extern bool
  46.350 +xen_vif_plug(xen_session *session, xen_vif self);
  46.351 +
  46.352 +
  46.353 +/**
  46.354 + * Hot-unplug the specified VIF, dynamically unattaching it from the
  46.355 + * running VM.
  46.356 + */
  46.357 +extern bool
  46.358 +xen_vif_unplug(xen_session *session, xen_vif self);
  46.359 +
  46.360 +
  46.361 +/**
  46.362 + * Return a list of all the VIFs known to the system.
  46.363 + */
  46.364 +extern bool
  46.365 +xen_vif_get_all(xen_session *session, struct xen_vif_set **result);
  46.366 +
  46.367 +
  46.368 +#endif
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/tools/libxen/include/xen/api/xen_vif_decl.h	Sat Apr 21 12:21:06 2007 -0700
    47.3 @@ -0,0 +1,30 @@
    47.4 +/*
    47.5 + * Copyright (c) 2006-2007, XenSource Inc.
    47.6 + *
    47.7 + * This library is free software; you can redistribute it and/or
    47.8 + * modify it under the terms of the GNU Lesser General Public
    47.9 + * License as published by the Free Software Foundation; either
   47.10 + * version 2.1 of the License, or (at your option) any later version.
   47.11 + *
   47.12 + * This library is distributed in the hope that it will be useful,
   47.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   47.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   47.15 + * Lesser General Public License for more details.
   47.16 + *
   47.17 + * You should have received a copy of the GNU Lesser General Public
   47.18 + * License along with this library; if not, write to the Free Software
   47.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   47.20 + */
   47.21 +
   47.22 +#ifndef XEN_VIF_DECL_H
   47.23 +#define XEN_VIF_DECL_H
   47.24 +
   47.25 +typedef void *xen_vif;
   47.26 +
   47.27 +struct xen_vif_set;
   47.28 +struct xen_vif_record;
   47.29 +struct xen_vif_record_set;
   47.30 +struct xen_vif_record_opt;
   47.31 +struct xen_vif_record_opt_set;
   47.32 +
   47.33 +#endif
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/tools/libxen/include/xen/api/xen_vif_metrics.h	Sat Apr 21 12:21:06 2007 -0700
    48.3 @@ -0,0 +1,198 @@
    48.4 +/*
    48.5 + * Copyright (c) 2006-2007, XenSource Inc.
    48.6 + *
    48.7 + * This library is free software; you can redistribute it and/or
    48.8 + * modify it under the terms of the GNU Lesser General Public
    48.9 + * License as published by the Free Software Foundation; either
   48.10 + * version 2.1 of the License, or (at your option) any later version.
   48.11 + *
   48.12 + * This library is distributed in the hope that it will be useful,
   48.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   48.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   48.15 + * Lesser General Public License for more details.
   48.16 + *
   48.17 + * You should have received a copy of the GNU Lesser General Public
   48.18 + * License along with this library; if not, write to the Free Software
   48.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   48.20 + */
   48.21 +
   48.22 +#ifndef XEN_VIF_METRICS_H
   48.23 +#define XEN_VIF_METRICS_H
   48.24 +
   48.25 +#include <xen/api/xen_common.h>
   48.26 +#include <xen/api/xen_vif_metrics_decl.h>
   48.27 +
   48.28 +
   48.29 +/*
   48.30 + * The VIF_metrics class.
   48.31 + * 
   48.32 + * The metrics associated with a virtual network device.
   48.33 + */
   48.34 +
   48.35 +
   48.36 +/**
   48.37 + * Free the given xen_vif_metrics.  The given handle must have been
   48.38 + * allocated by this library.
   48.39 + */
   48.40 +extern void
   48.41 +xen_vif_metrics_free(xen_vif_metrics vif_metrics);
   48.42 +
   48.43 +
   48.44 +typedef struct xen_vif_metrics_set
   48.45 +{
   48.46 +    size_t size;
   48.47 +    xen_vif_metrics *contents[];
   48.48 +} xen_vif_metrics_set;
   48.49 +
   48.50 +/**
   48.51 + * Allocate a xen_vif_metrics_set of the given size.
   48.52 + */
   48.53 +extern xen_vif_metrics_set *
   48.54 +xen_vif_metrics_set_alloc(size_t size);
   48.55 +
   48.56 +/**
   48.57 + * Free the given xen_vif_metrics_set.  The given set must have been
   48.58 + * allocated by this library.
   48.59 + */
   48.60 +extern void
   48.61 +xen_vif_metrics_set_free(xen_vif_metrics_set *set);
   48.62 +
   48.63 +
   48.64 +typedef struct xen_vif_metrics_record
   48.65 +{
   48.66 +    xen_vif_metrics handle;
   48.67 +    char *uuid;
   48.68 +    double io_read_kbs;
   48.69 +    double io_write_kbs;
   48.70 +    time_t last_updated;
   48.71 +} xen_vif_metrics_record;
   48.72 +
   48.73 +/**
   48.74 + * Allocate a xen_vif_metrics_record.
   48.75 + */
   48.76 +extern xen_vif_metrics_record *
   48.77 +xen_vif_metrics_record_alloc(void);
   48.78 +
   48.79 +/**
   48.80 + * Free the given xen_vif_metrics_record, and all referenced values. 
   48.81 + * The given record must have been allocated by this library.
   48.82 + */
   48.83 +extern void
   48.84 +xen_vif_metrics_record_free(xen_vif_metrics_record *record);
   48.85 +
   48.86 +
   48.87 +typedef struct xen_vif_metrics_record_opt
   48.88 +{
   48.89 +    bool is_record;
   48.90 +    union
   48.91 +    {
   48.92 +        xen_vif_metrics handle;
   48.93 +        xen_vif_metrics_record *record;
   48.94 +    } u;
   48.95 +} xen_vif_metrics_record_opt;
   48.96 +
   48.97 +/**
   48.98 + * Allocate a xen_vif_metrics_record_opt.
   48.99 + */
  48.100 +extern xen_vif_metrics_record_opt *
  48.101 +xen_vif_metrics_record_opt_alloc(void);
  48.102 +
  48.103 +/**
  48.104 + * Free the given xen_vif_metrics_record_opt, and all referenced
  48.105 + * values.  The given record_opt must have been allocated by this library.
  48.106 + */
  48.107 +extern void
  48.108 +xen_vif_metrics_record_opt_free(xen_vif_metrics_record_opt *record_opt);
  48.109 +
  48.110 +
  48.111 +typedef struct xen_vif_metrics_record_set
  48.112 +{
  48.113 +    size_t size;
  48.114 +    xen_vif_metrics_record *contents[];
  48.115 +} xen_vif_metrics_record_set;
  48.116 +
  48.117 +/**
  48.118 + * Allocate a xen_vif_metrics_record_set of the given size.
  48.119 + */
  48.120 +extern xen_vif_metrics_record_set *
  48.121 +xen_vif_metrics_record_set_alloc(size_t size);
  48.122 +
  48.123 +/**
  48.124 + * Free the given xen_vif_metrics_record_set, and all referenced
  48.125 + * values.  The given set must have been allocated by this library.
  48.126 + */
  48.127 +extern void
  48.128 +xen_vif_metrics_record_set_free(xen_vif_metrics_record_set *set);
  48.129 +
  48.130 +
  48.131 +
  48.132 +typedef struct xen_vif_metrics_record_opt_set
  48.133 +{
  48.134 +    size_t size;
  48.135 +    xen_vif_metrics_record_opt *contents[];
  48.136 +} xen_vif_metrics_record_opt_set;
  48.137 +
  48.138 +/**
  48.139 + * Allocate a xen_vif_metrics_record_opt_set of the given size.
  48.140 + */
  48.141 +extern xen_vif_metrics_record_opt_set *
  48.142 +xen_vif_metrics_record_opt_set_alloc(size_t size);
  48.143 +
  48.144 +/**
  48.145 + * Free the given xen_vif_metrics_record_opt_set, and all referenced
  48.146 + * values.  The given set must have been allocated by this library.
  48.147 + */
  48.148 +extern void
  48.149 +xen_vif_metrics_record_opt_set_free(xen_vif_metrics_record_opt_set *set);
  48.150 +
  48.151 +
  48.152 +/**
  48.153 + * Get a record containing the current state of the given VIF_metrics.
  48.154 + */
  48.155 +extern bool
  48.156 +xen_vif_metrics_get_record(xen_session *session, xen_vif_metrics_record **result, xen_vif_metrics vif_metrics);
  48.157 +
  48.158 +
  48.159 +/**
  48.160 + * Get a reference to the VIF_metrics instance with the specified UUID.
  48.161 + */
  48.162 +extern bool
  48.163 +xen_vif_metrics_get_by_uuid(xen_session *session, xen_vif_metrics *result, char *uuid);
  48.164 +
  48.165 +
  48.166 +/**
  48.167 + * Get the uuid field of the given VIF_metrics.
  48.168 + */
  48.169 +extern bool
  48.170 +xen_vif_metrics_get_uuid(xen_session *session, char **result, xen_vif_metrics vif_metrics);
  48.171 +
  48.172 +
  48.173 +/**
  48.174 + * Get the io/read_kbs field of the given VIF_metrics.
  48.175 + */
  48.176 +extern bool
  48.177 +xen_vif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
  48.178 +
  48.179 +
  48.180 +/**
  48.181 + * Get the io/write_kbs field of the given VIF_metrics.
  48.182 + */
  48.183 +extern bool
  48.184 +xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
  48.185 +
  48.186 +
  48.187 +/**
  48.188 + * Get the last_updated field of the given VIF_metrics.
  48.189 + */
  48.190 +extern bool
  48.191 +xen_vif_metrics_get_last_updated(xen_session *session, time_t *result, xen_vif_metrics vif_metrics);
  48.192 +
  48.193 +
  48.194 +/**
  48.195 + * Return a list of all the VIF_metrics instances known to the system.
  48.196 + */
  48.197 +extern bool
  48.198 +xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result);
  48.199 +
  48.200 +
  48.201 +#endif
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/tools/libxen/include/xen/api/xen_vif_metrics_decl.h	Sat Apr 21 12:21:06 2007 -0700
    49.3 @@ -0,0 +1,30 @@
    49.4 +/*
    49.5 + * Copyright (c) 2006-2007, XenSource Inc.
    49.6 + *
    49.7 + * This library is free software; you can redistribute it and/or
    49.8 + * modify it under the terms of the GNU Lesser General Public
    49.9 + * License as published by the Free Software Foundation; either
   49.10 + * version 2.1 of the License, or (at your option) any later version.
   49.11 + *
   49.12 + * This library is distributed in the hope that it will be useful,
   49.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   49.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   49.15 + * Lesser General Public License for more details.
   49.16 + *
   49.17 + * You should have received a copy of the GNU Lesser General Public
   49.18 + * License along with this library; if not, write to the Free Software
   49.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   49.20 + */
   49.21 +
   49.22 +#ifndef XEN_VIF_METRICS_DECL_H
   49.23 +#define XEN_VIF_METRICS_DECL_H
   49.24 +
   49.25 +typedef void *xen_vif_metrics;
   49.26 +
   49.27 +struct xen_vif_metrics_set;
   49.28 +struct xen_vif_metrics_record;
   49.29 +struct xen_vif_metrics_record_set;
   49.30 +struct xen_vif_metrics_record_opt;
   49.31 +struct xen_vif_metrics_record_opt_set;
   49.32 +
   49.33 +#endif
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/tools/libxen/include/xen/api/xen_vm.h	Sat Apr 21 12:21:06 2007 -0700
    50.3 @@ -0,0 +1,894 @@
    50.4 +/*
    50.5 + * Copyright (c) 2006-2007, XenSource Inc.
    50.6 + *
    50.7 + * This library is free software; you can redistribute it and/or
    50.8 + * modify it under the terms of the GNU Lesser General Public
    50.9 + * License as published by the Free Software Foundation; either
   50.10 + * version 2.1 of the License, or (at your option) any later version.
   50.11 + *
   50.12 + * This library is distributed in the hope that it will be useful,
   50.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   50.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   50.15 + * Lesser General Public License for more details.
   50.16 + *
   50.17 + * You should have received a copy of the GNU Lesser General Public
   50.18 + * License along with this library; if not, write to the Free Software
   50.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   50.20 + */
   50.21 +
   50.22 +#ifndef XEN_VM_H
   50.23 +#define XEN_VM_H
   50.24 +
   50.25 +#include <xen/api/xen_common.h>
   50.26 +#include <xen/api/xen_console_decl.h>
   50.27 +#include <xen/api/xen_crashdump_decl.h>
   50.28 +#include <xen/api/xen_host_decl.h>
   50.29 +#include <xen/api/xen_on_crash_behaviour.h>
   50.30 +#include <xen/api/xen_on_normal_exit.h>
   50.31 +#include <xen/api/xen_string_string_map.h>
   50.32 +#include <xen/api/xen_vbd_decl.h>
   50.33 +#include <xen/api/xen_vdi_decl.h>
   50.34 +#include <xen/api/xen_vif_decl.h>
   50.35 +#include <xen/api/xen_vm_decl.h>
   50.36 +#include <xen/api/xen_vm_guest_metrics_decl.h>
   50.37 +#include <xen/api/xen_vm_metrics_decl.h>
   50.38 +#include <xen/api/xen_vm_power_state.h>
   50.39 +#include <xen/api/xen_vtpm_decl.h>
   50.40 +
   50.41 +
   50.42 +/*
   50.43 + * The VM class.
   50.44 + * 
   50.45 + * A virtual machine (or 'guest').
   50.46 + */
   50.47 +
   50.48 +
   50.49 +/**
   50.50 + * Free the given xen_vm.  The given handle must have been allocated by
   50.51 + * this library.
   50.52 + */
   50.53 +extern void
   50.54 +xen_vm_free(xen_vm vm);
   50.55 +
   50.56 +
   50.57 +typedef struct xen_vm_set
   50.58 +{
   50.59 +    size_t size;
   50.60 +    xen_vm *contents[];
   50.61 +} xen_vm_set;
   50.62 +
   50.63 +/**
   50.64 + * Allocate a xen_vm_set of the given size.
   50.65 + */
   50.66 +extern xen_vm_set *
   50.67 +xen_vm_set_alloc(size_t size);
   50.68 +
   50.69 +/**
   50.70 + * Free the given xen_vm_set.  The given set must have been allocated
   50.71 + * by this library.
   50.72 + */
   50.73 +extern void
   50.74 +xen_vm_set_free(xen_vm_set *set);
   50.75 +
   50.76 +
   50.77 +typedef struct xen_vm_record
   50.78 +{
   50.79 +    xen_vm handle;
   50.80 +    char *uuid;
   50.81 +    enum xen_vm_power_state power_state;
   50.82 +    char *name_label;
   50.83 +    char *name_description;
   50.84 +    int64_t user_version;
   50.85 +    bool is_a_template;
   50.86 +    bool auto_power_on;
   50.87 +    struct xen_vdi_record_opt *suspend_vdi;
   50.88 +    struct xen_host_record_opt *resident_on;
   50.89 +    int64_t memory_static_max;
   50.90 +    int64_t memory_dynamic_max;
   50.91 +    int64_t memory_dynamic_min;
   50.92 +    int64_t memory_static_min;
   50.93 +    xen_string_string_map *vcpus_params;
   50.94 +    int64_t vcpus_max;
   50.95 +    int64_t vcpus_at_startup;
   50.96 +    enum xen_on_normal_exit actions_after_shutdown;
   50.97 +    enum xen_on_normal_exit actions_after_reboot;
   50.98 +    enum xen_on_crash_behaviour actions_after_crash;
   50.99 +    struct xen_console_record_opt_set *consoles;
  50.100 +    struct xen_vif_record_opt_set *vifs;
  50.101 +    struct xen_vbd_record_opt_set *vbds;
  50.102 +    struct xen_crashdump_record_opt_set *crash_dumps;
  50.103 +    struct xen_vtpm_record_opt_set *vtpms;
  50.104 +    char *pv_bootloader;
  50.105 +    char *pv_kernel;
  50.106 +    char *pv_ramdisk;
  50.107 +    char *pv_args;
  50.108 +    char *pv_bootloader_args;
  50.109 +    char *hvm_boot_policy;
  50.110 +    xen_string_string_map *hvm_boot_params;
  50.111 +    xen_string_string_map *platform;
  50.112 +    char *pci_bus;
  50.113 +    xen_string_string_map *other_config;
  50.114 +    int64_t domid;
  50.115 +    bool is_control_domain;
  50.116 +    struct xen_vm_metrics_record_opt *metrics;
  50.117 +    struct xen_vm_guest_metrics_record_opt *guest_metrics;
  50.118 +} xen_vm_record;
  50.119 +
  50.120 +/**
  50.121 + * Allocate a xen_vm_record.
  50.122 + */
  50.123 +extern xen_vm_record *
  50.124 +xen_vm_record_alloc(void);
  50.125 +
  50.126 +/**
  50.127 + * Free the given xen_vm_record, and all referenced values.  The given
  50.128 + * record must have been allocated by this library.
  50.129 + */
  50.130 +extern void
  50.131 +xen_vm_record_free(xen_vm_record *record);
  50.132 +
  50.133 +
  50.134 +typedef struct xen_vm_record_opt
  50.135 +{
  50.136 +    bool is_record;
  50.137 +    union
  50.138 +    {
  50.139 +        xen_vm handle;
  50.140 +        xen_vm_record *record;
  50.141 +    } u;
  50.142 +} xen_vm_record_opt;
  50.143 +
  50.144 +/**
  50.145 + * Allocate a xen_vm_record_opt.
  50.146 + */
  50.147 +extern xen_vm_record_opt *
  50.148 +xen_vm_record_opt_alloc(void);
  50.149 +
  50.150 +/**
  50.151 + * Free the given xen_vm_record_opt, and all referenced values.  The
  50.152 + * given record_opt must have been allocated by this library.
  50.153 + */
  50.154 +extern void
  50.155 +xen_vm_record_opt_free(xen_vm_record_opt *record_opt);
  50.156 +
  50.157 +
  50.158 +typedef struct xen_vm_record_set
  50.159 +{
  50.160 +    size_t size;
  50.161 +    xen_vm_record *contents[];
  50.162 +} xen_vm_record_set;
  50.163 +
  50.164 +/**
  50.165 + * Allocate a xen_vm_record_set of the given size.
  50.166 + */
  50.167 +extern xen_vm_record_set *
  50.168 +xen_vm_record_set_alloc(size_t size);
  50.169 +
  50.170 +/**
  50.171 + * Free the given xen_vm_record_set, and all referenced values.  The
  50.172 + * given set must have been allocated by this library.
  50.173 + */
  50.174 +extern void
  50.175 +xen_vm_record_set_free(xen_vm_record_set *set);
  50.176 +
  50.177 +
  50.178 +
  50.179 +typedef struct xen_vm_record_opt_set
  50.180 +{
  50.181 +    size_t size;
  50.182 +    xen_vm_record_opt *contents[];
  50.183 +} xen_vm_record_opt_set;
  50.184 +
  50.185 +/**
  50.186 + * Allocate a xen_vm_record_opt_set of the given size.
  50.187 + */
  50.188 +extern xen_vm_record_opt_set *
  50.189 +xen_vm_record_opt_set_alloc(size_t size);
  50.190 +
  50.191 +/**
  50.192 + * Free the given xen_vm_record_opt_set, and all referenced values. 
  50.193 + * The given set must have been allocated by this library.
  50.194 + */
  50.195 +extern void
  50.196 +xen_vm_record_opt_set_free(xen_vm_record_opt_set *set);
  50.197 +
  50.198 +
  50.199 +/**
  50.200 + * Get a record containing the current state of the given VM.
  50.201 + */
  50.202 +extern bool
  50.203 +xen_vm_get_record(xen_session *session, xen_vm_record **result, xen_vm vm);
  50.204 +
  50.205 +
  50.206 +/**
  50.207 + * Get a reference to the VM instance with the specified UUID.
  50.208 + */
  50.209 +extern bool
  50.210 +xen_vm_get_by_uuid(xen_session *session, xen_vm *result, char *uuid);
  50.211 +
  50.212 +
  50.213 +/**
  50.214 + * Create a new VM instance, and return its handle.
  50.215 + */
  50.216 +extern bool
  50.217 +xen_vm_create(xen_session *session, xen_vm *result, xen_vm_record *record);
  50.218 +
  50.219 +
  50.220 +/**
  50.221 + * Destroy the specified VM.  The VM is completely removed from the
  50.222 + * system.  This function can only be called when the VM is in the Halted
  50.223 + * State.
  50.224 + */
  50.225 +extern bool
  50.226 +xen_vm_destroy(xen_session *session, xen_vm vm);
  50.227 +
  50.228 +
  50.229 +/**
  50.230 + * Get all the VM instances with the given label.
  50.231 + */
  50.232 +extern bool
  50.233 +xen_vm_get_by_name_label(xen_session *session, struct xen_vm_set **result, char *label);
  50.234 +
  50.235 +
  50.236 +/**
  50.237 + * Get the uuid field of the given VM.
  50.238 + */
  50.239 +extern bool
  50.240 +xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm);
  50.241 +
  50.242 +
  50.243 +/**
  50.244 + * Get the power_state field of the given VM.
  50.245 + */
  50.246 +extern bool
  50.247 +xen_vm_get_power_state(xen_session *session, enum xen_vm_power_state *result, xen_vm vm);
  50.248 +
  50.249 +
  50.250 +/**
  50.251 + * Get the name/label field of the given VM.
  50.252 + */
  50.253 +extern bool
  50.254 +xen_vm_get_name_label(xen_session *session, char **result, xen_vm vm);
  50.255 +
  50.256 +
  50.257 +/**
  50.258 + * Get the name/description field of the given VM.
  50.259 + */
  50.260 +extern bool
  50.261 +xen_vm_get_name_description(xen_session *session, char **result, xen_vm vm);
  50.262 +
  50.263 +
  50.264 +/**
  50.265 + * Get the user_version field of the given VM.
  50.266 + */
  50.267 +extern bool
  50.268 +xen_vm_get_user_version(xen_session *session, int64_t *result, xen_vm vm);
  50.269 +
  50.270 +
  50.271 +/**
  50.272 + * Get the is_a_template field of the given VM.
  50.273 + */
  50.274 +extern bool
  50.275 +xen_vm_get_is_a_template(xen_session *session, bool *result, xen_vm vm);
  50.276 +
  50.277 +
  50.278 +/**
  50.279 + * Get the auto_power_on field of the given VM.
  50.280 + */
  50.281 +extern bool
  50.282 +xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
  50.283 +
  50.284 +
  50.285 +/**
  50.286 + * Get the suspend_VDI field of the given VM.
  50.287 + */
  50.288 +extern bool
  50.289 +xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm);
  50.290 +
  50.291 +
  50.292 +/**
  50.293 + * Get the resident_on field of the given VM.
  50.294 + */
  50.295 +extern bool
  50.296 +xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm);
  50.297 +
  50.298 +
  50.299 +/**
  50.300 + * Get the memory/static_max field of the given VM.
  50.301 + */
  50.302 +extern bool
  50.303 +xen_vm_get_memory_static_max(xen_session *session, int64_t *result, xen_vm vm);
  50.304 +
  50.305 +
  50.306 +/**
  50.307 + * Get the memory/dynamic_max field of the given VM.
  50.308 + */
  50.309 +extern bool
  50.310 +xen_vm_get_memory_dynamic_max(xen_session *session, int64_t *result, xen_vm vm);
  50.311 +
  50.312 +
  50.313 +/**
  50.314 + * Get the memory/dynamic_min field of the given VM.
  50.315 + */
  50.316 +extern bool
  50.317 +xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm);
  50.318 +
  50.319 +
  50.320 +/**
  50.321 + * Get the memory/static_min field of the given VM.
  50.322 + */
  50.323 +extern bool
  50.324 +xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm);
  50.325 +
  50.326 +
  50.327 +/**
  50.328 + * Get the VCPUs/params field of the given VM.
  50.329 + */
  50.330 +extern bool
  50.331 +xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
  50.332 +
  50.333 +
  50.334 +/**
  50.335 + * Get the VCPUs/max field of the given VM.
  50.336 + */
  50.337 +extern bool
  50.338 +xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm);
  50.339 +
  50.340 +
  50.341 +/**
  50.342 + * Get the VCPUs/at_startup field of the given VM.
  50.343 + */
  50.344 +extern bool
  50.345 +xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm);
  50.346 +
  50.347 +
  50.348 +/**
  50.349 + * Get the actions/after_shutdown field of the given VM.
  50.350 + */
  50.351 +extern bool
  50.352 +xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
  50.353 +
  50.354 +
  50.355 +/**
  50.356 + * Get the actions/after_reboot field of the given VM.
  50.357 + */
  50.358 +extern bool
  50.359 +xen_vm_get_actions_after_reboot(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
  50.360 +
  50.361 +
  50.362 +/**
  50.363 + * Get the actions/after_crash field of the given VM.
  50.364 + */
  50.365 +extern bool
  50.366 +xen_vm_get_actions_after_crash(xen_session *session, enum xen_on_crash_behaviour *result, xen_vm vm);
  50.367 +
  50.368 +
  50.369 +/**
  50.370 + * Get the consoles field of the given VM.
  50.371 + */
  50.372 +extern bool
  50.373 +xen_vm_get_consoles(xen_session *session, struct xen_console_set **result, xen_vm vm);
  50.374 +
  50.375 +
  50.376 +/**
  50.377 + * Get the VIFs field of the given VM.
  50.378 + */
  50.379 +extern bool
  50.380 +xen_vm_get_vifs(xen_session *session, struct xen_vif_set **result, xen_vm vm);
  50.381 +
  50.382 +
  50.383 +/**
  50.384 + * Get the VBDs field of the given VM.
  50.385 + */
  50.386 +extern bool
  50.387 +xen_vm_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vm vm);
  50.388 +
  50.389 +
  50.390 +/**
  50.391 + * Get the crash_dumps field of the given VM.
  50.392 + */
  50.393 +extern bool
  50.394 +xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm);
  50.395 +
  50.396 +
  50.397 +/**
  50.398 + * Get the VTPMs field of the given VM.
  50.399 + */
  50.400 +extern bool
  50.401 +xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
  50.402 +
  50.403 +
  50.404 +/**
  50.405 + * Get the PV/bootloader field of the given VM.
  50.406 + */
  50.407 +extern bool
  50.408 +xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm);
  50.409 +
  50.410 +
  50.411 +/**
  50.412 + * Get the PV/kernel field of the given VM.
  50.413 + */
  50.414 +extern bool
  50.415 +xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm);
  50.416 +
  50.417 +
  50.418 +/**
  50.419 + * Get the PV/ramdisk field of the given VM.
  50.420 + */
  50.421 +extern bool
  50.422 +xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm);
  50.423 +
  50.424 +
  50.425 +/**
  50.426 + * Get the PV/args field of the given VM.
  50.427 + */
  50.428 +extern bool
  50.429 +xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm);
  50.430 +
  50.431 +
  50.432 +/**
  50.433 + * Get the PV/bootloader_args field of the given VM.
  50.434 + */
  50.435 +extern bool
  50.436 +xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm);
  50.437 +
  50.438 +
  50.439 +/**
  50.440 + * Get the HVM/boot_policy field of the given VM.
  50.441 + */
  50.442 +extern bool
  50.443 +xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm);
  50.444 +
  50.445 +
  50.446 +/**
  50.447 + * Get the HVM/boot_params field of the given VM.
  50.448 + */
  50.449 +extern bool
  50.450 +xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
  50.451 +
  50.452 +
  50.453 +/**
  50.454 + * Get the platform field of the given VM.
  50.455 + */
  50.456 +extern bool
  50.457 +xen_vm_get_platform(xen_session *session, xen_string_string_map **result, xen_vm vm);
  50.458 +
  50.459 +
  50.460 +/**
  50.461 + * Get the PCI_bus field of the given VM.
  50.462 + */
  50.463 +extern bool
  50.464 +xen_vm_get_pci_bus(xen_session *session, char **result, xen_vm vm);
  50.465 +
  50.466 +
  50.467 +/**
  50.468 + * Get the other_config field of the given VM.
  50.469 + */
  50.470 +extern bool
  50.471 +xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, xen_vm vm);
  50.472 +
  50.473 +
  50.474 +/**
  50.475 + * Get the domid field of the given VM.
  50.476 + */
  50.477 +extern bool
  50.478 +xen_vm_get_domid(xen_session *session, int64_t *result, xen_vm vm);
  50.479 +
  50.480 +
  50.481 +/**
  50.482 + * Get the is_control_domain field of the given VM.
  50.483 + */
  50.484 +extern bool
  50.485 +xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
  50.486 +
  50.487 +
  50.488 +/**
  50.489 + * Get the metrics field of the given VM.
  50.490 + */
  50.491 +extern bool
  50.492 +xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm);
  50.493 +
  50.494 +
  50.495 +/**
  50.496 + * Get the guest_metrics field of the given VM.
  50.497 + */
  50.498 +extern bool
  50.499 +xen_vm_get_guest_metrics(xen_session *session, xen_vm_guest_metrics *result, xen_vm vm);
  50.500 +
  50.501 +
  50.502 +/**
  50.503 + * Set the name/label field of the given VM.
  50.504 + */
  50.505 +extern bool
  50.506 +xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label);
  50.507 +
  50.508 +
  50.509 +/**
  50.510 + * Set the name/description field of the given VM.
  50.511 + */
  50.512 +extern bool
  50.513 +xen_vm_set_name_description(xen_session *session, xen_vm vm, char *description);
  50.514 +
  50.515 +
  50.516 +/**
  50.517 + * Set the user_version field of the given VM.
  50.518 + */
  50.519 +extern bool
  50.520 +xen_vm_set_user_version(xen_session *session, xen_vm vm, int64_t user_version);
  50.521 +
  50.522 +
  50.523 +/**
  50.524 + * Set the is_a_template field of the given VM.
  50.525 + */
  50.526 +extern bool
  50.527 +xen_vm_set_is_a_template(xen_session *session, xen_vm vm, bool is_a_template);
  50.528 +
  50.529 +
  50.530 +/**
  50.531 + * Set the auto_power_on field of the given VM.
  50.532 + */
  50.533 +extern bool
  50.534 +xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
  50.535 +
  50.536 +
  50.537 +/**
  50.538 + * Set the memory/static_max field of the given VM.
  50.539 + */
  50.540 +extern bool
  50.541 +xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max);
  50.542 +
  50.543 +
  50.544 +/**
  50.545 + * Set the memory/dynamic_max field of the given VM.
  50.546 + */
  50.547 +extern bool
  50.548 +xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max);
  50.549 +
  50.550 +
  50.551 +/**
  50.552 + * Set the memory/dynamic_min field of the given VM.
  50.553 + */
  50.554 +extern bool
  50.555 +xen_vm_set_memory_dynamic_min(xen_session *session, xen_vm vm, int64_t dynamic_min);
  50.556 +
  50.557 +
  50.558 +/**
  50.559 + * Set the memory/static_min field of the given VM.
  50.560 + */
  50.561 +extern bool
  50.562 +xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min);
  50.563 +
  50.564 +
  50.565 +/**
  50.566 + * Set the VCPUs/params field of the given VM.
  50.567 + */
  50.568 +extern bool
  50.569 +xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params);
  50.570 +
  50.571 +
  50.572 +/**
  50.573 + * Add the given key-value pair to the VCPUs/params field of the given
  50.574 + * VM.
  50.575 + */
  50.576 +extern bool
  50.577 +xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value);
  50.578 +
  50.579 +
  50.580 +/**
  50.581 + * Remove the given key and its corresponding value from the
  50.582 + * VCPUs/params field of the given VM.  If the key is not in that Map, then do
  50.583 + * nothing.
  50.584 + */
  50.585 +extern bool
  50.586 +xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key);
  50.587 +
  50.588 +
  50.589 +/**
  50.590 + * Set the VCPUs/max field of the given VM.
  50.591 + */
  50.592 +extern bool
  50.593 +xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max);
  50.594 +
  50.595 +
  50.596 +/**
  50.597 + * Set the VCPUs/at_startup field of the given VM.
  50.598 + */
  50.599 +extern bool
  50.600 +xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup);
  50.601 +
  50.602 +
  50.603 +/**
  50.604 + * Set the actions/after_shutdown field of the given VM.
  50.605 + */
  50.606 +extern bool
  50.607 +xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown);
  50.608 +
  50.609 +
  50.610 +/**
  50.611 + * Set the actions/after_reboot field of the given VM.
  50.612 + */
  50.613 +extern bool
  50.614 +xen_vm_set_actions_after_reboot(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_reboot);
  50.615 +
  50.616 +
  50.617 +/**
  50.618 + * Set the actions/after_crash field of the given VM.
  50.619 + */
  50.620 +extern bool
  50.621 +xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_crash_behaviour after_crash);
  50.622 +
  50.623 +
  50.624 +/**
  50.625 + * Set the PV/bootloader field of the given VM.
  50.626 + */
  50.627 +extern bool
  50.628 +xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader);
  50.629 +
  50.630 +
  50.631 +/**
  50.632 + * Set the PV/kernel field of the given VM.
  50.633 + */
  50.634 +extern bool
  50.635 +xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel);
  50.636 +
  50.637 +
  50.638 +/**
  50.639 + * Set the PV/ramdisk field of the given VM.
  50.640 + */
  50.641 +extern bool
  50.642 +xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk);
  50.643 +
  50.644 +
  50.645 +/**
  50.646 + * Set the PV/args field of the given VM.
  50.647 + */
  50.648 +extern bool
  50.649 +xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args);
  50.650 +
  50.651 +
  50.652 +/**
  50.653 + * Set the PV/bootloader_args field of the given VM.
  50.654 + */
  50.655 +extern bool
  50.656 +xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args);
  50.657 +
  50.658 +
  50.659 +/**
  50.660 + * Set the HVM/boot_policy field of the given VM.
  50.661 + */
  50.662 +extern bool
  50.663 +xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy);
  50.664 +
  50.665 +
  50.666 +/**
  50.667 + * Set the HVM/boot_params field of the given VM.
  50.668 + */
  50.669 +extern bool
  50.670 +xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params);
  50.671 +
  50.672 +
  50.673 +/**
  50.674 + * Add the given key-value pair to the HVM/boot_params field of the
  50.675 + * given VM.
  50.676 + */
  50.677 +extern bool
  50.678 +xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value);
  50.679 +
  50.680 +
  50.681 +/**
  50.682 + * Remove the given key and its corresponding value from the
  50.683 + * HVM/boot_params field of the given VM.  If the key is not in that Map, then
  50.684 + * do nothing.
  50.685 + */
  50.686 +extern bool
  50.687 +xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key);
  50.688 +
  50.689 +
  50.690 +/**
  50.691 + * Set the platform field of the given VM.
  50.692 + */
  50.693 +extern bool
  50.694 +xen_vm_set_platform(xen_session *session, xen_vm vm, xen_string_string_map *platform);
  50.695 +
  50.696 +
  50.697 +/**
  50.698 + * Add the given key-value pair to the platform field of the given VM.
  50.699 + */
  50.700 +extern bool
  50.701 +xen_vm_add_to_platform(xen_session *session, xen_vm vm, char *key, char *value);
  50.702 +
  50.703 +
  50.704 +/**
  50.705 + * Remove the given key and its corresponding value from the platform
  50.706 + * field of the given VM.  If the key is not in that Map, then do nothing.
  50.707 + */
  50.708 +extern bool
  50.709 +xen_vm_remove_from_platform(xen_session *session, xen_vm vm, char *key);
  50.710 +
  50.711 +
  50.712 +/**
  50.713 + * Set the PCI_bus field of the given VM.
  50.714 + */
  50.715 +extern bool
  50.716 +xen_vm_set_pci_bus(xen_session *session, xen_vm vm, char *pci_bus);
  50.717 +
  50.718 +
  50.719 +/**
  50.720 + * Set the other_config field of the given VM.
  50.721 + */
  50.722 +extern bool
  50.723 +xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map *other_config);
  50.724 +
  50.725 +
  50.726 +/**
  50.727 + * Add the given key-value pair to the other_config field of the given
  50.728 + * VM.
  50.729 + */
  50.730 +extern bool
  50.731 +xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char *value);
  50.732 +
  50.733 +
  50.734 +/**
  50.735 + * Remove the given key and its corresponding value from the
  50.736 + * other_config field of the given VM.  If the key is not in that Map, then do
  50.737 + * nothing.
  50.738 + */
  50.739 +extern bool
  50.740 +xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key);
  50.741 +
  50.742 +
  50.743 +/**
  50.744 + * Clones the specified VM, making a new VM. Clone automatically
  50.745 + * exploits the capabilities of the underlying storage repository in which the
  50.746 + * VM's disk images are stored (e.g. Copy on Write).   This function can only
  50.747 + * be called when the VM is in the Halted State.
  50.748 + */
  50.749 +extern bool
  50.750 +xen_vm_clone(xen_session *session, xen_vm *result, xen_vm vm, char *new_name);
  50.751 +
  50.752 +
  50.753 +/**
  50.754 + * Start the specified VM.  This function can only be called with the
  50.755 + * VM is in the Halted State.
  50.756 + */
  50.757 +extern bool
  50.758 +xen_vm_start(xen_session *session, xen_vm vm, bool start_paused);
  50.759 +
  50.760 +
  50.761 +/**
  50.762 + * Pause the specified VM. This can only be called when the specified
  50.763 + * VM is in the Running state.
  50.764 + */
  50.765 +extern bool
  50.766 +xen_vm_pause(xen_session *session, xen_vm vm);
  50.767 +
  50.768 +
  50.769 +/**
  50.770 + * Resume the specified VM. This can only be called when the specified
  50.771 + * VM is in the Paused state.
  50.772 + */
  50.773 +extern bool
  50.774 +xen_vm_unpause(xen_session *session, xen_vm vm);
  50.775 +
  50.776 +
  50.777 +/**
  50.778 + * Attempt to cleanly shutdown the specified VM. (Note: this may not be
  50.779 + * supported---e.g. if a guest agent is not installed).
  50.780 + * 
  50.781 + * Once shutdown has been completed perform poweroff action specified in guest
  50.782 + * configuration.
  50.783 + * 
  50.784 + * This can only be called when the specified VM is in the Running state.
  50.785 + */
  50.786 +extern bool
  50.787 +xen_vm_clean_shutdown(xen_session *session, xen_vm vm);
  50.788 +
  50.789 +
  50.790 +/**
  50.791 + * Attempt to cleanly shutdown the specified VM (Note: this may not be
  50.792 + * supported---e.g. if a guest agent is not installed).
  50.793 + * 
  50.794 + * Once shutdown has been completed perform reboot action specified in guest
  50.795 + * configuration.
  50.796 + * 
  50.797 + * This can only be called when the specified VM is in the Running state.
  50.798 + */
  50.799 +extern bool
  50.800 +xen_vm_clean_reboot(xen_session *session, xen_vm vm);
  50.801 +
  50.802 +
  50.803 +/**
  50.804 + * Stop executing the specified VM without attempting a clean shutdown.
  50.805 + * Then perform poweroff action specified in VM configuration.
  50.806 + */
  50.807 +extern bool
  50.808 +xen_vm_hard_shutdown(xen_session *session, xen_vm vm);
  50.809 +
  50.810 +
  50.811 +/**
  50.812 + * Stop executing the specified VM without attempting a clean shutdown.
  50.813 + * Then perform reboot action specified in VM configuration
  50.814 + */
  50.815 +extern bool
  50.816 +xen_vm_hard_reboot(xen_session *session, xen_vm vm);
  50.817 +
  50.818 +
  50.819 +/**
  50.820 + * Suspend the specified VM to disk.  This can only be called when the
  50.821 + * specified VM is in the Running state.
  50.822 + */
  50.823 +extern bool
  50.824 +xen_vm_suspend(xen_session *session, xen_vm vm);
  50.825 +
  50.826 +
  50.827 +/**
  50.828 + * Awaken the specified VM and resume it.  This can only be called when
  50.829 + * the specified VM is in the Suspended state.
  50.830 + */
  50.831 +extern bool
  50.832 +xen_vm_resume(xen_session *session, xen_vm vm, bool start_paused);
  50.833 +
  50.834 +
  50.835 +/**
  50.836 + * Set this VM's VCPUs/at_startup value, and set the same value on the
  50.837 + * VM, if running
  50.838 + */
  50.839 +extern bool
  50.840 +xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu);
  50.841 +
  50.842 +
  50.843 +/**
  50.844 + * Add the given key-value pair to VM.VCPUs_params, and apply that
  50.845 + * value on the running VM.
  50.846 + */
  50.847 +extern bool
  50.848 +xen_vm_add_to_vcpus_params_live(xen_session *session, xen_vm self, char *key, char *value);
  50.849 +
  50.850 +
  50.851 +/**
  50.852 + * Set memory_dynamic_max in database and on running VM.
  50.853 + */
  50.854 +extern bool
  50.855 +xen_vm_set_memory_dynamic_max_live(xen_session *session, xen_vm self, int64_t max);
  50.856 +
  50.857 +
  50.858 +/**
  50.859 + * Set memory_dynamic_min in database and on running VM.
  50.860 + */
  50.861 +extern bool
  50.862 +xen_vm_set_memory_dynamic_min_live(xen_session *session, xen_vm self, int64_t min);
  50.863 +
  50.864 +
  50.865 +/**
  50.866 + * Send the given key as a sysrq to this VM.  The key is specified as a
  50.867 + * single character (a String of length 1).  This can only be called when the
  50.868 + * specified VM is in the Running state.
  50.869 + */
  50.870 +extern bool
  50.871 +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key);
  50.872 +
  50.873 +
  50.874 +/**
  50.875 + * Send the named trigger to this VM.  This can only be called when the
  50.876 + * specified VM is in the Running state.
  50.877 + */
  50.878 +extern bool
  50.879 +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
  50.880 +
  50.881 +
  50.882 +/**
  50.883 + * Migrate the VM to another host.  This can only be called when the
  50.884 + * specified VM is in the Running state.
  50.885 + */
  50.886 +extern bool
  50.887 +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
  50.888 +
  50.889 +
  50.890 +/**
  50.891 + * Return a list of all the VMs known to the system.
  50.892 + */
  50.893 +extern bool
  50.894 +xen_vm_get_all(xen_session *session, struct xen_vm_set **result);
  50.895 +
  50.896 +
  50.897 +#endif
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/tools/libxen/include/xen/api/xen_vm_decl.h	Sat Apr 21 12:21:06 2007 -0700
    51.3 @@ -0,0 +1,30 @@
    51.4 +/*
    51.5 + * Copyright (c) 2006-2007, XenSource Inc.
    51.6 + *
    51.7 + * This library is free software; you can redistribute it and/or
    51.8 + * modify it under the terms of the GNU Lesser General Public
    51.9 + * License as published by the Free Software Foundation; either
   51.10 + * version 2.1 of the License, or (at your option) any later version.
   51.11 + *
   51.12 + * This library is distributed in the hope that it will be useful,
   51.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   51.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   51.15 + * Lesser General Public License for more details.
   51.16 + *
   51.17 + * You should have received a copy of the GNU Lesser General Public
   51.18 + * License along with this library; if not, write to the Free Software
   51.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   51.20 + */
   51.21 +
   51.22 +#ifndef XEN_VM_DECL_H
   51.23 +#define XEN_VM_DECL_H
   51.24 +
   51.25 +typedef void *xen_vm;
   51.26 +
   51.27 +struct xen_vm_set;
   51.28 +struct xen_vm_record;
   51.29 +struct xen_vm_record_set;
   51.30 +struct xen_vm_record_opt;
   51.31 +struct xen_vm_record_opt_set;
   51.32 +
   51.33 +#endif
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/tools/libxen/include/xen/api/xen_vm_guest_metrics.h	Sat Apr 21 12:21:06 2007 -0700
    52.3 @@ -0,0 +1,234 @@
    52.4 +/*
    52.5 + * Copyright (c) 2006-2007, XenSource Inc.
    52.6 + *
    52.7 + * This library is free software; you can redistribute it and/or
    52.8 + * modify it under the terms of the GNU Lesser General Public
    52.9 + * License as published by the Free Software Foundation; either
   52.10 + * version 2.1 of the License, or (at your option) any later version.
   52.11 + *
   52.12 + * This library is distributed in the hope that it will be useful,
   52.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   52.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   52.15 + * Lesser General Public License for more details.
   52.16 + *
   52.17 + * You should have received a copy of the GNU Lesser General Public
   52.18 + * License along with this library; if not, write to the Free Software
   52.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   52.20 + */
   52.21 +
   52.22 +#ifndef XEN_VM_GUEST_METRICS_H
   52.23 +#define XEN_VM_GUEST_METRICS_H
   52.24 +
   52.25 +#include <xen/api/xen_common.h>
   52.26 +#include <xen/api/xen_string_string_map.h>
   52.27 +#include <xen/api/xen_vm_guest_metrics_decl.h>
   52.28 +
   52.29 +
   52.30 +/*
   52.31 + * The VM_guest_metrics class.
   52.32 + * 
   52.33 + * The metrics reported by the guest (as opposed to inferred from outside).
   52.34 + */
   52.35 +
   52.36 +
   52.37 +/**
   52.38 + * Free the given xen_vm_guest_metrics.  The given handle must have
   52.39 + * been allocated by this library.
   52.40 + */
   52.41 +extern void
   52.42 +xen_vm_guest_metrics_free(xen_vm_guest_metrics vm_guest_metrics);
   52.43 +
   52.44 +
   52.45 +typedef struct xen_vm_guest_metrics_set
   52.46 +{
   52.47 +    size_t size;
   52.48 +    xen_vm_guest_metrics *contents[];
   52.49 +} xen_vm_guest_metrics_set;
   52.50 +
   52.51 +/**
   52.52 + * Allocate a xen_vm_guest_metrics_set of the given size.
   52.53 + */
   52.54 +extern xen_vm_guest_metrics_set *
   52.55 +xen_vm_guest_metrics_set_alloc(size_t size);
   52.56 +
   52.57 +/**
   52.58 + * Free the given xen_vm_guest_metrics_set.  The given set must have
   52.59 + * been allocated by this library.
   52.60 + */
   52.61 +extern void
   52.62 +xen_vm_guest_metrics_set_free(xen_vm_guest_metrics_set *set);
   52.63 +
   52.64 +
   52.65 +typedef struct xen_vm_guest_metrics_record
   52.66 +{
   52.67 +    xen_vm_guest_metrics handle;
   52.68 +    char *uuid;
   52.69 +    xen_string_string_map *os_version;
   52.70 +    xen_string_string_map *pv_drivers_version;
   52.71 +    xen_string_string_map *memory;
   52.72 +    xen_string_string_map *disks;
   52.73 +    xen_string_string_map *networks;
   52.74 +    xen_string_string_map *other;
   52.75 +    time_t last_updated;
   52.76 +} xen_vm_guest_metrics_record;
   52.77 +
   52.78 +/**
   52.79 + * Allocate a xen_vm_guest_metrics_record.
   52.80 + */
   52.81 +extern xen_vm_guest_metrics_record *
   52.82 +xen_vm_guest_metrics_record_alloc(void);
   52.83 +
   52.84 +/**
   52.85 + * Free the given xen_vm_guest_metrics_record, and all referenced
   52.86 + * values.  The given record must have been allocated by this library.
   52.87 + */
   52.88 +extern void
   52.89 +xen_vm_guest_metrics_record_free(xen_vm_guest_metrics_record *record);
   52.90 +
   52.91 +
   52.92 +typedef struct xen_vm_guest_metrics_record_opt
   52.93 +{
   52.94 +    bool is_record;
   52.95 +    union
   52.96 +    {
   52.97 +        xen_vm_guest_metrics handle;
   52.98 +        xen_vm_guest_metrics_record *record;
   52.99 +    } u;
  52.100 +} xen_vm_guest_metrics_record_opt;
  52.101 +
  52.102 +/**
  52.103 + * Allocate a xen_vm_guest_metrics_record_opt.
  52.104 + */
  52.105 +extern xen_vm_guest_metrics_record_opt *
  52.106 +xen_vm_guest_metrics_record_opt_alloc(void);
  52.107 +
  52.108 +/**
  52.109 + * Free the given xen_vm_guest_metrics_record_opt, and all referenced
  52.110 + * values.  The given record_opt must have been allocated by this library.
  52.111 + */
  52.112 +extern void
  52.113 +xen_vm_guest_metrics_record_opt_free(xen_vm_guest_metrics_record_opt *record_opt);
  52.114 +
  52.115 +
  52.116 +typedef struct xen_vm_guest_metrics_record_set
  52.117 +{
  52.118 +    size_t size;
  52.119 +    xen_vm_guest_metrics_record *contents[];
  52.120 +} xen_vm_guest_metrics_record_set;
  52.121 +
  52.122 +/**
  52.123 + * Allocate a xen_vm_guest_metrics_record_set of the given size.
  52.124 + */
  52.125 +extern xen_vm_guest_metrics_record_set *
  52.126 +xen_vm_guest_metrics_record_set_alloc(size_t size);
  52.127 +
  52.128 +/**
  52.129 + * Free the given xen_vm_guest_metrics_record_set, and all referenced
  52.130 + * values.  The given set must have been allocated by this library.
  52.131 + */
  52.132 +extern void
  52.133 +xen_vm_guest_metrics_record_set_free(xen_vm_guest_metrics_record_set *set);
  52.134 +
  52.135 +
  52.136 +
  52.137 +typedef struct xen_vm_guest_metrics_record_opt_set
  52.138 +{
  52.139 +    size_t size;
  52.140 +    xen_vm_guest_metrics_record_opt *contents[];
  52.141 +} xen_vm_guest_metrics_record_opt_set;
  52.142 +
  52.143 +/**
  52.144 + * Allocate a xen_vm_guest_metrics_record_opt_set of the given size.
  52.145 + */
  52.146 +extern xen_vm_guest_metrics_record_opt_set *
  52.147 +xen_vm_guest_metrics_record_opt_set_alloc(size_t size);
  52.148 +
  52.149 +/**
  52.150 + * Free the given xen_vm_guest_metrics_record_opt_set, and all
  52.151 + * referenced values.  The given set must have been allocated by this library.
  52.152 + */
  52.153 +extern void
  52.154 +xen_vm_guest_metrics_record_opt_set_free(xen_vm_guest_metrics_record_opt_set *set);
  52.155 +
  52.156 +
  52.157 +/**
  52.158 + * Get a record containing the current state of the given
  52.159 + * VM_guest_metrics.
  52.160 + */
  52.161 +extern bool
  52.162 +xen_vm_guest_metrics_get_record(xen_session *session, xen_vm_guest_metrics_record **result, xen_vm_guest_metrics vm_guest_metrics);
  52.163 +
  52.164 +
  52.165 +/**
  52.166 + * Get a reference to the VM_guest_metrics instance with the specified
  52.167 + * UUID.
  52.168 + */
  52.169 +extern bool
  52.170 +xen_vm_guest_metrics_get_by_uuid(xen_session *session, xen_vm_guest_metrics *result, char *uuid);
  52.171 +
  52.172 +
  52.173 +/**
  52.174 + * Get the uuid field of the given VM_guest_metrics.
  52.175 + */
  52.176 +extern bool
  52.177 +xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics);
  52.178 +
  52.179 +
  52.180 +/**
  52.181 + * Get the os_version field of the given VM_guest_metrics.
  52.182 + */
  52.183 +extern bool
  52.184 +xen_vm_guest_metrics_get_os_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  52.185 +
  52.186 +
  52.187 +/**
  52.188 + * Get the PV_drivers_version field of the given VM_guest_metrics.
  52.189 + */
  52.190 +extern bool
  52.191 +xen_vm_guest_metrics_get_pv_drivers_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  52.192 +
  52.193 +
  52.194 +/**
  52.195 + * Get the memory field of the given VM_guest_metrics.
  52.196 + */
  52.197 +extern bool
  52.198 +xen_vm_guest_metrics_get_memory(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  52.199 +
  52.200 +
  52.201 +/**
  52.202 + * Get the disks field of the given VM_guest_metrics.
  52.203 + */
  52.204 +extern bool
  52.205 +xen_vm_guest_metrics_get_disks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  52.206 +
  52.207 +
  52.208 +/**
  52.209 + * Get the networks field of the given VM_guest_metrics.
  52.210 + */
  52.211 +extern bool
  52.212 +xen_vm_guest_metrics_get_networks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  52.213 +
  52.214 +
  52.215 +/**
  52.216 + * Get the other field of the given VM_guest_metrics.
  52.217 + */
  52.218 +extern bool
  52.219 +xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  52.220 +
  52.221 +
  52.222 +/**
  52.223 + * Get the last_updated field of the given VM_guest_metrics.
  52.224 + */
  52.225 +extern bool
  52.226 +xen_vm_guest_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_guest_metrics vm_guest_metrics);
  52.227 +
  52.228 +
  52.229 +/**
  52.230 + * Return a list of all the VM_guest_metrics instances known to the
  52.231 + * system.
  52.232 + */
  52.233 +extern bool
  52.234 +xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result);
  52.235 +
  52.236 +
  52.237 +#endif
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/tools/libxen/include/xen/api/xen_vm_guest_metrics_decl.h	Sat Apr 21 12:21:06 2007 -0700
    53.3 @@ -0,0 +1,30 @@
    53.4 +/*
    53.5 + * Copyright (c) 2006-2007, XenSource Inc.
    53.6 + *
    53.7 + * This library is free software; you can redistribute it and/or
    53.8 + * modify it under the terms of the GNU Lesser General Public
    53.9 + * License as published by the Free Software Foundation; either
   53.10 + * version 2.1 of the License, or (at your option) any later version.
   53.11 + *
   53.12 + * This library is distributed in the hope that it will be useful,
   53.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   53.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   53.15 + * Lesser General Public License for more details.
   53.16 + *
   53.17 + * You should have received a copy of the GNU Lesser General Public
   53.18 + * License along with this library; if not, write to the Free Software
   53.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   53.20 + */
   53.21 +
   53.22 +#ifndef XEN_VM_GUEST_METRICS_DECL_H
   53.23 +#define XEN_VM_GUEST_METRICS_DECL_H
   53.24 +
   53.25 +typedef void *xen_vm_guest_metrics;
   53.26 +
   53.27 +struct xen_vm_guest_metrics_set;
   53.28 +struct xen_vm_guest_metrics_record;
   53.29 +struct xen_vm_guest_metrics_record_set;
   53.30 +struct xen_vm_guest_metrics_record_opt;
   53.31 +struct xen_vm_guest_metrics_record_opt_set;
   53.32 +
   53.33 +#endif
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/tools/libxen/include/xen/api/xen_vm_metrics.h	Sat Apr 21 12:21:06 2007 -0700
    54.3 @@ -0,0 +1,251 @@
    54.4 +/*
    54.5 + * Copyright (c) 2006-2007, XenSource Inc.
    54.6 + *
    54.7 + * This library is free software; you can redistribute it and/or
    54.8 + * modify it under the terms of the GNU Lesser General Public
    54.9 + * License as published by the Free Software Foundation; either
   54.10 + * version 2.1 of the License, or (at your option) any later version.
   54.11 + *
   54.12 + * This library is distributed in the hope that it will be useful,
   54.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   54.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   54.15 + * Lesser General Public License for more details.
   54.16 + *
   54.17 + * You should have received a copy of the GNU Lesser General Public
   54.18 + * License along with this library; if not, write to the Free Software
   54.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   54.20 + */
   54.21 +
   54.22 +#ifndef XEN_VM_METRICS_H
   54.23 +#define XEN_VM_METRICS_H
   54.24 +
   54.25 +#include <xen/api/xen_common.h>
   54.26 +#include <xen/api/xen_int_float_map.h>
   54.27 +#include <xen/api/xen_int_int_map.h>
   54.28 +#include <xen/api/xen_int_string_set_map.h>
   54.29 +#include <xen/api/xen_string_set.h>
   54.30 +#include <xen/api/xen_string_string_map.h>
   54.31 +#include <xen/api/xen_vm_metrics_decl.h>
   54.32 +
   54.33 +
   54.34 +/*
   54.35 + * The VM_metrics class.
   54.36 + * 
   54.37 + * The metrics associated with a VM.
   54.38 + */
   54.39 +
   54.40 +
   54.41 +/**
   54.42 + * Free the given xen_vm_metrics.  The given handle must have been
   54.43 + * allocated by this library.
   54.44 + */
   54.45 +extern void
   54.46 +xen_vm_metrics_free(xen_vm_metrics vm_metrics);
   54.47 +
   54.48 +
   54.49 +typedef struct xen_vm_metrics_set
   54.50 +{
   54.51 +    size_t size;
   54.52 +    xen_vm_metrics *contents[];
   54.53 +} xen_vm_metrics_set;
   54.54 +
   54.55 +/**
   54.56 + * Allocate a xen_vm_metrics_set of the given size.
   54.57 + */
   54.58 +extern xen_vm_metrics_set *
   54.59 +xen_vm_metrics_set_alloc(size_t size);
   54.60 +
   54.61 +/**
   54.62 + * Free the given xen_vm_metrics_set.  The given set must have been
   54.63 + * allocated by this library.
   54.64 + */
   54.65 +extern void
   54.66 +xen_vm_metrics_set_free(xen_vm_metrics_set *set);
   54.67 +
   54.68 +
   54.69 +typedef struct xen_vm_metrics_record
   54.70 +{
   54.71 +    xen_vm_metrics handle;
   54.72 +    char *uuid;
   54.73 +    int64_t memory_actual;
   54.74 +    int64_t vcpus_number;
   54.75 +    xen_int_float_map *vcpus_utilisation;
   54.76 +    xen_int_int_map *vcpus_cpu;
   54.77 +    xen_string_string_map *vcpus_params;
   54.78 +    xen_int_string_set_map *vcpus_flags;
   54.79 +    struct xen_string_set *state;
   54.80 +    time_t start_time;
   54.81 +    time_t last_updated;
   54.82 +} xen_vm_metrics_record;
   54.83 +
   54.84 +/**
   54.85 + * Allocate a xen_vm_metrics_record.
   54.86 + */
   54.87 +extern xen_vm_metrics_record *
   54.88 +xen_vm_metrics_record_alloc(void);
   54.89 +
   54.90 +/**
   54.91 + * Free the given xen_vm_metrics_record, and all referenced values. 
   54.92 + * The given record must have been allocated by this library.
   54.93 + */
   54.94 +extern void
   54.95 +xen_vm_metrics_record_free(xen_vm_metrics_record *record);
   54.96 +
   54.97 +
   54.98 +typedef struct xen_vm_metrics_record_opt
   54.99 +{
  54.100 +    bool is_record;
  54.101 +    union
  54.102 +    {
  54.103 +        xen_vm_metrics handle;
  54.104 +        xen_vm_metrics_record *record;
  54.105 +    } u;
  54.106 +} xen_vm_metrics_record_opt;
  54.107 +
  54.108 +/**
  54.109 + * Allocate a xen_vm_metrics_record_opt.
  54.110 + */
  54.111 +extern xen_vm_metrics_record_opt *
  54.112 +xen_vm_metrics_record_opt_alloc(void);
  54.113 +
  54.114 +/**
  54.115 + * Free the given xen_vm_metrics_record_opt, and all referenced values.
  54.116 + *  The given record_opt must have been allocated by this library.
  54.117 + */
  54.118 +extern void
  54.119 +xen_vm_metrics_record_opt_free(xen_vm_metrics_record_opt *record_opt);
  54.120 +
  54.121 +
  54.122 +typedef struct xen_vm_metrics_record_set
  54.123 +{
  54.124 +    size_t size;
  54.125 +    xen_vm_metrics_record *contents[];
  54.126 +} xen_vm_metrics_record_set;
  54.127 +
  54.128 +/**
  54.129 + * Allocate a xen_vm_metrics_record_set of the given size.
  54.130 + */
  54.131 +extern xen_vm_metrics_record_set *
  54.132 +xen_vm_metrics_record_set_alloc(size_t size);
  54.133 +
  54.134 +/**
  54.135 + * Free the given xen_vm_metrics_record_set, and all referenced values.
  54.136 + *  The given set must have been allocated by this library.
  54.137 + */
  54.138 +extern void
  54.139 +xen_vm_metrics_record_set_free(xen_vm_metrics_record_set *set);
  54.140 +
  54.141 +
  54.142 +
  54.143 +typedef struct xen_vm_metrics_record_opt_set
  54.144 +{
  54.145 +    size_t size;
  54.146 +    xen_vm_metrics_record_opt *contents[];
  54.147 +} xen_vm_metrics_record_opt_set;
  54.148 +
  54.149 +/**
  54.150 + * Allocate a xen_vm_metrics_record_opt_set of the given size.
  54.151 + */
  54.152 +extern xen_vm_metrics_record_opt_set *
  54.153 +xen_vm_metrics_record_opt_set_alloc(size_t size);
  54.154 +
  54.155 +/**
  54.156 + * Free the given xen_vm_metrics_record_opt_set, and all referenced
  54.157 + * values.  The given set must have been allocated by this library.
  54.158 + */
  54.159 +extern void
  54.160 +xen_vm_metrics_record_opt_set_free(xen_vm_metrics_record_opt_set *set);
  54.161 +
  54.162 +
  54.163 +/**
  54.164 + * Get a record containing the current state of the given VM_metrics.
  54.165 + */
  54.166 +extern bool
  54.167 +xen_vm_metrics_get_record(xen_session *session, xen_vm_metrics_record **result, xen_vm_metrics vm_metrics);
  54.168 +
  54.169 +
  54.170 +/**
  54.171 + * Get a reference to the VM_metrics instance with the specified UUID.
  54.172 + */
  54.173 +extern bool
  54.174 +xen_vm_metrics_get_by_uuid(xen_session *session, xen_vm_metrics *result, char *uuid);
  54.175 +
  54.176 +
  54.177 +/**
  54.178 + * Get the uuid field of the given VM_metrics.
  54.179 + */
  54.180 +extern bool
  54.181 +xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics);
  54.182 +
  54.183 +
  54.184 +/**
  54.185 + * Get the memory/actual field of the given VM_metrics.
  54.186 + */
  54.187 +extern bool
  54.188 +xen_vm_metrics_get_memory_actual(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
  54.189 +
  54.190 +
  54.191 +/**
  54.192 + * Get the VCPUs/number field of the given VM_metrics.
  54.193 + */
  54.194 +extern bool
  54.195 +xen_vm_metrics_get_vcpus_number(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
  54.196 +
  54.197 +
  54.198 +/**
  54.199 + * Get the VCPUs/utilisation field of the given VM_metrics.
  54.200 + */
  54.201 +extern bool
  54.202 +xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics);
  54.203 +
  54.204 +
  54.205 +/**
  54.206 + * Get the VCPUs/CPU field of the given VM_metrics.
  54.207 + */
  54.208 +extern bool
  54.209 +xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, xen_vm_metrics vm_metrics);
  54.210 +
  54.211 +
  54.212 +/**
  54.213 + * Get the VCPUs/params field of the given VM_metrics.
  54.214 + */
  54.215 +extern bool
  54.216 +xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm_metrics vm_metrics);
  54.217 +
  54.218 +
  54.219 +/**
  54.220 + * Get the VCPUs/flags field of the given VM_metrics.
  54.221 + */
  54.222 +extern bool
  54.223 +xen_vm_metrics_get_vcpus_flags(xen_session *session, xen_int_string_set_map **result, xen_vm_metrics vm_metrics);
  54.224 +
  54.225 +
  54.226 +/**
  54.227 + * Get the state field of the given VM_metrics.
  54.228 + */
  54.229 +extern bool
  54.230 +xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result, xen_vm_metrics vm_metrics);
  54.231 +
  54.232 +
  54.233 +/**
  54.234 + * Get the start_time field of the given VM_metrics.
  54.235 + */
  54.236 +extern bool
  54.237 +xen_vm_metrics_get_start_time(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
  54.238 +
  54.239 +
  54.240 +/**
  54.241 + * Get the last_updated field of the given VM_metrics.
  54.242 + */
  54.243 +extern bool
  54.244 +xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
  54.245 +
  54.246 +
  54.247 +/**
  54.248 + * Return a list of all the VM_metrics instances known to the system.
  54.249 + */
  54.250 +extern bool
  54.251 +xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result);
  54.252 +
  54.253 +
  54.254 +#endif
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/tools/libxen/include/xen/api/xen_vm_metrics_decl.h	Sat Apr 21 12:21:06 2007 -0700
    55.3 @@ -0,0 +1,30 @@
    55.4 +/*
    55.5 + * Copyright (c) 2006-2007, XenSource Inc.
    55.6 + *
    55.7 + * This library is free software; you can redistribute it and/or
    55.8 + * modify it under the terms of the GNU Lesser General Public
    55.9 + * License as published by the Free Software Foundation; either
   55.10 + * version 2.1 of the License, or (at your option) any later version.
   55.11 + *
   55.12 + * This library is distributed in the hope that it will be useful,
   55.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   55.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   55.15 + * Lesser General Public License for more details.
   55.16 + *
   55.17 + * You should have received a copy of the GNU Lesser General Public
   55.18 + * License along with this library; if not, write to the Free Software
   55.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   55.20 + */
   55.21 +
   55.22 +#ifndef XEN_VM_METRICS_DECL_H
   55.23 +#define XEN_VM_METRICS_DECL_H
   55.24 +
   55.25 +typedef void *xen_vm_metrics;
   55.26 +
   55.27 +struct xen_vm_metrics_set;
   55.28 +struct xen_vm_metrics_record;
   55.29 +struct xen_vm_metrics_record_set;
   55.30 +struct xen_vm_metrics_record_opt;
   55.31 +struct xen_vm_metrics_record_opt_set;
   55.32 +
   55.33 +#endif
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/tools/libxen/include/xen/api/xen_vm_power_state.h	Sat Apr 21 12:21:06 2007 -0700
    56.3 @@ -0,0 +1,92 @@
    56.4 +/*
    56.5 + * Copyright (c) 2006-2007, XenSource Inc.
    56.6 + *
    56.7 + * This library is free software; you can redistribute it and/or
    56.8 + * modify it under the terms of the GNU Lesser General Public
    56.9 + * License as published by the Free Software Foundation; either
   56.10 + * version 2.1 of the License, or (at your option) any later version.
   56.11 + *
   56.12 + * This library is distributed in the hope that it will be useful,
   56.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   56.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   56.15 + * Lesser General Public License for more details.
   56.16 + *
   56.17 + * You should have received a copy of the GNU Lesser General Public
   56.18 + * License along with this library; if not, write to the Free Software
   56.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   56.20 + */
   56.21 +
   56.22 +#ifndef XEN_VM_POWER_STATE_H
   56.23 +#define XEN_VM_POWER_STATE_H
   56.24 +
   56.25 +
   56.26 +#include <xen/api/xen_common.h>
   56.27 +
   56.28 +
   56.29 +enum xen_vm_power_state
   56.30 +{
   56.31 +    /**
   56.32 +     * Halted
   56.33 +     */
   56.34 +    XEN_VM_POWER_STATE_HALTED,
   56.35 +
   56.36 +    /**
   56.37 +     * Paused
   56.38 +     */
   56.39 +    XEN_VM_POWER_STATE_PAUSED,
   56.40 +
   56.41 +    /**
   56.42 +     * Running
   56.43 +     */
   56.44 +    XEN_VM_POWER_STATE_RUNNING,
   56.45 +
   56.46 +    /**
   56.47 +     * Suspended
   56.48 +     */
   56.49 +    XEN_VM_POWER_STATE_SUSPENDED,
   56.50 +
   56.51 +    /**
   56.52 +     * Some other unknown state
   56.53 +     */
   56.54 +    XEN_VM_POWER_STATE_UNKNOWN
   56.55 +};
   56.56 +
   56.57 +
   56.58 +typedef struct xen_vm_power_state_set
   56.59 +{
   56.60 +    size_t size;
   56.61 +    enum xen_vm_power_state contents[];
   56.62 +} xen_vm_power_state_set;
   56.63 +
   56.64 +/**
   56.65 + * Allocate a xen_vm_power_state_set of the given size.
   56.66 + */
   56.67 +extern xen_vm_power_state_set *
   56.68 +xen_vm_power_state_set_alloc(size_t size);
   56.69 +
   56.70 +/**
   56.71 + * Free the given xen_vm_power_state_set.  The given set must have been
   56.72 + * allocated by this library.
   56.73 + */
   56.74 +extern void
   56.75 +xen_vm_power_state_set_free(xen_vm_power_state_set *set);
   56.76 +
   56.77 +
   56.78 +/**
   56.79 + * Return the name corresponding to the given code.  This string must
   56.80 + * not be modified or freed.
   56.81 + */
   56.82 +extern const char *
   56.83 +xen_vm_power_state_to_string(enum xen_vm_power_state val);
   56.84 +
   56.85 +
   56.86 +/**
   56.87 + * Return the correct code for the given string, or set the session
   56.88 + * object to failure and return an undefined value if the given string does
   56.89 + * not match a known code.
   56.90 + */
   56.91 +extern enum xen_vm_power_state
   56.92 +xen_vm_power_state_from_string(xen_session *session, const char *str);
   56.93 +
   56.94 +
   56.95 +#endif
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/tools/libxen/include/xen/api/xen_vtpm.h	Sat Apr 21 12:21:06 2007 -0700
    57.3 @@ -0,0 +1,199 @@
    57.4 +/*
    57.5 + * Copyright (c) 2006-2007, XenSource Inc.
    57.6 + * Copyright (c) 2006, IBM Corp.
    57.7 + *
    57.8 + * This library is free software; you can redistribute it and/or
    57.9 + * modify it under the terms of the GNU Lesser General Public
   57.10 + * License as published by the Free Software Foundation; either
   57.11 + * version 2.1 of the License, or (at your option) any later version.
   57.12 + *
   57.13 + * This library is distributed in the hope that it will be useful,
   57.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   57.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   57.16 + * Lesser General Public License for more details.
   57.17 + *
   57.18 + * You should have received a copy of the GNU Lesser General Public
   57.19 + * License along with this library; if not, write to the Free Software
   57.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   57.21 + */
   57.22 +
   57.23 +#ifndef XEN_VTPM_H
   57.24 +#define XEN_VTPM_H
   57.25 +
   57.26 +#include <xen/api/xen_common.h>
   57.27 +#include <xen/api/xen_vm_decl.h>
   57.28 +#include <xen/api/xen_vtpm_decl.h>
   57.29 +
   57.30 +
   57.31 +/*
   57.32 + * The VTPM class.
   57.33 + * 
   57.34 + * A virtual TPM device.
   57.35 + */
   57.36 +
   57.37 +
   57.38 +/**
   57.39 + * Free the given xen_vtpm.  The given handle must have been allocated
   57.40 + * by this library.
   57.41 + */
   57.42 +extern void
   57.43 +xen_vtpm_free(xen_vtpm vtpm);
   57.44 +
   57.45 +
   57.46 +typedef struct xen_vtpm_set
   57.47 +{
   57.48 +    size_t size;
   57.49 +    xen_vtpm *contents[];
   57.50 +} xen_vtpm_set;
   57.51 +
   57.52 +/**
   57.53 + * Allocate a xen_vtpm_set of the given size.
   57.54 + */
   57.55 +extern xen_vtpm_set *
   57.56 +xen_vtpm_set_alloc(size_t size);
   57.57 +
   57.58 +/**
   57.59 + * Free the given xen_vtpm_set.  The given set must have been allocated
   57.60 + * by this library.
   57.61 + */
   57.62 +extern void
   57.63 +xen_vtpm_set_free(xen_vtpm_set *set);
   57.64 +
   57.65 +
   57.66 +typedef struct xen_vtpm_record
   57.67 +{
   57.68 +    xen_vtpm handle;
   57.69 +    char *uuid;
   57.70 +    struct xen_vm_record_opt *vm;
   57.71 +    struct xen_vm_record_opt *backend;
   57.72 +} xen_vtpm_record;
   57.73 +
   57.74 +/**
   57.75 + * Allocate a xen_vtpm_record.
   57.76 + */
   57.77 +extern xen_vtpm_record *
   57.78 +xen_vtpm_record_alloc(void);
   57.79 +
   57.80 +/**
   57.81 + * Free the given xen_vtpm_record, and all referenced values.  The
   57.82 + * given record must have been allocated by this library.
   57.83 + */
   57.84 +extern void
   57.85 +xen_vtpm_record_free(xen_vtpm_record *record);
   57.86 +
   57.87 +
   57.88 +typedef struct xen_vtpm_record_opt
   57.89 +{
   57.90 +    bool is_record;
   57.91 +    union
   57.92 +    {
   57.93 +        xen_vtpm handle;
   57.94 +        xen_vtpm_record *record;
   57.95 +    } u;
   57.96 +} xen_vtpm_record_opt;
   57.97 +
   57.98 +/**
   57.99 + * Allocate a xen_vtpm_record_opt.
  57.100 + */
  57.101 +extern xen_vtpm_record_opt *
  57.102 +xen_vtpm_record_opt_alloc(void);
  57.103 +
  57.104 +/**
  57.105 + * Free the given xen_vtpm_record_opt, and all referenced values.  The
  57.106 + * given record_opt must have been allocated by this library.
  57.107 + */
  57.108 +extern void
  57.109 +xen_vtpm_record_opt_free(xen_vtpm_record_opt *record_opt);
  57.110 +
  57.111 +
  57.112 +typedef struct xen_vtpm_record_set
  57.113 +{
  57.114 +    size_t size;
  57.115 +    xen_vtpm_record *contents[];
  57.116 +} xen_vtpm_record_set;
  57.117 +
  57.118 +/**
  57.119 + * Allocate a xen_vtpm_record_set of the given size.
  57.120 + */
  57.121 +extern xen_vtpm_record_set *
  57.122 +xen_vtpm_record_set_alloc(size_t size);
  57.123 +
  57.124 +/**
  57.125 + * Free the given xen_vtpm_record_set, and all referenced values.  The
  57.126 + * given set must have been allocated by this library.
  57.127 + */
  57.128 +extern void
  57.129 +xen_vtpm_record_set_free(xen_vtpm_record_set *set);
  57.130 +
  57.131 +
  57.132 +
  57.133 +typedef struct xen_vtpm_record_opt_set
  57.134 +{
  57.135 +    size_t size;
  57.136 +    xen_vtpm_record_opt *contents[];
  57.137 +} xen_vtpm_record_opt_set;
  57.138 +
  57.139 +/**
  57.140 + * Allocate a xen_vtpm_record_opt_set of the given size.
  57.141 + */
  57.142 +extern xen_vtpm_record_opt_set *
  57.143 +xen_vtpm_record_opt_set_alloc(size_t size);
  57.144 +
  57.145 +/**
  57.146 + * Free the given xen_vtpm_record_opt_set, and all referenced values. 
  57.147 + * The given set must have been allocated by this library.
  57.148 + */
  57.149 +extern void
  57.150 +xen_vtpm_record_opt_set_free(xen_vtpm_record_opt_set *set);
  57.151 +
  57.152 +
  57.153 +/**
  57.154 + * Get a record containing the current state of the given VTPM.
  57.155 + */
  57.156 +extern bool
  57.157 +xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm);
  57.158 +
  57.159 +
  57.160 +/**
  57.161 + * Get a reference to the VTPM instance with the specified UUID.
  57.162 + */
  57.163 +extern bool
  57.164 +xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid);
  57.165 +
  57.166 +
  57.167 +/**
  57.168 + * Create a new VTPM instance, and return its handle.
  57.169 + */
  57.170 +extern bool
  57.171 +xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record);
  57.172 +
  57.173 +
  57.174 +/**
  57.175 + * Destroy the specified VTPM instance.
  57.176 + */
  57.177 +extern bool
  57.178 +xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm);
  57.179 +
  57.180 +
  57.181 +/**
  57.182 + * Get the uuid field of the given VTPM.
  57.183 + */
  57.184 +extern bool
  57.185 +xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm);
  57.186 +
  57.187 +
  57.188 +/**
  57.189 + * Get the VM field of the given VTPM.
  57.190 + */
  57.191 +extern bool
  57.192 +xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm);
  57.193 +
  57.194 +
  57.195 +/**
  57.196 + * Get the backend field of the given VTPM.
  57.197 + */
  57.198 +extern bool
  57.199 +xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
  57.200 +
  57.201 +
  57.202 +#endif
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/tools/libxen/include/xen/api/xen_vtpm_decl.h	Sat Apr 21 12:21:06 2007 -0700
    58.3 @@ -0,0 +1,31 @@
    58.4 +/*
    58.5 + * Copyright (c) 2006, XenSource Inc.
    58.6 + * Copyright (c) 2006, IBM Corp.
    58.7 + *
    58.8 + * This library is free software; you can redistribute it and/or
    58.9 + * modify it under the terms of the GNU Lesser General Public
   58.10 + * License as published by the Free Software Foundation; either
   58.11 + * version 2.1 of the License, or (at your option) any later version.
   58.12 + *
   58.13 + * This library is distributed in the hope that it will be useful,
   58.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   58.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   58.16 + * Lesser General Public License for more details.
   58.17 + *
   58.18 + * You should have received a copy of the GNU Lesser General Public
   58.19 + * License along with this library; if not, write to the Free Software
   58.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   58.21 + */
   58.22 +
   58.23 +#ifndef XEN_VTPM_DECL_H
   58.24 +#define XEN_VTPM_DECL_H
   58.25 +
   58.26 +typedef void *xen_vtpm;
   58.27 +
   58.28 +struct xen_vtpm_set;
   58.29 +struct xen_vtpm_record;
   58.30 +struct xen_vtpm_record_set;
   58.31 +struct xen_vtpm_record_opt;
   58.32 +struct xen_vtpm_record_opt_set;
   58.33 +
   58.34 +#endif
    59.1 --- a/tools/libxen/include/xen_common.h	Mon Apr 16 19:19:07 2007 -0400
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,211 +0,0 @@
    59.4 -/*
    59.5 - * Copyright (c) 2006 XenSource, Inc.
    59.6 - *
    59.7 - * This library is free software; you can redistribute it and/or
    59.8 - * modify it under the terms of the GNU Lesser General Public
    59.9 - * License as published by the Free Software Foundation; either
   59.10 - * version 2.1 of the License, or (at your option) any later version.
   59.11 - *
   59.12 - * This library is distributed in the hope that it will be useful,
   59.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   59.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   59.15 - * Lesser General Public License for more details.
   59.16 - *
   59.17 - * You should have received a copy of the GNU Lesser General Public
   59.18 - * License along with this library; if not, write to the Free Software
   59.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   59.20 - */
   59.21 -
   59.22 -#ifndef XEN_COMMON_H
   59.23 -#define XEN_COMMON_H
   59.24 -
   59.25 -
   59.26 -#include <stdbool.h>
   59.27 -#include <stddef.h>
   59.28 -#include <stdint.h>
   59.29 -#include <time.h>
   59.30 -
   59.31 -#include "xen_host_decl.h"
   59.32 -
   59.33 -
   59.34 -typedef bool (*xen_result_func)(const void *data, size_t len,
   59.35 -                                void *result_handle);
   59.36 -
   59.37 -
   59.38 -/**
   59.39 - * len does not include a terminating \0.
   59.40 - */
   59.41 -typedef int (*xen_call_func)(const void *, size_t len, void *user_handle,
   59.42 -                             void *result_handle,
   59.43 -                             xen_result_func result_func);
   59.44 -
   59.45 -
   59.46 -typedef struct
   59.47 -{
   59.48 -    xen_call_func call_func;
   59.49 -    void *handle;
   59.50 -    const char *session_id;
   59.51 -    bool ok;
   59.52 -    char **error_description;
   59.53 -    int error_description_count;
   59.54 -} xen_session;
   59.55 -
   59.56 -
   59.57 -typedef struct xen_session_record
   59.58 -{
   59.59 -    char *uuid;
   59.60 -    struct xen_host_record_opt *this_host;
   59.61 -    char *this_user;
   59.62 -    time_t last_active;
   59.63 -} xen_session_record;
   59.64 -
   59.65 -
   59.66 -/**
   59.67 - * Allocate a xen_session_record.
   59.68 - */
   59.69 -extern xen_session_record *
   59.70 -xen_session_record_alloc(void);
   59.71 -
   59.72 -
   59.73 -/**
   59.74 - * Free the given xen_session_record, and all referenced values.  The
   59.75 - * given record must have been allocated by this library.
   59.76 - */
   59.77 -extern void
   59.78 -xen_session_record_free(xen_session_record *record);
   59.79 -
   59.80 -
   59.81 -struct xen_task_;
   59.82 -typedef struct xen_task_ * xen_task_id;
   59.83 -
   59.84 -
   59.85 -typedef struct
   59.86 -{
   59.87 -    int progress;
   59.88 -    long eta;
   59.89 -    /* !!! RESULT */
   59.90 -}  xen_task_status;
   59.91 -
   59.92 -
   59.93 -typedef struct
   59.94 -{
   59.95 -    int major;
   59.96 -    int minor;
   59.97 -    int patch;
   59.98 -    char *extraversion;
   59.99 -} xen_version;
  59.100 -
  59.101 -
  59.102 -/**
  59.103 - * Free the given xen_version, and all referenced values.
  59.104 - */
  59.105 -extern void xen_version_free(xen_version *version);
  59.106 -
  59.107 -
  59.108 -/**
  59.109 - * Return the version of this client-side library.  This will be the major,
  59.110 - * minor, and extraversion of the Xen release with which it was released,
  59.111 - * plus the library's own version as the patch.
  59.112 - */
  59.113 -extern xen_version *xen_get_client_side_version();
  59.114 -
  59.115 -
  59.116 -extern bool
  59.117 -xen_uuid_string_to_bytes(char *uuid, char **bytes);
  59.118 -
  59.119 -
  59.120 -extern bool
  59.121 -xen_uuid_bytes_to_string(char *bytes, char **uuid);
  59.122 -
  59.123 -
  59.124 -extern void
  59.125 -xen_uuid_free(char *uuid);
  59.126 -
  59.127 -
  59.128 -extern void
  59.129 -xen_uuid_bytes_free(char *bytes);
  59.130 -
  59.131 -
  59.132 -/**
  59.133 - * Initialise this library.  Call this before starting to use this library.
  59.134 - * Note that since this library depends upon libxml2, you should also call
  59.135 - * xmlInitParser as appropriate for your program.
  59.136 - */
  59.137 -extern
  59.138 -void xen_init(void);
  59.139 -
  59.140 -
  59.141 -/**
  59.142 - * Clear up this library.  Call when you have finished using this library.
  59.143 - * Note that since this library depends upon libxml2, you should also call
  59.144 - * xmlCleanupParser as appropriate for your program.
  59.145 - */
  59.146 -extern
  59.147 -void xen_fini(void);
  59.148 -
  59.149 -
  59.150 -/**
  59.151 - * Log in at the server, and allocate a xen_session to represent this session.
  59.152 - */
  59.153 -extern xen_session *
  59.154 -xen_session_login_with_password(xen_call_func call_func, void *handle,
  59.155 -                                const char *uname, const char *pwd);
  59.156 -
  59.157 -
  59.158 -/**
  59.159 - * Log out at the server, and free the xen_session.
  59.160 - */
  59.161 -extern void
  59.162 -xen_session_logout(xen_session *session);
  59.163 -
  59.164 -
  59.165 -/**
  59.166 - * Clear any error condition recorded on this session.
  59.167 - */
  59.168 -void
  59.169 -xen_session_clear_error(xen_session *session);
  59.170 -
  59.171 -
  59.172 -/**
  59.173 - * Get the UUID of the second given session.  Set *result to point at a
  59.174 - * string, yours to free.
  59.175 - */
  59.176 -extern bool
  59.177 -xen_session_get_uuid(xen_session *session, char **result,
  59.178 -                     xen_session *self_session);
  59.179 -
  59.180 -
  59.181 -/**
  59.182 - * Get the this_host field of the second given session.  Set *result to be a
  59.183 - * handle to that host.
  59.184 - */
  59.185 -extern bool
  59.186 -xen_session_get_this_host(xen_session *session, xen_host *result,
  59.187 -                          xen_session *self_session);
  59.188 -
  59.189 -
  59.190 -/**
  59.191 - * Get the this_user field of the second given session.  Set *result to point
  59.192 - * at a string, yours to free.
  59.193 - */
  59.194 -extern bool
  59.195 -xen_session_get_this_user(xen_session *session, char **result,
  59.196 -                          xen_session *self_session);
  59.197 -
  59.198 -
  59.199 -/**
  59.200 - * Get the last_active field of the given session, and place it in *result.
  59.201 - */
  59.202 -extern bool
  59.203 -xen_session_get_last_active(xen_session *session, time_t *result,
  59.204 -                            xen_session *self_session);
  59.205 -
  59.206 -/**
  59.207 - * Get a record containing the current state of the second given session.
  59.208 - */
  59.209 -extern bool
  59.210 -xen_session_get_record(xen_session *session, xen_session_record **result,
  59.211 -                       xen_session *self_session);
  59.212 -
  59.213 -
  59.214 -#endif
    60.1 --- a/tools/libxen/include/xen_console.h	Mon Apr 16 19:19:07 2007 -0400
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,247 +0,0 @@
    60.4 -/*
    60.5 - * Copyright (c) 2006-2007, XenSource Inc.
    60.6 - *
    60.7 - * This library is free software; you can redistribute it and/or
    60.8 - * modify it under the terms of the GNU Lesser General Public
    60.9 - * License as published by the Free Software Foundation; either
   60.10 - * version 2.1 of the License, or (at your option) any later version.
   60.11 - *
   60.12 - * This library is distributed in the hope that it will be useful,
   60.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   60.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   60.15 - * Lesser General Public License for more details.
   60.16 - *
   60.17 - * You should have received a copy of the GNU Lesser General Public
   60.18 - * License along with this library; if not, write to the Free Software
   60.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   60.20 - */
   60.21 -
   60.22 -#ifndef XEN_CONSOLE_H
   60.23 -#define XEN_CONSOLE_H
   60.24 -
   60.25 -#include "xen_common.h"
   60.26 -#include "xen_console_decl.h"
   60.27 -#include "xen_console_protocol.h"
   60.28 -#include "xen_string_string_map.h"
   60.29 -#include "xen_vm_decl.h"
   60.30 -
   60.31 -
   60.32 -/*
   60.33 - * The console class.
   60.34 - * 
   60.35 - * A console.
   60.36 - */
   60.37 -
   60.38 -
   60.39 -/**
   60.40 - * Free the given xen_console.  The given handle must have been
   60.41 - * allocated by this library.
   60.42 - */
   60.43 -extern void
   60.44 -xen_console_free(xen_console console);
   60.45 -
   60.46 -
   60.47 -typedef struct xen_console_set
   60.48 -{
   60.49 -    size_t size;
   60.50 -    xen_console *contents[];
   60.51 -} xen_console_set;
   60.52 -
   60.53 -/**
   60.54 - * Allocate a xen_console_set of the given size.
   60.55 - */
   60.56 -extern xen_console_set *
   60.57 -xen_console_set_alloc(size_t size);
   60.58 -
   60.59 -/**
   60.60 - * Free the given xen_console_set.  The given set must have been
   60.61 - * allocated by this library.
   60.62 - */
   60.63 -extern void
   60.64 -xen_console_set_free(xen_console_set *set);
   60.65 -
   60.66 -
   60.67 -typedef struct xen_console_record
   60.68 -{
   60.69 -    xen_console handle;
   60.70 -    char *uuid;
   60.71 -    enum xen_console_protocol protocol;
   60.72 -    char *location;
   60.73 -    struct xen_vm_record_opt *vm;
   60.74 -    xen_string_string_map *other_config;
   60.75 -} xen_console_record;
   60.76 -
   60.77 -/**
   60.78 - * Allocate a xen_console_record.
   60.79 - */
   60.80 -extern xen_console_record *
   60.81 -xen_console_record_alloc(void);
   60.82 -
   60.83 -/**
   60.84 - * Free the given xen_console_record, and all referenced values.  The
   60.85 - * given record must have been allocated by this library.
   60.86 - */
   60.87 -extern void
   60.88 -xen_console_record_free(xen_console_record *record);
   60.89 -
   60.90 -
   60.91 -typedef struct xen_console_record_opt
   60.92 -{
   60.93 -    bool is_record;
   60.94 -    union
   60.95 -    {
   60.96 -        xen_console handle;
   60.97 -        xen_console_record *record;
   60.98 -    } u;
   60.99 -} xen_console_record_opt;
  60.100 -
  60.101 -/**
  60.102 - * Allocate a xen_console_record_opt.
  60.103 - */
  60.104 -extern xen_console_record_opt *
  60.105 -xen_console_record_opt_alloc(void);
  60.106 -
  60.107 -/**
  60.108 - * Free the given xen_console_record_opt, and all referenced values. 
  60.109 - * The given record_opt must have been allocated by this library.
  60.110 - */
  60.111 -extern void
  60.112 -xen_console_record_opt_free(xen_console_record_opt *record_opt);
  60.113 -
  60.114 -
  60.115 -typedef struct xen_console_record_set
  60.116 -{
  60.117 -    size_t size;
  60.118 -    xen_console_record *contents[];
  60.119 -} xen_console_record_set;
  60.120 -
  60.121 -/**
  60.122 - * Allocate a xen_console_record_set of the given size.
  60.123 - */
  60.124 -extern xen_console_record_set *
  60.125 -xen_console_record_set_alloc(size_t size);
  60.126 -
  60.127 -/**
  60.128 - * Free the given xen_console_record_set, and all referenced values. 
  60.129 - * The given set must have been allocated by this library.
  60.130 - */
  60.131 -extern void
  60.132 -xen_console_record_set_free(xen_console_record_set *set);
  60.133 -
  60.134 -
  60.135 -
  60.136 -typedef struct xen_console_record_opt_set
  60.137 -{
  60.138 -    size_t size;
  60.139 -    xen_console_record_opt *contents[];
  60.140 -} xen_console_record_opt_set;
  60.141 -
  60.142 -/**
  60.143 - * Allocate a xen_console_record_opt_set of the given size.
  60.144 - */
  60.145 -extern xen_console_record_opt_set *
  60.146 -xen_console_record_opt_set_alloc(size_t size);
  60.147 -
  60.148 -/**
  60.149 - * Free the given xen_console_record_opt_set, and all referenced
  60.150 - * values.  The given set must have been allocated by this library.
  60.151 - */
  60.152 -extern void
  60.153 -xen_console_record_opt_set_free(xen_console_record_opt_set *set);
  60.154 -
  60.155 -
  60.156 -/**
  60.157 - * Get a record containing the current state of the given console.
  60.158 - */
  60.159 -extern bool
  60.160 -xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
  60.161 -
  60.162 -
  60.163 -/**
  60.164 - * Get a reference to the console instance with the specified UUID.
  60.165 - */
  60.166 -extern bool
  60.167 -xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
  60.168 -
  60.169 -
  60.170 -/**
  60.171 - * Create a new console instance, and return its handle.
  60.172 - */
  60.173 -extern bool
  60.174 -xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
  60.175 -
  60.176 -
  60.177 -/**
  60.178 - * Destroy the specified console instance.
  60.179 - */
  60.180 -extern bool
  60.181 -xen_console_destroy(xen_session *session, xen_console console);
  60.182 -
  60.183 -
  60.184 -/**
  60.185 - * Get the uuid field of the given console.
  60.186 - */
  60.187 -extern bool
  60.188 -xen_console_get_uuid(xen_session *session, char **result, xen_console console);
  60.189 -
  60.190 -
  60.191 -/**
  60.192 - * Get the protocol field of the given console.
  60.193 - */
  60.194 -extern bool
  60.195 -xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
  60.196 -
  60.197 -
  60.198 -/**
  60.199 - * Get the location field of the given console.
  60.200 - */
  60.201 -extern bool
  60.202 -xen_console_get_location(xen_session *session, char **result, xen_console console);
  60.203 -
  60.204 -
  60.205 -/**
  60.206 - * Get the VM field of the given console.
  60.207 - */
  60.208 -extern bool
  60.209 -xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
  60.210 -
  60.211 -
  60.212 -/**
  60.213 - * Get the other_config field of the given console.
  60.214 - */
  60.215 -extern bool
  60.216 -xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
  60.217 -
  60.218 -
  60.219 -/**
  60.220 - * Set the other_config field of the given console.
  60.221 - */
  60.222 -extern bool
  60.223 -xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
  60.224 -
  60.225 -
  60.226 -/**
  60.227 - * Add the given key-value pair to the other_config field of the given
  60.228 - * console.
  60.229 - */
  60.230 -extern bool
  60.231 -xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
  60.232 -
  60.233 -
  60.234 -/**
  60.235 - * Remove the given key and its corresponding value from the
  60.236 - * other_config field of the given console.  If the key is not in that Map,
  60.237 - * then do nothing.
  60.238 - */
  60.239 -extern bool
  60.240 -xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
  60.241 -
  60.242 -
  60.243 -/**
  60.244 - * Return a list of all the consoles known to the system.
  60.245 - */
  60.246 -extern bool
  60.247 -xen_console_get_all(xen_session *session, struct xen_console_set **result);
  60.248 -
  60.249 -
  60.250 -#endif
    61.1 --- a/tools/libxen/include/xen_console_decl.h	Mon Apr 16 19:19:07 2007 -0400
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,30 +0,0 @@
    61.4 -/*
    61.5 - * Copyright (c) 2006, XenSource Inc.
    61.6 - *
    61.7 - * This library is free software; you can redistribute it and/or
    61.8 - * modify it under the terms of the GNU Lesser General Public
    61.9 - * License as published by the Free Software Foundation; either
   61.10 - * version 2.1 of the License, or (at your option) any later version.
   61.11 - *
   61.12 - * This library is distributed in the hope that it will be useful,
   61.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   61.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   61.15 - * Lesser General Public License for more details.
   61.16 - *
   61.17 - * You should have received a copy of the GNU Lesser General Public
   61.18 - * License along with this library; if not, write to the Free Software
   61.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   61.20 - */
   61.21 -
   61.22 -#ifndef XEN_CONSOLE_DECL_H
   61.23 -#define XEN_CONSOLE_DECL_H
   61.24 -
   61.25 -typedef void *xen_console;
   61.26 -
   61.27 -struct xen_console_set;
   61.28 -struct xen_console_record;
   61.29 -struct xen_console_record_set;
   61.30 -struct xen_console_record_opt;
   61.31 -struct xen_console_record_opt_set;
   61.32 -
   61.33 -#endif
    62.1 --- a/tools/libxen/include/xen_console_protocol.h	Mon Apr 16 19:19:07 2007 -0400
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,82 +0,0 @@
    62.4 -/*
    62.5 - * Copyright (c) 2006, XenSource Inc.
    62.6 - *
    62.7 - * This library is free software; you can redistribute it and/or
    62.8 - * modify it under the terms of the GNU Lesser General Public
    62.9 - * License as published by the Free Software Foundation; either
   62.10 - * version 2.1 of the License, or (at your option) any later version.
   62.11 - *
   62.12 - * This library is distributed in the hope that it will be useful,
   62.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   62.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   62.15 - * Lesser General Public License for more details.
   62.16 - *
   62.17 - * You should have received a copy of the GNU Lesser General Public
   62.18 - * License along with this library; if not, write to the Free Software
   62.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   62.20 - */
   62.21 -
   62.22 -#ifndef XEN_CONSOLE_PROTOCOL_H
   62.23 -#define XEN_CONSOLE_PROTOCOL_H
   62.24 -
   62.25 -
   62.26 -#include "xen_common.h"
   62.27 -
   62.28 -
   62.29 -enum xen_console_protocol
   62.30 -{
   62.31 -    /**
   62.32 -     * VT100 terminal
   62.33 -     */
   62.34 -    XEN_CONSOLE_PROTOCOL_VT100,
   62.35 -
   62.36 -    /**
   62.37 -     * Remote FrameBuffer protocol (as used in VNC)
   62.38 -     */
   62.39 -    XEN_CONSOLE_PROTOCOL_RFB,
   62.40 -
   62.41 -    /**
   62.42 -     * Remote Desktop Protocol
   62.43 -     */
   62.44 -    XEN_CONSOLE_PROTOCOL_RDP
   62.45 -};
   62.46 -
   62.47 -
   62.48 -typedef struct xen_console_protocol_set
   62.49 -{
   62.50 -    size_t size;
   62.51 -    enum xen_console_protocol contents[];
   62.52 -} xen_console_protocol_set;
   62.53 -
   62.54 -/**
   62.55 - * Allocate a xen_console_protocol_set of the given size.
   62.56 - */
   62.57 -extern xen_console_protocol_set *
   62.58 -xen_console_protocol_set_alloc(size_t size);
   62.59 -
   62.60 -/**
   62.61 - * Free the given xen_console_protocol_set.  The given set must have
   62.62 - * been allocated by this library.
   62.63 - */
   62.64 -extern void
   62.65 -xen_console_protocol_set_free(xen_console_protocol_set *set);
   62.66 -
   62.67 -
   62.68 -/**
   62.69 - * Return the name corresponding to the given code.  This string must
   62.70 - * not be modified or freed.
   62.71 - */
   62.72 -extern const char *
   62.73 -xen_console_protocol_to_string(enum xen_console_protocol val);
   62.74 -
   62.75 -
   62.76 -/**
   62.77 - * Return the correct code for the given string, or set the session
   62.78 - * object to failure and return an undefined value if the given string does
   62.79 - * not match a known code.
   62.80 - */
   62.81 -extern enum xen_console_protocol
   62.82 -xen_console_protocol_from_string(xen_session *session, const char *str);
   62.83 -
   62.84 -
   62.85 -#endif
    63.1 --- a/tools/libxen/include/xen_console_protocol_internal.h	Mon Apr 16 19:19:07 2007 -0400
    63.2 +++ b/tools/libxen/include/xen_console_protocol_internal.h	Sat Apr 21 12:21:06 2007 -0700
    63.3 @@ -1,5 +1,5 @@
    63.4  /*
    63.5 - * Copyright (c) 2006, XenSource Inc.
    63.6 + * Copyright (c) 2006-2007, XenSource Inc.
    63.7   *
    63.8   * This library is free software; you can redistribute it and/or
    63.9   * modify it under the terms of the GNU Lesser General Public
    64.1 --- a/tools/libxen/include/xen_crashdump.h	Mon Apr 16 19:19:07 2007 -0400
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,199 +0,0 @@
    64.4 -/*
    64.5 - * Copyright (c) 2006-2007, XenSource Inc.
    64.6 - *
    64.7 - * This library is free software; you can redistribute it and/or
    64.8 - * modify it under the terms of the GNU Lesser General Public
    64.9 - * License as published by the Free Software Foundation; either
   64.10 - * version 2.1 of the License, or (at your option) any later version.
   64.11 - *
   64.12 - * This library is distributed in the hope that it will be useful,
   64.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   64.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   64.15 - * Lesser General Public License for more details.
   64.16 - *
   64.17 - * You should have received a copy of the GNU Lesser General Public
   64.18 - * License along with this library; if not, write to the Free Software
   64.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   64.20 - */
   64.21 -
   64.22 -#ifndef XEN_CRASHDUMP_H
   64.23 -#define XEN_CRASHDUMP_H
   64.24 -
   64.25 -#include "xen_common.h"
   64.26 -#include "xen_crashdump_decl.h"
   64.27 -#include "xen_vdi_decl.h"
   64.28 -#include "xen_vm_decl.h"
   64.29 -
   64.30 -
   64.31 -/*
   64.32 - * The crashdump class.
   64.33 - * 
   64.34 - * A VM crashdump.
   64.35 - */
   64.36 -
   64.37 -
   64.38 -/**
   64.39 - * Free the given xen_crashdump.  The given handle must have been
   64.40 - * allocated by this library.
   64.41 - */
   64.42 -extern void
   64.43 -xen_crashdump_free(xen_crashdump crashdump);
   64.44 -
   64.45 -
   64.46 -typedef struct xen_crashdump_set
   64.47 -{
   64.48 -    size_t size;
   64.49 -    xen_crashdump *contents[];
   64.50 -} xen_crashdump_set;
   64.51 -
   64.52 -/**
   64.53 - * Allocate a xen_crashdump_set of the given size.
   64.54 - */
   64.55 -extern xen_crashdump_set *
   64.56 -xen_crashdump_set_alloc(size_t size);
   64.57 -
   64.58 -/**
   64.59 - * Free the given xen_crashdump_set.  The given set must have been
   64.60 - * allocated by this library.
   64.61 - */
   64.62 -extern void
   64.63 -xen_crashdump_set_free(xen_crashdump_set *set);
   64.64 -
   64.65 -
   64.66 -typedef struct xen_crashdump_record
   64.67 -{
   64.68 -    xen_crashdump handle;
   64.69 -    char *uuid;
   64.70 -    struct xen_vm_record_opt *vm;
   64.71 -    struct xen_vdi_record_opt *vdi;
   64.72 -} xen_crashdump_record;
   64.73 -
   64.74 -/**
   64.75 - * Allocate a xen_crashdump_record.
   64.76 - */
   64.77 -extern xen_crashdump_record *
   64.78 -xen_crashdump_record_alloc(void);
   64.79 -
   64.80 -/**
   64.81 - * Free the given xen_crashdump_record, and all referenced values.  The
   64.82 - * given record must have been allocated by this library.
   64.83 - */
   64.84 -extern void
   64.85 -xen_crashdump_record_free(xen_crashdump_record *record);
   64.86 -
   64.87 -
   64.88 -typedef struct xen_crashdump_record_opt
   64.89 -{
   64.90 -    bool is_record;
   64.91 -    union
   64.92 -    {
   64.93 -        xen_crashdump handle;
   64.94 -        xen_crashdump_record *record;
   64.95 -    } u;
   64.96 -} xen_crashdump_record_opt;
   64.97 -
   64.98 -/**
   64.99 - * Allocate a xen_crashdump_record_opt.
  64.100 - */
  64.101 -extern xen_crashdump_record_opt *
  64.102 -xen_crashdump_record_opt_alloc(void);
  64.103 -
  64.104 -/**
  64.105 - * Free the given xen_crashdump_record_opt, and all referenced values. 
  64.106 - * The given record_opt must have been allocated by this library.
  64.107 - */
  64.108 -extern void
  64.109 -xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
  64.110 -
  64.111 -
  64.112 -typedef struct xen_crashdump_record_set
  64.113 -{
  64.114 -    size_t size;
  64.115 -    xen_crashdump_record *contents[];
  64.116 -} xen_crashdump_record_set;
  64.117 -
  64.118 -/**
  64.119 - * Allocate a xen_crashdump_record_set of the given size.
  64.120 - */
  64.121 -extern xen_crashdump_record_set *
  64.122 -xen_crashdump_record_set_alloc(size_t size);
  64.123 -
  64.124 -/**
  64.125 - * Free the given xen_crashdump_record_set, and all referenced values. 
  64.126 - * The given set must have been allocated by this library.
  64.127 - */
  64.128 -extern void
  64.129 -xen_crashdump_record_set_free(xen_crashdump_record_set *set);
  64.130 -
  64.131 -
  64.132 -
  64.133 -typedef struct xen_crashdump_record_opt_set
  64.134 -{
  64.135 -    size_t size;
  64.136 -    xen_crashdump_record_opt *contents[];
  64.137 -} xen_crashdump_record_opt_set;
  64.138 -
  64.139 -/**
  64.140 - * Allocate a xen_crashdump_record_opt_set of the given size.
  64.141 - */
  64.142 -extern xen_crashdump_record_opt_set *
  64.143 -xen_crashdump_record_opt_set_alloc(size_t size);
  64.144 -
  64.145 -/**
  64.146 - * Free the given xen_crashdump_record_opt_set, and all referenced
  64.147 - * values.  The given set must have been allocated by this library.
  64.148 - */
  64.149 -extern void
  64.150 -xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
  64.151 -
  64.152 -
  64.153 -/**
  64.154 - * Get a record containing the current state of the given crashdump.
  64.155 - */
  64.156 -extern bool
  64.157 -xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
  64.158 -
  64.159 -
  64.160 -/**
  64.161 - * Get a reference to the crashdump instance with the specified UUID.
  64.162 - */
  64.163 -extern bool
  64.164 -xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
  64.165 -
  64.166 -
  64.167 -/**
  64.168 - * Get the uuid field of the given crashdump.
  64.169 - */
  64.170 -extern bool
  64.171 -xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
  64.172 -
  64.173 -
  64.174 -/**
  64.175 - * Get the VM field of the given crashdump.
  64.176 - */
  64.177 -extern bool
  64.178 -xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
  64.179 -
  64.180 -
  64.181 -/**
  64.182 - * Get the VDI field of the given crashdump.
  64.183 - */
  64.184 -extern bool
  64.185 -xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
  64.186 -
  64.187 -
  64.188 -/**
  64.189 - * Destroy the specified crashdump
  64.190 - */
  64.191 -extern bool
  64.192 -xen_crashdump_destroy(xen_session *session, xen_crashdump self);
  64.193 -
  64.194 -
  64.195 -/**
  64.196 - * Return a list of all the crashdumps known to the system.
  64.197 - */
  64.198 -extern bool
  64.199 -xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
  64.200 -
  64.201 -
  64.202 -#endif
    65.1 --- a/tools/libxen/include/xen_crashdump_decl.h	Mon Apr 16 19:19:07 2007 -0400
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,30 +0,0 @@
    65.4 -/*
    65.5 - * Copyright (c) 2006, XenSource Inc.
    65.6 - *
    65.7 - * This library is free software; you can redistribute it and/or
    65.8 - * modify it under the terms of the GNU Lesser General Public
    65.9 - * License as published by the Free Software Foundation; either
   65.10 - * version 2.1 of the License, or (at your option) any later version.
   65.11 - *
   65.12 - * This library is distributed in the hope that it will be useful,
   65.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   65.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   65.15 - * Lesser General Public License for more details.
   65.16 - *
   65.17 - * You should have received a copy of the GNU Lesser General Public
   65.18 - * License along with this library; if not, write to the Free Software
   65.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   65.20 - */
   65.21 -
   65.22 -#ifndef XEN_CRASHDUMP_DECL_H
   65.23 -#define XEN_CRASHDUMP_DECL_H
   65.24 -
   65.25 -typedef void *xen_crashdump;
   65.26 -
   65.27 -struct xen_crashdump_set;
   65.28 -struct xen_crashdump_record;
   65.29 -struct xen_crashdump_record_set;
   65.30 -struct xen_crashdump_record_opt;
   65.31 -struct xen_crashdump_record_opt_set;
   65.32 -
   65.33 -#endif
    66.1 --- a/tools/libxen/include/xen_event.h	Mon Apr 16 19:19:07 2007 -0400
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,102 +0,0 @@
    66.4 -/*
    66.5 - * Copyright (c) 2006-2007, XenSource Inc.
    66.6 - *
    66.7 - * This library is free software; you can redistribute it and/or
    66.8 - * modify it under the terms of the GNU Lesser General Public
    66.9 - * License as published by the Free Software Foundation; either
   66.10 - * version 2.1 of the License, or (at your option) any later version.
   66.11 - *
   66.12 - * This library is distributed in the hope that it will be useful,
   66.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   66.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   66.15 - * Lesser General Public License for more details.
   66.16 - *
   66.17 - * You should have received a copy of the GNU Lesser General Public
   66.18 - * License along with this library; if not, write to the Free Software
   66.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   66.20 - */
   66.21 -
   66.22 -#ifndef XEN_EVENT_H
   66.23 -#define XEN_EVENT_H
   66.24 -
   66.25 -#include "xen_common.h"
   66.26 -#include "xen_event_decl.h"
   66.27 -#include "xen_event_operation.h"
   66.28 -#include "xen_string_set.h"
   66.29 -
   66.30 -
   66.31 -/*
   66.32 - * The event class.
   66.33 - * 
   66.34 - * Asynchronous event registration and handling.
   66.35 - */
   66.36 -
   66.37 -
   66.38 -
   66.39 -typedef struct xen_event_record
   66.40 -{
   66.41 -    int64_t id;
   66.42 -    time_t timestamp;
   66.43 -    char *class;
   66.44 -    enum xen_event_operation operation;
   66.45 -    char *ref;
   66.46 -    char *obj_uuid;
   66.47 -} xen_event_record;
   66.48 -
   66.49 -/**
   66.50 - * Allocate a xen_event_record.
   66.51 - */
   66.52 -extern xen_event_record *
   66.53 -xen_event_record_alloc(void);
   66.54 -
   66.55 -/**
   66.56 - * Free the given xen_event_record, and all referenced values.  The
   66.57 - * given record must have been allocated by this library.
   66.58 - */
   66.59 -extern void
   66.60 -xen_event_record_free(xen_event_record *record);
   66.61 -
   66.62 -
   66.63 -typedef struct xen_event_record_set
   66.64 -{
   66.65 -    size_t size;
   66.66 -    xen_event_record *contents[];
   66.67 -} xen_event_record_set;
   66.68 -
   66.69 -/**
   66.70 - * Allocate a xen_event_record_set of the given size.
   66.71 - */
   66.72 -extern xen_event_record_set *
   66.73 -xen_event_record_set_alloc(size_t size);
   66.74 -
   66.75 -/**
   66.76 - * Free the given xen_event_record_set, and all referenced values.  The
   66.77 - * given set must have been allocated by this library.
   66.78 - */
   66.79 -extern void
   66.80 -xen_event_record_set_free(xen_event_record_set *set);
   66.81 -
   66.82 -
   66.83 -/**
   66.84 - * Registers this session with the event system.  Specifying the empty
   66.85 - * list will register for all classes.
   66.86 - */
   66.87 -extern bool
   66.88 -xen_event_register(xen_session *session, struct xen_string_set *classes);
   66.89 -
   66.90 -
   66.91 -/**
   66.92 - * Unregisters this session with the event system.
   66.93 - */
   66.94 -extern bool
   66.95 -xen_event_unregister(xen_session *session, struct xen_string_set *classes);
   66.96 -
   66.97 -
   66.98 -/**
   66.99 - * Blocking call which returns a (possibly empty) batch of events.
  66.100 - */
  66.101 -extern bool
  66.102 -xen_event_next(xen_session *session, struct xen_event_record_set **result);
  66.103 -
  66.104 -
  66.105 -#endif
    67.1 --- a/tools/libxen/include/xen_event_decl.h	Mon Apr 16 19:19:07 2007 -0400
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,25 +0,0 @@
    67.4 -/*
    67.5 - * Copyright (c) 2006-2007, XenSource Inc.
    67.6 - *
    67.7 - * This library is free software; you can redistribute it and/or
    67.8 - * modify it under the terms of the GNU Lesser General Public
    67.9 - * License as published by the Free Software Foundation; either
   67.10 - * version 2.1 of the License, or (at your option) any later version.
   67.11 - *
   67.12 - * This library is distributed in the hope that it will be useful,
   67.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   67.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   67.15 - * Lesser General Public License for more details.
   67.16 - *
   67.17 - * You should have received a copy of the GNU Lesser General Public
   67.18 - * License along with this library; if not, write to the Free Software
   67.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   67.20 - */
   67.21 -
   67.22 -#ifndef XEN_EVENT_DECL_H
   67.23 -#define XEN_EVENT_DECL_H
   67.24 -
   67.25 -struct xen_event_record;
   67.26 -struct xen_event_record_set;
   67.27 -
   67.28 -#endif
    68.1 --- a/tools/libxen/include/xen_event_operation.h	Mon Apr 16 19:19:07 2007 -0400
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,82 +0,0 @@
    68.4 -/*
    68.5 - * Copyright (c) 2006-2007, XenSource Inc.
    68.6 - *
    68.7 - * This library is free software; you can redistribute it and/or
    68.8 - * modify it under the terms of the GNU Lesser General Public
    68.9 - * License as published by the Free Software Foundation; either
   68.10 - * version 2.1 of the License, or (at your option) any later version.
   68.11 - *
   68.12 - * This library is distributed in the hope that it will be useful,
   68.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   68.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   68.15 - * Lesser General Public License for more details.
   68.16 - *
   68.17 - * You should have received a copy of the GNU Lesser General Public
   68.18 - * License along with this library; if not, write to the Free Software
   68.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   68.20 - */
   68.21 -
   68.22 -#ifndef XEN_EVENT_OPERATION_H
   68.23 -#define XEN_EVENT_OPERATION_H
   68.24 -
   68.25 -
   68.26 -#include "xen_common.h"
   68.27 -
   68.28 -
   68.29 -enum xen_event_operation
   68.30 -{
   68.31 -    /**
   68.32 -     * An object has been created
   68.33 -     */
   68.34 -    XEN_EVENT_OPERATION_ADD,
   68.35 -
   68.36 -    /**
   68.37 -     * An object has been deleted
   68.38 -     */
   68.39 -    XEN_EVENT_OPERATION_DEL,
   68.40 -
   68.41 -    /**
   68.42 -     * An object has been modified
   68.43 -     */
   68.44 -    XEN_EVENT_OPERATION_MOD
   68.45 -};
   68.46 -
   68.47 -
   68.48 -typedef struct xen_event_operation_set
   68.49 -{
   68.50 -    size_t size;
   68.51 -    enum xen_event_operation contents[];
   68.52 -} xen_event_operation_set;
   68.53 -
   68.54 -/**
   68.55 - * Allocate a xen_event_operation_set of the given size.
   68.56 - */
   68.57 -extern xen_event_operation_set *
   68.58 -xen_event_operation_set_alloc(size_t size);
   68.59 -
   68.60 -/**
   68.61 - * Free the given xen_event_operation_set.  The given set must have
   68.62 - * been allocated by this library.
   68.63 - */
   68.64 -extern void
   68.65 -xen_event_operation_set_free(xen_event_operation_set *set);
   68.66 -
   68.67 -
   68.68 -/**
   68.69 - * Return the name corresponding to the given code.  This string must
   68.70 - * not be modified or freed.
   68.71 - */
   68.72 -extern const char *
   68.73 -xen_event_operation_to_string(enum xen_event_operation val);
   68.74 -
   68.75 -
   68.76 -/**
   68.77 - * Return the correct code for the given string, or set the session
   68.78 - * object to failure and return an undefined value if the given string does
   68.79 - * not match a known code.
   68.80 - */
   68.81 -extern enum xen_event_operation
   68.82 -xen_event_operation_from_string(xen_session *session, const char *str);
   68.83 -
   68.84 -
   68.85 -#endif
    69.1 --- a/tools/libxen/include/xen_host.h	Mon Apr 16 19:19:07 2007 -0400
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,497 +0,0 @@
    69.4 -/*
    69.5 - * Copyright (c) 2006-2007, XenSource Inc.
    69.6 - *
    69.7 - * This library is free software; you can redistribute it and/or
    69.8 - * modify it under the terms of the GNU Lesser General Public
    69.9 - * License as published by the Free Software Foundation; either
   69.10 - * version 2.1 of the License, or (at your option) any later version.
   69.11 - *
   69.12 - * This library is distributed in the hope that it will be useful,
   69.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   69.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   69.15 - * Lesser General Public License for more details.
   69.16 - *
   69.17 - * You should have received a copy of the GNU Lesser General Public
   69.18 - * License along with this library; if not, write to the Free Software
   69.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   69.20 - */
   69.21 -
   69.22 -#ifndef XEN_HOST_H
   69.23 -#define XEN_HOST_H
   69.24 -
   69.25 -#include "xen_common.h"
   69.26 -#include "xen_host_cpu_decl.h"
   69.27 -#include "xen_host_decl.h"
   69.28 -#include "xen_host_metrics_decl.h"
   69.29 -#include "xen_pbd_decl.h"
   69.30 -#include "xen_pif_decl.h"
   69.31 -#include "xen_sr_decl.h"
   69.32 -#include "xen_string_set.h"
   69.33 -#include "xen_string_string_map.h"
   69.34 -#include "xen_vm_decl.h"
   69.35 -
   69.36 -
   69.37 -/*
   69.38 - * The host class.
   69.39 - * 
   69.40 - * A physical host.
   69.41 - */
   69.42 -
   69.43 -
   69.44 -/**
   69.45 - * Free the given xen_host.  The given handle must have been allocated
   69.46 - * by this library.
   69.47 - */
   69.48 -extern void
   69.49 -xen_host_free(xen_host host);
   69.50 -
   69.51 -
   69.52 -typedef struct xen_host_set
   69.53 -{
   69.54 -    size_t size;
   69.55 -    xen_host *contents[];
   69.56 -} xen_host_set;
   69.57 -
   69.58 -/**
   69.59 - * Allocate a xen_host_set of the given size.
   69.60 - */
   69.61 -extern xen_host_set *
   69.62 -xen_host_set_alloc(size_t size);
   69.63 -
   69.64 -/**
   69.65 - * Free the given xen_host_set.  The given set must have been allocated
   69.66 - * by this library.
   69.67 - */
   69.68 -extern void
   69.69 -xen_host_set_free(xen_host_set *set);
   69.70 -
   69.71 -
   69.72 -typedef struct xen_host_record
   69.73 -{
   69.74 -    xen_host handle;
   69.75 -    char *uuid;
   69.76 -    char *name_label;
   69.77 -    char *name_description;
   69.78 -    int64_t api_version_major;
   69.79 -    int64_t api_version_minor;
   69.80 -    char *api_version_vendor;
   69.81 -    xen_string_string_map *api_version_vendor_implementation;
   69.82 -    bool enabled;
   69.83 -    xen_string_string_map *software_version;
   69.84 -    xen_string_string_map *other_config;
   69.85 -    struct xen_string_set *capabilities;
   69.86 -    xen_string_string_map *cpu_configuration;
   69.87 -    char *sched_policy;
   69.88 -    struct xen_string_set *supported_bootloaders;
   69.89 -    struct xen_vm_record_opt_set *resident_vms;
   69.90 -    xen_string_string_map *logging;
   69.91 -    struct xen_pif_record_opt_set *pifs;
   69.92 -    struct xen_sr_record_opt *suspend_image_sr;
   69.93 -    struct xen_sr_record_opt *crash_dump_sr;
   69.94 -    struct xen_pbd_record_opt_set *pbds;
   69.95 -    struct xen_host_cpu_record_opt_set *host_cpus;
   69.96 -    struct xen_host_metrics_record_opt *metrics;
   69.97 -} xen_host_record;
   69.98 -
   69.99 -/**
  69.100 - * Allocate a xen_host_record.
  69.101 - */
  69.102 -extern xen_host_record *
  69.103 -xen_host_record_alloc(void);
  69.104 -
  69.105 -/**
  69.106 - * Free the given xen_host_record, and all referenced values.  The
  69.107 - * given record must have been allocated by this library.
  69.108 - */
  69.109 -extern void
  69.110 -xen_host_record_free(xen_host_record *record);
  69.111 -
  69.112 -
  69.113 -typedef struct xen_host_record_opt
  69.114 -{
  69.115 -    bool is_record;
  69.116 -    union
  69.117 -    {
  69.118 -        xen_host handle;
  69.119 -        xen_host_record *record;
  69.120 -    } u;
  69.121 -} xen_host_record_opt;
  69.122 -
  69.123 -/**
  69.124 - * Allocate a xen_host_record_opt.
  69.125 - */
  69.126 -extern xen_host_record_opt *
  69.127 -xen_host_record_opt_alloc(void);
  69.128 -
  69.129 -/**
  69.130 - * Free the given xen_host_record_opt, and all referenced values.  The
  69.131 - * given record_opt must have been allocated by this library.
  69.132 - */
  69.133 -extern void
  69.134 -xen_host_record_opt_free(xen_host_record_opt *record_opt);
  69.135 -
  69.136 -
  69.137 -typedef struct xen_host_record_set
  69.138 -{
  69.139 -    size_t size;
  69.140 -    xen_host_record *contents[];
  69.141 -} xen_host_record_set;
  69.142 -
  69.143 -/**
  69.144 - * Allocate a xen_host_record_set of the given size.
  69.145 - */
  69.146 -extern xen_host_record_set *
  69.147 -xen_host_record_set_alloc(size_t size);
  69.148 -
  69.149 -/**
  69.150 - * Free the given xen_host_record_set, and all referenced values.  The
  69.151 - * given set must have been allocated by this library.
  69.152 - */
  69.153 -extern void
  69.154 -xen_host_record_set_free(xen_host_record_set *set);
  69.155 -
  69.156 -
  69.157 -
  69.158 -typedef struct xen_host_record_opt_set
  69.159 -{
  69.160 -    size_t size;
  69.161 -    xen_host_record_opt *contents[];
  69.162 -} xen_host_record_opt_set;
  69.163 -
  69.164 -/**
  69.165 - * Allocate a xen_host_record_opt_set of the given size.
  69.166 - */
  69.167 -extern xen_host_record_opt_set *
  69.168 -xen_host_record_opt_set_alloc(size_t size);
  69.169 -
  69.170 -/**
  69.171 - * Free the given xen_host_record_opt_set, and all referenced values. 
  69.172 - * The given set must have been allocated by this library.
  69.173 - */
  69.174 -extern void
  69.175 -xen_host_record_opt_set_free(xen_host_record_opt_set *set);
  69.176 -
  69.177 -
  69.178 -/**
  69.179 - * Get a record containing the current state of the given host.
  69.180 - */
  69.181 -extern bool
  69.182 -xen_host_get_record(xen_session *session, xen_host_record **result, xen_host host);
  69.183 -
  69.184 -
  69.185 -/**
  69.186 - * Get a reference to the host instance with the specified UUID.
  69.187 - */
  69.188 -extern bool
  69.189 -xen_host_get_by_uuid(xen_session *session, xen_host *result, char *uuid);
  69.190 -
  69.191 -
  69.192 -/**
  69.193 - * Get all the host instances with the given label.
  69.194 - */
  69.195 -extern bool
  69.196 -xen_host_get_by_name_label(xen_session *session, struct xen_host_set **result, char *label);
  69.197 -
  69.198 -
  69.199 -/**
  69.200 - * Get the uuid field of the given host.
  69.201 - */
  69.202 -extern bool
  69.203 -xen_host_get_uuid(xen_session *session, char **result, xen_host host);
  69.204 -
  69.205 -
  69.206 -/**
  69.207 - * Get the name/label field of the given host.
  69.208 - */
  69.209 -extern bool
  69.210 -xen_host_get_name_label(xen_session *session, char **result, xen_host host);
  69.211 -
  69.212 -
  69.213 -/**
  69.214 - * Get the name/description field of the given host.
  69.215 - */
  69.216 -extern bool
  69.217 -xen_host_get_name_description(xen_session *session, char **result, xen_host host);
  69.218 -
  69.219 -
  69.220 -/**
  69.221 - * Get the API_version/major field of the given host.
  69.222 - */
  69.223 -extern bool
  69.224 -xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host);
  69.225 -
  69.226 -
  69.227 -/**
  69.228 - * Get the API_version/minor field of the given host.
  69.229 - */
  69.230 -extern bool
  69.231 -xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host);
  69.232 -
  69.233 -
  69.234 -/**
  69.235 - * Get the API_version/vendor field of the given host.
  69.236 - */
  69.237 -extern bool
  69.238 -xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host);
  69.239 -
  69.240 -
  69.241 -/**
  69.242 - * Get the API_version/vendor_implementation field of the given host.
  69.243 - */
  69.244 -extern bool
  69.245 -xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host);
  69.246 -
  69.247 -
  69.248 -/**
  69.249 - * Get the enabled field of the given host.
  69.250 - */
  69.251 -extern bool
  69.252 -xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
  69.253 -
  69.254 -
  69.255 -/**
  69.256 - * Get the software_version field of the given host.
  69.257 - */
  69.258 -extern bool
  69.259 -xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host);
  69.260 -
  69.261 -
  69.262 -/**
  69.263 - * Get the other_config field of the given host.
  69.264 - */
  69.265 -extern bool
  69.266 -xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
  69.267 -
  69.268 -
  69.269 -/**
  69.270 - * Get the capabilities field of the given host.
  69.271 - */
  69.272 -extern bool
  69.273 -xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
  69.274 -
  69.275 -
  69.276 -/**
  69.277 - * Get the cpu_configuration field of the given host.
  69.278 - */
  69.279 -extern bool
  69.280 -xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map **result, xen_host host);
  69.281 -
  69.282 -
  69.283 -/**
  69.284 - * Get the sched_policy field of the given host.
  69.285 - */
  69.286 -extern bool
  69.287 -xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
  69.288 -
  69.289 -
  69.290 -/**
  69.291 - * Get the supported_bootloaders field of the given host.
  69.292 - */
  69.293 -extern bool
  69.294 -xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host);
  69.295 -
  69.296 -
  69.297 -/**
  69.298 - * Get the resident_VMs field of the given host.
  69.299 - */
  69.300 -extern bool
  69.301 -xen_host_get_resident_vms(xen_session *session, struct xen_vm_set **result, xen_host host);
  69.302 -
  69.303 -
  69.304 -/**
  69.305 - * Get the logging field of the given host.
  69.306 - */
  69.307 -extern bool
  69.308 -xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host);
  69.309 -
  69.310 -
  69.311 -/**
  69.312 - * Get the PIFs field of the given host.
  69.313 - */
  69.314 -extern bool
  69.315 -xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
  69.316 -
  69.317 -
  69.318 -/**
  69.319 - * Get the suspend_image_sr field of the given host.
  69.320 - */
  69.321 -extern bool
  69.322 -xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
  69.323 -
  69.324 -
  69.325 -/**
  69.326 - * Get the crash_dump_sr field of the given host.
  69.327 - */
  69.328 -extern bool
  69.329 -xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
  69.330 -
  69.331 -
  69.332 -/**
  69.333 - * Get the PBDs field of the given host.
  69.334 - */
  69.335 -extern bool
  69.336 -xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
  69.337 -
  69.338 -
  69.339 -/**
  69.340 - * Get the host_CPUs field of the given host.
  69.341 - */
  69.342 -extern bool
  69.343 -xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host);
  69.344 -
  69.345 -
  69.346 -/**
  69.347 - * Get the metrics field of the given host.
  69.348 - */
  69.349 -extern bool
  69.350 -xen_host_get_metrics(xen_session *session, xen_host_metrics *result, xen_host host);
  69.351 -
  69.352 -
  69.353 -/**
  69.354 - * Set the name/label field of the given host.
  69.355 - */
  69.356 -extern bool
  69.357 -xen_host_set_name_label(xen_session *session, xen_host host, char *label);
  69.358 -
  69.359 -
  69.360 -/**
  69.361 - * Set the name/description field of the given host.
  69.362 - */
  69.363 -extern bool
  69.364 -xen_host_set_name_description(xen_session *session, xen_host host, char *description);
  69.365 -
  69.366 -
  69.367 -/**
  69.368 - * Set the other_config field of the given host.
  69.369 - */
  69.370 -extern bool
  69.371 -xen_host_set_other_config(xen_session *session, xen_host host, xen_string_string_map *other_config);
  69.372 -
  69.373 -
  69.374 -/**
  69.375 - * Add the given key-value pair to the other_config field of the given
  69.376 - * host.
  69.377 - */
  69.378 -extern bool
  69.379 -xen_host_add_to_other_config(xen_session *session, xen_host host, char *key, char *value);
  69.380 -
  69.381 -
  69.382 -/**
  69.383 - * Remove the given key and its corresponding value from the
  69.384 - * other_config field of the given host.  If the key is not in that Map, then
  69.385 - * do nothing.
  69.386 - */
  69.387 -extern bool
  69.388 -xen_host_remove_from_other_config(xen_session *session, xen_host host, char *key);
  69.389 -
  69.390 -
  69.391 -/**
  69.392 - * Set the logging field of the given host.
  69.393 - */
  69.394 -extern bool
  69.395 -xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging);
  69.396 -
  69.397 -
  69.398 -/**
  69.399 - * Add the given key-value pair to the logging field of the given host.
  69.400 - */
  69.401 -extern bool
  69.402 -xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value);
  69.403 -
  69.404 -
  69.405 -/**
  69.406 - * Remove the given key and its corresponding value from the logging
  69.407 - * field of the given host.  If the key is not in that Map, then do nothing.
  69.408 - */
  69.409 -extern bool
  69.410 -xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
  69.411 -
  69.412 -
  69.413 -/**
  69.414 - * Set the suspend_image_sr field of the given host.
  69.415 - */
  69.416 -extern bool
  69.417 -xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
  69.418 -
  69.419 -
  69.420 -/**
  69.421 - * Set the crash_dump_sr field of the given host.
  69.422 - */
  69.423 -extern bool
  69.424 -xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
  69.425 -
  69.426 -
  69.427 -/**
  69.428 - * Puts the host into a state in which no new VMs can be started.
  69.429 - * Currently active VMs on the host continue to execute.
  69.430 - */
  69.431 -extern bool
  69.432 -xen_host_disable(xen_session *session, xen_host host);
  69.433 -
  69.434 -
  69.435 -/**
  69.436 - * Puts the host into a state in which new VMs can be started.
  69.437 - */
  69.438 -extern bool
  69.439 -xen_host_enable(xen_session *session, xen_host host);
  69.440 -
  69.441 -
  69.442 -/**
  69.443 - * Shutdown the host. (This function can only be called if there are no
  69.444 - * currently running VMs on the host and it is disabled.).
  69.445 - */
  69.446 -extern bool
  69.447 -xen_host_shutdown(xen_session *session, xen_host host);
  69.448 -
  69.449 -
  69.450 -/**
  69.451 - * Reboot the host. (This function can only be called if there are no
  69.452 - * currently running VMs on the host and it is disabled.).
  69.453 - */
  69.454 -extern bool
  69.455 -xen_host_reboot(xen_session *session, xen_host host);
  69.456 -
  69.457 -
  69.458 -/**
  69.459 - * Get the host xen dmesg.
  69.460 - */
  69.461 -extern bool
  69.462 -xen_host_dmesg(xen_session *session, char **result, xen_host host);
  69.463 -
  69.464 -
  69.465 -/**
  69.466 - * Get the host xen dmesg, and clear the buffer.
  69.467 - */
  69.468 -extern bool
  69.469 -xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
  69.470 -
  69.471 -
  69.472 -/**
  69.473 - * Get the host's log file.
  69.474 - */
  69.475 -extern bool
  69.476 -xen_host_get_log(xen_session *session, char **result, xen_host host);
  69.477 -
  69.478 -
  69.479 -/**
  69.480 - * Inject the given string as debugging keys into Xen.
  69.481 - */
  69.482 -extern bool
  69.483 -xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
  69.484 -
  69.485 -
  69.486 -/**
  69.487 - * List all supported methods.
  69.488 - */
  69.489 -extern bool
  69.490 -xen_host_list_methods(xen_session *session, struct xen_string_set **result);
  69.491 -
  69.492 -
  69.493 -/**
  69.494 - * Return a list of all the hosts known to the system.
  69.495 - */
  69.496 -extern bool
  69.497 -xen_host_get_all(xen_session *session, struct xen_host_set **result);
  69.498 -
  69.499 -
  69.500 -#endif
    70.1 --- a/tools/libxen/include/xen_host_cpu.h	Mon Apr 16 19:19:07 2007 -0400
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,247 +0,0 @@
    70.4 -/*
    70.5 - * Copyright (c) 2006-2007, XenSource Inc.
    70.6 - *
    70.7 - * This library is free software; you can redistribute it and/or
    70.8 - * modify it under the terms of the GNU Lesser General Public
    70.9 - * License as published by the Free Software Foundation; either
   70.10 - * version 2.1 of the License, or (at your option) any later version.
   70.11 - *
   70.12 - * This library is distributed in the hope that it will be useful,
   70.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   70.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   70.15 - * Lesser General Public License for more details.
   70.16 - *
   70.17 - * You should have received a copy of the GNU Lesser General Public
   70.18 - * License along with this library; if not, write to the Free Software
   70.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   70.20 - */
   70.21 -
   70.22 -#ifndef XEN_HOST_CPU_H
   70.23 -#define XEN_HOST_CPU_H
   70.24 -
   70.25 -#include "xen_common.h"
   70.26 -#include "xen_host_cpu_decl.h"
   70.27 -#include "xen_host_decl.h"
   70.28 -
   70.29 -
   70.30 -/*
   70.31 - * The host_cpu class.
   70.32 - * 
   70.33 - * A physical CPU.
   70.34 - */
   70.35 -
   70.36 -
   70.37 -/**
   70.38 - * Free the given xen_host_cpu.  The given handle must have been
   70.39 - * allocated by this library.
   70.40 - */
   70.41 -extern void
   70.42 -xen_host_cpu_free(xen_host_cpu host_cpu);
   70.43 -
   70.44 -
   70.45 -typedef struct xen_host_cpu_set
   70.46 -{
   70.47 -    size_t size;
   70.48 -    xen_host_cpu *contents[];
   70.49 -} xen_host_cpu_set;
   70.50 -
   70.51 -/**
   70.52 - * Allocate a xen_host_cpu_set of the given size.
   70.53 - */
   70.54 -extern xen_host_cpu_set *
   70.55 -xen_host_cpu_set_alloc(size_t size);
   70.56 -
   70.57 -/**
   70.58 - * Free the given xen_host_cpu_set.  The given set must have been
   70.59 - * allocated by this library.
   70.60 - */
   70.61 -extern void
   70.62 -xen_host_cpu_set_free(xen_host_cpu_set *set);
   70.63 -
   70.64 -
   70.65 -typedef struct xen_host_cpu_record
   70.66 -{
   70.67 -    xen_host_cpu handle;
   70.68 -    char *uuid;
   70.69 -    struct xen_host_record_opt *host;
   70.70 -    int64_t number;
   70.71 -    char *vendor;
   70.72 -    int64_t speed;
   70.73 -    char *modelname;
   70.74 -    char *stepping;
   70.75 -    char *flags;
   70.76 -    char *features;
   70.77 -    double utilisation;
   70.78 -} xen_host_cpu_record;
   70.79 -
   70.80 -/**
   70.81 - * Allocate a xen_host_cpu_record.
   70.82 - */
   70.83 -extern xen_host_cpu_record *
   70.84 -xen_host_cpu_record_alloc(void);
   70.85 -
   70.86 -/**
   70.87 - * Free the given xen_host_cpu_record, and all referenced values.  The
   70.88 - * given record must have been allocated by this library.
   70.89 - */
   70.90 -extern void
   70.91 -xen_host_cpu_record_free(xen_host_cpu_record *record);
   70.92 -
   70.93 -
   70.94 -typedef struct xen_host_cpu_record_opt
   70.95 -{
   70.96 -    bool is_record;
   70.97 -    union
   70.98 -    {
   70.99 -        xen_host_cpu handle;
  70.100 -        xen_host_cpu_record *record;
  70.101 -    } u;
  70.102 -} xen_host_cpu_record_opt;
  70.103 -
  70.104 -/**
  70.105 - * Allocate a xen_host_cpu_record_opt.
  70.106 - */
  70.107 -extern xen_host_cpu_record_opt *
  70.108 -xen_host_cpu_record_opt_alloc(void);
  70.109 -
  70.110 -/**
  70.111 - * Free the given xen_host_cpu_record_opt, and all referenced values. 
  70.112 - * The given record_opt must have been allocated by this library.
  70.113 - */
  70.114 -extern void
  70.115 -xen_host_cpu_record_opt_free(xen_host_cpu_record_opt *record_opt);
  70.116 -
  70.117 -
  70.118 -typedef struct xen_host_cpu_record_set
  70.119 -{
  70.120 -    size_t size;
  70.121 -    xen_host_cpu_record *contents[];
  70.122 -} xen_host_cpu_record_set;
  70.123 -
  70.124 -/**
  70.125 - * Allocate a xen_host_cpu_record_set of the given size.
  70.126 - */
  70.127 -extern xen_host_cpu_record_set *
  70.128 -xen_host_cpu_record_set_alloc(size_t size);
  70.129 -
  70.130 -/**
  70.131 - * Free the given xen_host_cpu_record_set, and all referenced values. 
  70.132 - * The given set must have been allocated by this library.
  70.133 - */
  70.134 -extern void
  70.135 -xen_host_cpu_record_set_free(xen_host_cpu_record_set *set);
  70.136 -
  70.137 -
  70.138 -
  70.139 -typedef struct xen_host_cpu_record_opt_set
  70.140 -{
  70.141 -    size_t size;
  70.142 -    xen_host_cpu_record_opt *contents[];
  70.143 -} xen_host_cpu_record_opt_set;
  70.144 -
  70.145 -/**
  70.146 - * Allocate a xen_host_cpu_record_opt_set of the given size.
  70.147 - */
  70.148 -extern xen_host_cpu_record_opt_set *
  70.149 -xen_host_cpu_record_opt_set_alloc(size_t size);
  70.150 -
  70.151 -/**
  70.152 - * Free the given xen_host_cpu_record_opt_set, and all referenced
  70.153 - * values.  The given set must have been allocated by this library.
  70.154 - */
  70.155 -extern void
  70.156 -xen_host_cpu_record_opt_set_free(xen_host_cpu_record_opt_set *set);
  70.157 -
  70.158 -
  70.159 -/**
  70.160 - * Get a record containing the current state of the given host_cpu.
  70.161 - */
  70.162 -extern bool
  70.163 -xen_host_cpu_get_record(xen_session *session, xen_host_cpu_record **result, xen_host_cpu host_cpu);
  70.164 -
  70.165 -
  70.166 -/**
  70.167 - * Get a reference to the host_cpu instance with the specified UUID.
  70.168 - */
  70.169 -extern bool
  70.170 -xen_host_cpu_get_by_uuid(xen_session *session, xen_host_cpu *result, char *uuid);
  70.171 -
  70.172 -
  70.173 -/**
  70.174 - * Get the uuid field of the given host_cpu.
  70.175 - */
  70.176 -extern bool
  70.177 -xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu);
  70.178 -
  70.179 -
  70.180 -/**
  70.181 - * Get the host field of the given host_cpu.
  70.182 - */
  70.183 -extern bool
  70.184 -xen_host_cpu_get_host(xen_session *session, xen_host *result, xen_host_cpu host_cpu);
  70.185 -
  70.186 -
  70.187 -/**
  70.188 - * Get the number field of the given host_cpu.
  70.189 - */
  70.190 -extern bool
  70.191 -xen_host_cpu_get_number(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
  70.192 -
  70.193 -
  70.194 -/**
  70.195 - * Get the vendor field of the given host_cpu.
  70.196 - */
  70.197 -extern bool
  70.198 -xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu host_cpu);
  70.199 -
  70.200 -
  70.201 -/**
  70.202 - * Get the speed field of the given host_cpu.
  70.203 - */
  70.204 -extern bool
  70.205 -xen_host_cpu_get_speed(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
  70.206 -
  70.207 -
  70.208 -/**
  70.209 - * Get the modelname field of the given host_cpu.
  70.210 - */
  70.211 -extern bool
  70.212 -xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu host_cpu);
  70.213 -
  70.214 -
  70.215 -/**
  70.216 - * Get the stepping field of the given host_cpu.
  70.217 - */
  70.218 -extern bool
  70.219 -xen_host_cpu_get_stepping(xen_session *session, char **result, xen_host_cpu host_cpu);
  70.220 -
  70.221 -
  70.222 -/**
  70.223 - * Get the flags field of the given host_cpu.
  70.224 - */
  70.225 -extern bool
  70.226 -xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cpu);
  70.227 -
  70.228 -
  70.229 -/**
  70.230 - * Get the features field of the given host_cpu.
  70.231 - */
  70.232 -extern bool
  70.233 -xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
  70.234 -
  70.235 -
  70.236 -/**
  70.237 - * Get the utilisation field of the given host_cpu.
  70.238 - */
  70.239 -extern bool
  70.240 -xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu);
  70.241 -
  70.242 -
  70.243 -/**
  70.244 - * Return a list of all the host_cpus known to the system.
  70.245 - */
  70.246 -extern bool
  70.247 -xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result);
  70.248 -
  70.249 -
  70.250 -#endif
    71.1 --- a/tools/libxen/include/xen_host_cpu_decl.h	Mon Apr 16 19:19:07 2007 -0400
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,30 +0,0 @@
    71.4 -/*
    71.5 - * Copyright (c) 2006, XenSource Inc.
    71.6 - *
    71.7 - * This library is free software; you can redistribute it and/or
    71.8 - * modify it under the terms of the GNU Lesser General Public
    71.9 - * License as published by the Free Software Foundation; either
   71.10 - * version 2.1 of the License, or (at your option) any later version.
   71.11 - *
   71.12 - * This library is distributed in the hope that it will be useful,
   71.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   71.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   71.15 - * Lesser General Public License for more details.
   71.16 - *
   71.17 - * You should have received a copy of the GNU Lesser General Public
   71.18 - * License along with this library; if not, write to the Free Software
   71.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   71.20 - */
   71.21 -
   71.22 -#ifndef XEN_HOST_CPU_DECL_H
   71.23 -#define XEN_HOST_CPU_DECL_H
   71.24 -
   71.25 -typedef void *xen_host_cpu;
   71.26 -
   71.27 -struct xen_host_cpu_set;
   71.28 -struct xen_host_cpu_record;
   71.29 -struct xen_host_cpu_record_set;
   71.30 -struct xen_host_cpu_record_opt;
   71.31 -struct xen_host_cpu_record_opt_set;
   71.32 -
   71.33 -#endif
    72.1 --- a/tools/libxen/include/xen_host_decl.h	Mon Apr 16 19:19:07 2007 -0400
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,30 +0,0 @@
    72.4 -/*
    72.5 - * Copyright (c) 2006, XenSource Inc.
    72.6 - *
    72.7 - * This library is free software; you can redistribute it and/or
    72.8 - * modify it under the terms of the GNU Lesser General Public
    72.9 - * License as published by the Free Software Foundation; either
   72.10 - * version 2.1 of the License, or (at your option) any later version.
   72.11 - *
   72.12 - * This library is distributed in the hope that it will be useful,
   72.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   72.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   72.15 - * Lesser General Public License for more details.
   72.16 - *
   72.17 - * You should have received a copy of the GNU Lesser General Public
   72.18 - * License along with this library; if not, write to the Free Software
   72.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   72.20 - */
   72.21 -
   72.22 -#ifndef XEN_HOST_DECL_H
   72.23 -#define XEN_HOST_DECL_H
   72.24 -
   72.25 -typedef void *xen_host;
   72.26 -
   72.27 -struct xen_host_set;
   72.28 -struct xen_host_record;
   72.29 -struct xen_host_record_set;
   72.30 -struct xen_host_record_opt;
   72.31 -struct xen_host_record_opt_set;
   72.32 -
   72.33 -#endif
    73.1 --- a/tools/libxen/include/xen_host_metrics.h	Mon Apr 16 19:19:07 2007 -0400
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,199 +0,0 @@
    73.4 -/*
    73.5 - * Copyright (c) 2006-2007, XenSource Inc.
    73.6 - *
    73.7 - * This library is free software; you can redistribute it and/or
    73.8 - * modify it under the terms of the GNU Lesser General Public
    73.9 - * License as published by the Free Software Foundation; either
   73.10 - * version 2.1 of the License, or (at your option) any later version.
   73.11 - *
   73.12 - * This library is distributed in the hope that it will be useful,
   73.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   73.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   73.15 - * Lesser General Public License for more details.
   73.16 - *
   73.17 - * You should have received a copy of the GNU Lesser General Public
   73.18 - * License along with this library; if not, write to the Free Software
   73.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   73.20 - */
   73.21 -
   73.22 -#ifndef XEN_HOST_METRICS_H
   73.23 -#define XEN_HOST_METRICS_H
   73.24 -
   73.25 -#include "xen_common.h"
   73.26 -#include "xen_host_metrics_decl.h"
   73.27 -
   73.28 -
   73.29 -/*
   73.30 - * The host_metrics class.
   73.31 - * 
   73.32 - * The metrics associated with a host.
   73.33 - */
   73.34 -
   73.35 -
   73.36 -/**
   73.37 - * Free the given xen_host_metrics.  The given handle must have been
   73.38 - * allocated by this library.
   73.39 - */
   73.40 -extern void
   73.41 -xen_host_metrics_free(xen_host_metrics host_metrics);
   73.42 -
   73.43 -
   73.44 -typedef struct xen_host_metrics_set
   73.45 -{
   73.46 -    size_t size;
   73.47 -    xen_host_metrics *contents[];
   73.48 -} xen_host_metrics_set;
   73.49 -
   73.50 -/**
   73.51 - * Allocate a xen_host_metrics_set of the given size.
   73.52 - */
   73.53 -extern xen_host_metrics_set *
   73.54 -xen_host_metrics_set_alloc(size_t size);
   73.55 -
   73.56 -/**
   73.57 - * Free the given xen_host_metrics_set.  The given set must have been
   73.58 - * allocated by this library.
   73.59 - */
   73.60 -extern void
   73.61 -xen_host_metrics_set_free(xen_host_metrics_set *set);
   73.62 -
   73.63 -
   73.64 -typedef struct xen_host_metrics_record
   73.65 -{
   73.66 -    xen_host_metrics handle;
   73.67 -    char *uuid;
   73.68 -    int64_t memory_total;
   73.69 -    int64_t memory_free;
   73.70 -    time_t last_updated;
   73.71 -} xen_host_metrics_record;
   73.72 -
   73.73 -/**
   73.74 - * Allocate a xen_host_metrics_record.
   73.75 - */
   73.76 -extern xen_host_metrics_record *
   73.77 -xen_host_metrics_record_alloc(void);
   73.78 -
   73.79 -/**
   73.80 - * Free the given xen_host_metrics_record, and all referenced values. 
   73.81 - * The given record must have been allocated by this library.
   73.82 - */
   73.83 -extern void
   73.84 -xen_host_metrics_record_free(xen_host_metrics_record *record);
   73.85 -
   73.86 -
   73.87 -typedef struct xen_host_metrics_record_opt
   73.88 -{
   73.89 -    bool is_record;
   73.90 -    union
   73.91 -    {
   73.92 -        xen_host_metrics handle;
   73.93 -        xen_host_metrics_record *record;
   73.94 -    } u;
   73.95 -} xen_host_metrics_record_opt;
   73.96 -
   73.97 -/**
   73.98 - * Allocate a xen_host_metrics_record_opt.
   73.99 - */
  73.100 -extern xen_host_metrics_record_opt *
  73.101 -xen_host_metrics_record_opt_alloc(void);
  73.102 -
  73.103 -/**
  73.104 - * Free the given xen_host_metrics_record_opt, and all referenced
  73.105 - * values.  The given record_opt must have been allocated by this library.
  73.106 - */
  73.107 -extern void
  73.108 -xen_host_metrics_record_opt_free(xen_host_metrics_record_opt *record_opt);
  73.109 -
  73.110 -
  73.111 -typedef struct xen_host_metrics_record_set
  73.112 -{
  73.113 -    size_t size;
  73.114 -    xen_host_metrics_record *contents[];
  73.115 -} xen_host_metrics_record_set;
  73.116 -
  73.117 -/**
  73.118 - * Allocate a xen_host_metrics_record_set of the given size.
  73.119 - */
  73.120 -extern xen_host_metrics_record_set *
  73.121 -xen_host_metrics_record_set_alloc(size_t size);
  73.122 -
  73.123 -/**
  73.124 - * Free the given xen_host_metrics_record_set, and all referenced
  73.125 - * values.  The given set must have been allocated by this library.
  73.126 - */
  73.127 -extern void
  73.128 -xen_host_metrics_record_set_free(xen_host_metrics_record_set *set);
  73.129 -
  73.130 -
  73.131 -
  73.132 -typedef struct xen_host_metrics_record_opt_set
  73.133 -{
  73.134 -    size_t size;
  73.135 -    xen_host_metrics_record_opt *contents[];
  73.136 -} xen_host_metrics_record_opt_set;
  73.137 -
  73.138 -/**
  73.139 - * Allocate a xen_host_metrics_record_opt_set of the given size.
  73.140 - */
  73.141 -extern xen_host_metrics_record_opt_set *
  73.142 -xen_host_metrics_record_opt_set_alloc(size_t size);
  73.143 -
  73.144 -/**
  73.145 - * Free the given xen_host_metrics_record_opt_set, and all referenced
  73.146 - * values.  The given set must have been allocated by this library.
  73.147 - */
  73.148 -extern void
  73.149 -xen_host_metrics_record_opt_set_free(xen_host_metrics_record_opt_set *set);
  73.150 -
  73.151 -
  73.152 -/**
  73.153 - * Get a record containing the current state of the given host_metrics.
  73.154 - */
  73.155 -extern bool
  73.156 -xen_host_metrics_get_record(xen_session *session, xen_host_metrics_record **result, xen_host_metrics host_metrics);
  73.157 -
  73.158 -
  73.159 -/**
  73.160 - * Get a reference to the host_metrics instance with the specified
  73.161 - * UUID.
  73.162 - */
  73.163 -extern bool
  73.164 -xen_host_metrics_get_by_uuid(xen_session *session, xen_host_metrics *result, char *uuid);
  73.165 -
  73.166 -
  73.167 -/**
  73.168 - * Get the uuid field of the given host_metrics.
  73.169 - */
  73.170 -extern bool
  73.171 -xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics);
  73.172 -
  73.173 -
  73.174 -/**
  73.175 - * Get the memory/total field of the given host_metrics.
  73.176 - */
  73.177 -extern bool
  73.178 -xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
  73.179 -
  73.180 -
  73.181 -/**
  73.182 - * Get the memory/free field of the given host_metrics.
  73.183 - */
  73.184 -extern bool
  73.185 -xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
  73.186 -
  73.187 -
  73.188 -/**
  73.189 - * Get the last_updated field of the given host_metrics.
  73.190 - */
  73.191 -extern bool
  73.192 -xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics);
  73.193 -
  73.194 -
  73.195 -/**
  73.196 - * Return a list of all the host_metrics instances known to the system.
  73.197 - */
  73.198 -extern bool
  73.199 -xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result);
  73.200 -
  73.201 -
  73.202 -#endif
    74.1 --- a/tools/libxen/include/xen_host_metrics_decl.h	Mon Apr 16 19:19:07 2007 -0400
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,30 +0,0 @@
    74.4 -/*
    74.5 - * Copyright (c) 2006, XenSource Inc.
    74.6 - *
    74.7 - * This library is free software; you can redistribute it and/or
    74.8 - * modify it under the terms of the GNU Lesser General Public
    74.9 - * License as published by the Free Software Foundation; either
   74.10 - * version 2.1 of the License, or (at your option) any later version.
   74.11 - *
   74.12 - * This library is distributed in the hope that it will be useful,
   74.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   74.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   74.15 - * Lesser General Public License for more details.
   74.16 - *
   74.17 - * You should have received a copy of the GNU Lesser General Public
   74.18 - * License along with this library; if not, write to the Free Software
   74.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   74.20 - */
   74.21 -
   74.22 -#ifndef XEN_HOST_METRICS_DECL_H
   74.23 -#define XEN_HOST_METRICS_DECL_H
   74.24 -
   74.25 -typedef void *xen_host_metrics;
   74.26 -
   74.27 -struct xen_host_metrics_set;
   74.28 -struct xen_host_metrics_record;
   74.29 -struct xen_host_metrics_record_set;
   74.30 -struct xen_host_metrics_record_opt;
   74.31 -struct xen_host_metrics_record_opt_set;
   74.32 -
   74.33 -#endif
    75.1 --- a/tools/libxen/include/xen_int_float_map.h	Mon Apr 16 19:19:07 2007 -0400
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,53 +0,0 @@
    75.4 -/*
    75.5 - * Copyright (c) 2006, XenSource Inc.
    75.6 - *
    75.7 - * This library is free software; you can redistribute it and/or
    75.8 - * modify it under the terms of the GNU Lesser General Public
    75.9 - * License as published by the Free Software Foundation; either
   75.10 - * version 2.1 of the License, or (at your option) any later version.
   75.11 - *
   75.12 - * This library is distributed in the hope that it will be useful,
   75.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   75.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   75.15 - * Lesser General Public License for more details.
   75.16 - *
   75.17 - * You should have received a copy of the GNU Lesser General Public
   75.18 - * License along with this library; if not, write to the Free Software
   75.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   75.20 - */
   75.21 -
   75.22 -#ifndef XEN_INT_FLOAT_MAP_H
   75.23 -#define XEN_INT_FLOAT_MAP_H
   75.24 -
   75.25 -
   75.26 -#include "xen_common.h"
   75.27 -
   75.28 -
   75.29 -typedef struct xen_int_float_map_contents
   75.30 -{
   75.31 -  int64_t key;
   75.32 -  double val;
   75.33 -} xen_int_float_map_contents;
   75.34 -
   75.35 -
   75.36 -typedef struct xen_int_float_map
   75.37 -{
   75.38 -    size_t size;
   75.39 -    xen_int_float_map_contents contents[];
   75.40 -} xen_int_float_map;
   75.41 -
   75.42 -/**
   75.43 - * Allocate a xen_int_float_map of the given size.
   75.44 - */
   75.45 -extern xen_int_float_map *
   75.46 -xen_int_float_map_alloc(size_t size);
   75.47 -
   75.48 -/**
   75.49 - * Free the given xen_int_float_map, and all referenced values.  The
   75.50 - * given map must have been allocated by this library.
   75.51 - */
   75.52 -extern void
   75.53 -xen_int_float_map_free(xen_int_float_map *map);
   75.54 -
   75.55 -
   75.56 -#endif
    76.1 --- a/tools/libxen/include/xen_int_int_map.h	Mon Apr 16 19:19:07 2007 -0400
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,53 +0,0 @@
    76.4 -/*
    76.5 - * Copyright (c) 2006-2007, XenSource Inc.
    76.6 - *
    76.7 - * This library is free software; you can redistribute it and/or
    76.8 - * modify it under the terms of the GNU Lesser General Public
    76.9 - * License as published by the Free Software Foundation; either
   76.10 - * version 2.1 of the License, or (at your option) any later version.