/usr/include/libvirt-gobject-1.0/libvirt-gobject/libvirt-gobject-domain.h is in libvirt-glib-1.0-dev 1.0.0-1.
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 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | /*
* 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;
/**
* GVirDomainSnapshotListFlags:
* @GVIR_DOMAIN_SNAPSHOT_LIST_ALL: List all snapshots
* @GVIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS: List all descendants, not just
* children, when listing a snapshot.
* For historical reasons, groups do not use contiguous bits.
* @GVIR_DOMAIN_SNAPSHOT_LIST_ROOTS: Filter by snapshots with no parents, when listing a domain
* @GVIR_DOMAIN_SNAPSHOT_LIST_METADATA: Filter by snapshots which have metadata
* @GVIR_DOMAIN_SNAPSHOT_LIST_LEAVES: Filter by snapshots with no children
* @GVIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES: Filter by snapshots that have children
* @GVIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA: Filter by snapshots with no metadata
* @GVIR_DOMAIN_SNAPSHOT_LIST_INACTIVE: Filter by snapshots taken while guest was shut off
* @GVIR_DOMAIN_SNAPSHOT_LIST_ACTIVE: Filter by snapshots taken while guest was active, and with memory state
* @GVIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY: Filter by snapshots taken while guest was active, but without memory state
* @GVIR_DOMAIN_SNAPSHOT_LIST_INTERNAL: Filter by snapshots stored internal to disk images
* @GVIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL: Filter by snapshots that use files external to disk images
*/
typedef enum {
GVIR_DOMAIN_SNAPSHOT_LIST_ALL = 0,
GVIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS = VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS,
GVIR_DOMAIN_SNAPSHOT_LIST_ROOTS = VIR_DOMAIN_SNAPSHOT_LIST_ROOTS,
GVIR_DOMAIN_SNAPSHOT_LIST_METADATA = VIR_DOMAIN_SNAPSHOT_LIST_METADATA,
GVIR_DOMAIN_SNAPSHOT_LIST_LEAVES = VIR_DOMAIN_SNAPSHOT_LIST_LEAVES,
GVIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES = VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES,
GVIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA = VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA,
GVIR_DOMAIN_SNAPSHOT_LIST_INACTIVE = VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE,
GVIR_DOMAIN_SNAPSHOT_LIST_ACTIVE = VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE,
GVIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY = VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY,
GVIR_DOMAIN_SNAPSHOT_LIST_INTERNAL = VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL,
GVIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL = VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL
} GVirDomainSnapshotListFlags;
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);
int gvir_domain_open_graphics_fd(GVirDomain *dom,
guint idx,
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);
void gvir_domain_create_snapshot_async(GVirDomain *dom,
GVirConfigDomainSnapshot *custom_conf,
guint flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GVirDomainSnapshot *gvir_domain_create_snapshot_finish(GVirDomain *domain,
GAsyncResult *result,
GError **error);
gboolean gvir_domain_fetch_snapshots(GVirDomain *dom,
guint list_flags,
GCancellable *cancellable,
GError **error);
GList *gvir_domain_get_snapshots(GVirDomain *dom);
void gvir_domain_fetch_snapshots_async(GVirDomain *dom,
guint list_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom,
GAsyncResult *res,
GError **error);
gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom,
guint flags,
gboolean *has_current_snapshot,
GError **error);
gboolean gvir_domain_set_time(GVirDomain *dom,
GDateTime *date_time,
guint flags,
GError **err);
void gvir_domain_set_time_async(GVirDomain *dom,
GDateTime *date_time,
guint flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gvir_domain_set_time_finish(GVirDomain *dom,
GAsyncResult *result,
GError **err);
G_END_DECLS
#endif /* __LIBVIRT_GOBJECT_DOMAIN_H__ */
|