ia64/xen-unstable

annotate tools/libxen/include/xen_console.h @ 14043:be35eed950da

Rename Console.uri to location. Xend already uses the latter.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 20 19:23:28 2007 +0000 (2007-02-20)
parents 462b945e2f41
children 988b90c6b4f3
rev   line source
ewan@12672 1 /*
ewan@14043 2 * Copyright (c) 2006-2007, XenSource Inc.
ewan@12672 3 *
ewan@12672 4 * This library is free software; you can redistribute it and/or
ewan@12672 5 * modify it under the terms of the GNU Lesser General Public
ewan@12672 6 * License as published by the Free Software Foundation; either
ewan@12672 7 * version 2.1 of the License, or (at your option) any later version.
ewan@12672 8 *
ewan@12672 9 * This library is distributed in the hope that it will be useful,
ewan@12672 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ewan@12672 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ewan@12672 12 * Lesser General Public License for more details.
ewan@12672 13 *
ewan@12672 14 * You should have received a copy of the GNU Lesser General Public
ewan@12672 15 * License along with this library; if not, write to the Free Software
ewan@12672 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ewan@12672 17 */
ewan@12672 18
ewan@12672 19 #ifndef XEN_CONSOLE_H
ewan@12672 20 #define XEN_CONSOLE_H
ewan@12672 21
ewan@12672 22 #include "xen_common.h"
ewan@12672 23 #include "xen_console_decl.h"
ewan@12672 24 #include "xen_console_protocol.h"
ewan@12672 25 #include "xen_vm_decl.h"
ewan@12672 26
ewan@12672 27
ewan@12672 28 /*
ewan@14043 29 * The console class.
ewan@14043 30 *
ewan@12672 31 * A console.
ewan@12672 32 */
ewan@12672 33
ewan@12672 34
ewan@12672 35 /**
ewan@12672 36 * Free the given xen_console. The given handle must have been
ewan@12672 37 * allocated by this library.
ewan@12672 38 */
ewan@12672 39 extern void
ewan@12672 40 xen_console_free(xen_console console);
ewan@12672 41
ewan@12672 42
ewan@12672 43 typedef struct xen_console_set
ewan@12672 44 {
ewan@12672 45 size_t size;
ewan@12672 46 xen_console *contents[];
ewan@12672 47 } xen_console_set;
ewan@12672 48
ewan@12672 49 /**
ewan@12672 50 * Allocate a xen_console_set of the given size.
ewan@12672 51 */
ewan@12672 52 extern xen_console_set *
ewan@12672 53 xen_console_set_alloc(size_t size);
ewan@12672 54
ewan@12672 55 /**
ewan@12672 56 * Free the given xen_console_set. The given set must have been
ewan@12672 57 * allocated by this library.
ewan@12672 58 */
ewan@12672 59 extern void
ewan@12672 60 xen_console_set_free(xen_console_set *set);
ewan@12672 61
ewan@12672 62
ewan@12672 63 typedef struct xen_console_record
ewan@12672 64 {
ewan@12672 65 xen_console handle;
ewan@12672 66 char *uuid;
ewan@12672 67 enum xen_console_protocol protocol;
ewan@14043 68 char *location;
ewan@12672 69 struct xen_vm_record_opt *vm;
ewan@12672 70 } xen_console_record;
ewan@12672 71
ewan@12672 72 /**
ewan@12672 73 * Allocate a xen_console_record.
ewan@12672 74 */
ewan@12672 75 extern xen_console_record *
ewan@12672 76 xen_console_record_alloc(void);
ewan@12672 77
ewan@12672 78 /**
ewan@12672 79 * Free the given xen_console_record, and all referenced values. The
ewan@12672 80 * given record must have been allocated by this library.
ewan@12672 81 */
ewan@12672 82 extern void
ewan@12672 83 xen_console_record_free(xen_console_record *record);
ewan@12672 84
ewan@12672 85
ewan@12672 86 typedef struct xen_console_record_opt
ewan@12672 87 {
ewan@12672 88 bool is_record;
ewan@12672 89 union
ewan@12672 90 {
ewan@12672 91 xen_console handle;
ewan@12672 92 xen_console_record *record;
ewan@12672 93 } u;
ewan@12672 94 } xen_console_record_opt;
ewan@12672 95
ewan@12672 96 /**
ewan@12672 97 * Allocate a xen_console_record_opt.
ewan@12672 98 */
ewan@12672 99 extern xen_console_record_opt *
ewan@12672 100 xen_console_record_opt_alloc(void);
ewan@12672 101
ewan@12672 102 /**
ewan@12672 103 * Free the given xen_console_record_opt, and all referenced values.
ewan@12672 104 * The given record_opt must have been allocated by this library.
ewan@12672 105 */
ewan@12672 106 extern void
ewan@12672 107 xen_console_record_opt_free(xen_console_record_opt *record_opt);
ewan@12672 108
ewan@12672 109
ewan@12672 110 typedef struct xen_console_record_set
ewan@12672 111 {
ewan@12672 112 size_t size;
ewan@12672 113 xen_console_record *contents[];
ewan@12672 114 } xen_console_record_set;
ewan@12672 115
ewan@12672 116 /**
ewan@12672 117 * Allocate a xen_console_record_set of the given size.
ewan@12672 118 */
ewan@12672 119 extern xen_console_record_set *
ewan@12672 120 xen_console_record_set_alloc(size_t size);
ewan@12672 121
ewan@12672 122 /**
ewan@12672 123 * Free the given xen_console_record_set, and all referenced values.
ewan@12672 124 * The given set must have been allocated by this library.
ewan@12672 125 */
ewan@12672 126 extern void
ewan@12672 127 xen_console_record_set_free(xen_console_record_set *set);
ewan@12672 128
ewan@12672 129
ewan@12672 130
ewan@12672 131 typedef struct xen_console_record_opt_set
ewan@12672 132 {
ewan@12672 133 size_t size;
ewan@12672 134 xen_console_record_opt *contents[];
ewan@12672 135 } xen_console_record_opt_set;
ewan@12672 136
ewan@12672 137 /**
ewan@12672 138 * Allocate a xen_console_record_opt_set of the given size.
ewan@12672 139 */
ewan@12672 140 extern xen_console_record_opt_set *
ewan@12672 141 xen_console_record_opt_set_alloc(size_t size);
ewan@12672 142
ewan@12672 143 /**
ewan@12672 144 * Free the given xen_console_record_opt_set, and all referenced
ewan@12672 145 * values. The given set must have been allocated by this library.
ewan@12672 146 */
ewan@12672 147 extern void
ewan@12672 148 xen_console_record_opt_set_free(xen_console_record_opt_set *set);
ewan@12672 149
ewan@12672 150
ewan@12672 151 /**
ewan@12999 152 * Get a record containing the current state of the given console.
ewan@12672 153 */
ewan@12672 154 extern bool
ewan@12672 155 xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
ewan@12672 156
ewan@12672 157
ewan@12672 158 /**
ewan@12999 159 * Get a reference to the console instance with the specified UUID.
ewan@12672 160 */
ewan@12672 161 extern bool
ewan@12672 162 xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
ewan@12672 163
ewan@12672 164
ewan@12672 165 /**
ewan@12672 166 * Create a new console instance, and return its handle.
ewan@12672 167 */
ewan@12672 168 extern bool
ewan@12672 169 xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
ewan@12672 170
ewan@12672 171
ewan@12672 172 /**
ewan@12672 173 * Destroy the specified console instance.
ewan@12672 174 */
ewan@12672 175 extern bool
ewan@12672 176 xen_console_destroy(xen_session *session, xen_console console);
ewan@12672 177
ewan@12672 178
ewan@12672 179 /**
ewan@12672 180 * Get the uuid field of the given console.
ewan@12672 181 */
ewan@12672 182 extern bool
ewan@12672 183 xen_console_get_uuid(xen_session *session, char **result, xen_console console);
ewan@12672 184
ewan@12672 185
ewan@12672 186 /**
ewan@12672 187 * Get the protocol field of the given console.
ewan@12672 188 */
ewan@12672 189 extern bool
ewan@12672 190 xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
ewan@12672 191
ewan@12672 192
ewan@12672 193 /**
ewan@14043 194 * Get the location field of the given console.
ewan@12672 195 */
ewan@12672 196 extern bool
ewan@14043 197 xen_console_get_location(xen_session *session, char **result, xen_console console);
ewan@12672 198
ewan@12672 199
ewan@12672 200 /**
ewan@12672 201 * Get the VM field of the given console.
ewan@12672 202 */
ewan@12672 203 extern bool
ewan@12672 204 xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
ewan@12672 205
ewan@12672 206
ewan@12672 207 #endif