/usr/include/libvirt-gobject-1.0/libvirt-gobject/libvirt-gobject-domain.h is in libvirt-glib-1.0-dev 0.1.6-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | /*
* libvirt-gobject-domain.c: libvirt gobject integration
*
* Copyright (C) 2010-2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Daniel P. Berrange <berrange@redhat.com>
*/
#if !defined(__LIBVIRT_GOBJECT_H__) && !defined(LIBVIRT_GOBJECT_BUILD)
#error "Only <libvirt-gobject/libvirt-gobject.h> can be included directly."
#endif
#ifndef __LIBVIRT_GOBJECT_DOMAIN_H__
#define __LIBVIRT_GOBJECT_DOMAIN_H__
G_BEGIN_DECLS
#include <libvirt-gobject/libvirt-gobject-stream.h>
#include <libvirt/libvirt.h>
#include <libvirt-gobject/libvirt-gobject-domain-snapshot.h>
#define GVIR_TYPE_DOMAIN (gvir_domain_get_type ())
#define GVIR_DOMAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_TYPE_DOMAIN, GVirDomain))
#define GVIR_DOMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_TYPE_DOMAIN, GVirDomainClass))
#define GVIR_IS_DOMAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_TYPE_DOMAIN))
#define GVIR_IS_DOMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_TYPE_DOMAIN))
#define GVIR_DOMAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_TYPE_DOMAIN, GVirDomainClass))
#define GVIR_TYPE_DOMAIN_INFO (gvir_domain_info_get_type())
#define GVIR_TYPE_DOMAIN_HANDLE (gvir_domain_handle_get_type())
typedef struct _GVirDomain GVirDomain;
typedef struct _GVirDomainPrivate GVirDomainPrivate;
typedef struct _GVirDomainClass GVirDomainClass;
struct _GVirDomain
{
GObject parent;
GVirDomainPrivate *priv;
/* Do not add fields to this struct */
};
struct _GVirDomainClass
{
GObjectClass parent_class;
/* signals */
void (*started)(GVirDomain *dom);
void (*stopped)(GVirDomain *dom);
void (*resumed)(GVirDomain *dom);
void (*updated)(GVirDomain *dom);
void (*suspended)(GVirDomain *dom);
void (*pmsuspended)(GVirDomain *dom);
gpointer padding[19];
};
typedef enum {
GVIR_DOMAIN_STATE_NONE = 0, /* no state */
GVIR_DOMAIN_STATE_RUNNING = 1, /* the domain is running */
GVIR_DOMAIN_STATE_BLOCKED = 2, /* the domain is blocked on resource */
GVIR_DOMAIN_STATE_PAUSED = 3, /* the domain is paused by user */
GVIR_DOMAIN_STATE_SHUTDOWN= 4, /* the domain is being shut down */
GVIR_DOMAIN_STATE_SHUTOFF = 5, /* the domain is shut off */
GVIR_DOMAIN_STATE_CRASHED = 6, /* the domain is crashed */
GVIR_DOMAIN_STATE_PMSUSPENDED = 7 /* the domain is suspended by guest
power management */
} GVirDomainState;
typedef enum {
GVIR_DOMAIN_START_NONE = 0,
GVIR_DOMAIN_START_PAUSED = (1 << 0),
GVIR_DOMAIN_START_AUTODESTROY = (1 << 1),
GVIR_DOMAIN_START_BYPASS_CACHE = (1 << 2),
GVIR_DOMAIN_START_FORCE_BOOT = (1 << 3),
} GVirDomainStartFlags;
/**
* GVirDomainDeleteFlags:
* @GVIR_DOMAIN_DELETE_NONE: No flags
* @GVIR_DOMAIN_DELETE_SAVED_STATE: Also remove associated saved state (if present).
* @GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA: If last use of domain, then also
* remove any snapshot metadata.
*/
typedef enum {
GVIR_DOMAIN_DELETE_NONE = 0,
GVIR_DOMAIN_DELETE_SAVED_STATE = VIR_DOMAIN_UNDEFINE_MANAGED_SAVE,
GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA = VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA,
} GVirDomainDeleteFlags;
/**
* GVirDomainXMLFlags:
* @GVIR_DOMAIN_XML_NONE: No flags
* @GVIR_DOMAIN_XML_SECURE: Dump security sensitive information too
* @GVIR_DOMAIN_XML_INACTIVE: Dump inactive domain information
* @GVIR_DOMAIN_XML_UPDATE_CPU: Update guest CPU requirements according to host CPU
*/
typedef enum {
GVIR_DOMAIN_XML_NONE = 0,
GVIR_DOMAIN_XML_SECURE = VIR_DOMAIN_XML_SECURE,
GVIR_DOMAIN_XML_INACTIVE = VIR_DOMAIN_XML_INACTIVE,
GVIR_DOMAIN_XML_UPDATE_CPU = VIR_DOMAIN_XML_UPDATE_CPU,
} GVirDomainXMLFlags;
/**
* GVirDomainShutdownFlags:
* @GVIR_DOMAIN_SHUTDOWN_NONE: No flags, hypervisor choice
* @GVIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN: Send ACPI event
* @GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT: Use guest agent
*
*/
typedef enum {
GVIR_DOMAIN_SHUTDOWN_NONE = 0,
GVIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN,
GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT = VIR_DOMAIN_SHUTDOWN_GUEST_AGENT,
} GVirDomainShutdownFlags;
/**
* GVirDomainSnapshotCreateFlags:
* @GVIR_DOMAIN_SNAPSHOT_NONE: No flags
* @GVIR_DOMAIN_SNAPSHOT_REDEFINE: Restore or alter metadata
* @GVIR_DOMAIN_SNAPSHOT_CURRENT: With redefine, make snapshot current
* @GVIR_DOMAIN_SNAPSHOT_NO_METADATA: Make snapshot without remembering it
* @GVIR_DOMAIN_SNAPSHOT_HALT: Stop running guest after snapshot
* @GVIR_DOMAIN_SNAPSHOT_DISK_ONLY: Disk snapshot, not system checkpoint
* @GVIR_DOMAIN_SNAPSHOT_REUSE_EXT: Reuse any existing external files
* @GVIR_DOMAIN_SNAPSHOT_QUIESCE: Use guest agent to quiesce all mounter
* file systems within the domain
* @GVIR_DOMAIN_SNAPSHOT_ATOMIC: Atomically avoid partial changes
*/
typedef enum {
GVIR_DOMAIN_SNAPSHOT_NONE = 0,
GVIR_DOMAIN_SNAPSHOT_REDEFINE = VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE,
GVIR_DOMAIN_SNAPSHOT_CURRENT = VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT,
GVIR_DOMAIN_SNAPSHOT_NO_METADATA = VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA,
GVIR_DOMAIN_SNAPSHOT_HALT = VIR_DOMAIN_SNAPSHOT_CREATE_HALT,
GVIR_DOMAIN_SNAPSHOT_DISK_ONLY = VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY,
GVIR_DOMAIN_SNAPSHOT_REUSE_EXT = VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT,
GVIR_DOMAIN_SNAPSHOT_QUIESCE = VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE,
GVIR_DOMAIN_SNAPSHOT_ATOMIC = VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC,
} GVirDomainSnapshotCreateFlags;
/**
* GVirDomainUpdateDeviceFlags:
* @GVIR_DOMAIN_UPDATE_DEVICE_CURRENT: Update current domain state
* @GVIR_DOMAIN_UPDATE_DEVICE_LIVE: Update state for only active domains
* @GVIR_DOMAIN_UPDATE_DEVICE_CONFIG: Update state for persistent state only
*/
typedef enum {
GVIR_DOMAIN_UPDATE_DEVICE_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
GVIR_DOMAIN_UPDATE_DEVICE_LIVE = VIR_DOMAIN_AFFECT_LIVE,
GVIR_DOMAIN_UPDATE_DEVICE_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
} GVirDomainUpdateDeviceFlags;
/**
* GVirDomainRebootFlags:
* @GVIR_DOMAIN_REBOOT_NONE: No flags, hypervisor choice
* @GVIR_DOMAIN_REBOOT_ACPI_POWER_BTN: Send ACPI event
* @GVIR_DOMAIN_REBOOT_GUEST_AGENT: Use guest agent
*
*/
typedef enum {
GVIR_DOMAIN_REBOOT_NONE = 0,
GVIR_DOMAIN_REBOOT_ACPI_POWER_BTN = VIR_DOMAIN_REBOOT_ACPI_POWER_BTN,
GVIR_DOMAIN_REBOOT_GUEST_AGENT = VIR_DOMAIN_REBOOT_GUEST_AGENT,
} GVirDomainRebootFlags;
typedef struct _GVirDomainInfo GVirDomainInfo;
struct _GVirDomainInfo
{
GVirDomainState state; /* the running state */
guint64 maxMem; /* the maximum memory in KBytes allowed */
guint64 memory; /* the memory in KBytes used by the domain */
guint16 nrVirtCpu; /* the number of virtual CPUs for the domain */
guint64 cpuTime; /* the CPU time used in nanoseconds */
};
GType gvir_domain_get_type(void);
GType gvir_domain_info_get_type(void);
GType gvir_domain_handle_get_type(void);
const gchar *gvir_domain_get_name(GVirDomain *dom);
const gchar *gvir_domain_get_uuid(GVirDomain *dom);
gint gvir_domain_get_id(GVirDomain *dom,
GError **err);
gboolean gvir_domain_start(GVirDomain *dom,
guint flags,
GError **err);
void gvir_domain_start_async(GVirDomain *dom,
guint flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_start_finish(GVirDomain *dom,
GAsyncResult *result,
GError **err);
gboolean gvir_domain_resume(GVirDomain *dom,
GError **err);
void gvir_domain_resume_async(GVirDomain *dom,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_resume_finish(GVirDomain *dom,
GAsyncResult *result,
GError **err);
gboolean gvir_domain_wakeup(GVirDomain *dom,
guint flags,
GError **err);
void gvir_domain_wakeup_async(GVirDomain *dom,
guint flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_wakeup_finish(GVirDomain *dom,
GAsyncResult *result,
GError **err);
gboolean gvir_domain_stop(GVirDomain *dom,
guint flags,
GError **err);
gboolean gvir_domain_delete(GVirDomain *dom,
guint flags,
GError **err);
gboolean gvir_domain_shutdown(GVirDomain *dom,
guint flags,
GError **err);
gboolean gvir_domain_reboot(GVirDomain *dom,
guint flags,
GError **err);
gboolean gvir_domain_save_to_file(GVirDomain *dom,
gchar *filename,
GVirConfigDomain *custom_conf,
guint flags,
GError **err);
void gvir_domain_save_to_file_async(GVirDomain *dom,
gchar *filename,
GVirConfigDomain *custom_conf,
guint flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_save_to_file_finish(GVirDomain *dom,
GAsyncResult *result,
GError **err);
GVirDomainInfo *gvir_domain_get_info(GVirDomain *dom,
GError **err);
void gvir_domain_get_info_async(GVirDomain *dom,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GVirDomainInfo *gvir_domain_get_info_finish(GVirDomain *dom,
GAsyncResult *result,
GError **err);
GVirConfigDomain *gvir_domain_get_config(GVirDomain *dom,
guint flags,
GError **err);
gboolean gvir_domain_set_config(GVirDomain *domain,
GVirConfigDomain *conf,
GError **err);
gchar *gvir_domain_screenshot(GVirDomain *dom,
GVirStream *stream,
guint monitor_id,
guint flags,
GError **err);
gboolean gvir_domain_open_console(GVirDomain *dom,
GVirStream *stream,
const gchar *devname,
guint flags,
GError **err);
gboolean gvir_domain_open_graphics(GVirDomain *dom,
guint idx,
int fd,
unsigned int flags,
GError **err);
gboolean gvir_domain_suspend (GVirDomain *dom,
GError **err);
gboolean gvir_domain_save (GVirDomain *dom,
unsigned int flags,
GError **err);
void gvir_domain_save_async (GVirDomain *dom,
unsigned int flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_save_finish (GVirDomain *dom,
GAsyncResult *result,
GError **err);
gboolean gvir_domain_get_persistent(GVirDomain *dom);
gboolean gvir_domain_get_saved(GVirDomain *dom);
GList *gvir_domain_get_devices(GVirDomain *domain,
GError **err);
gboolean gvir_domain_update_device(GVirDomain *dom,
GVirConfigDomainDevice *device,
guint flags,
GError **err);
GVirDomainSnapshot *
gvir_domain_create_snapshot(GVirDomain *dom,
GVirConfigDomainSnapshot *custom_conf,
guint flags,
GError **err);
G_END_DECLS
#endif /* __LIBVIRT_GOBJECT_DOMAIN_H__ */
|