2007-03-06 15:55:44 -06:00
|
|
|
/* -*- c -*-
|
2012-07-27 04:39:53 -05:00
|
|
|
* libvirt.h: Core interfaces for the libvirt library
|
2012-07-27 08:17:45 -05:00
|
|
|
* Summary: core interfaces for the libvirt library
|
|
|
|
* Description: Provides the interfaces of the libvirt library to handle
|
|
|
|
* virtualized domains
|
2005-12-08 09:08:46 -06:00
|
|
|
*
|
2014-03-27 00:49:48 -05:00
|
|
|
* Copyright (C) 2005-2006, 2010-2014 Red Hat, Inc.
|
2005-12-08 09:08:46 -06:00
|
|
|
*
|
2012-07-27 04:39:53 -05:00
|
|
|
* 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
|
2012-09-20 17:30:55 -05:00
|
|
|
* License along with this library. If not, see
|
2012-07-27 04:39:53 -05:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2005-12-08 09:08:46 -06:00
|
|
|
*
|
|
|
|
* Author: Daniel Veillard <veillard@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_VIRLIB_H__
|
|
|
|
#define __VIR_VIRLIB_H__
|
|
|
|
|
2007-08-21 05:08:12 -05:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-05-23 03:32:08 -05:00
|
|
|
#ifndef VIR_DEPRECATED
|
|
|
|
/* The feature is present in gcc-3.1 and newer. */
|
|
|
|
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
|
|
|
# define VIR_DEPRECATED __attribute__((__deprecated__))
|
|
|
|
# else
|
|
|
|
# define VIR_DEPRECATED /* nothing */
|
|
|
|
# endif
|
|
|
|
#endif /* VIR_DEPRECATED */
|
|
|
|
|
2010-03-16 17:54:22 -05:00
|
|
|
#ifdef WIN32
|
|
|
|
# ifdef LIBVIRT_STATIC
|
|
|
|
# define VIR_EXPORT_VAR extern
|
|
|
|
# else
|
|
|
|
# ifdef IN_LIBVIRT
|
|
|
|
# define VIR_EXPORT_VAR __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define VIR_EXPORT_VAR __declspec(dllimport) extern
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# define VIR_EXPORT_VAR extern
|
|
|
|
#endif
|
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
/* General note - throughout this file, any linear enumeration which
|
|
|
|
* might be expanded in the future has an optional *_LAST value that
|
|
|
|
* gives the size of the enum at the time of compilation, if the user
|
|
|
|
* defines VIR_ENUM_SENTINELS. Enumerations for bit values do not
|
|
|
|
* have a *_LAST value, but additional bits may be defined. */
|
|
|
|
|
2012-07-19 05:01:07 -05:00
|
|
|
/*
|
|
|
|
* virFreeCallback:
|
|
|
|
* @opaque: opaque user data provided at registration
|
|
|
|
*
|
|
|
|
* Type for a callback cleanup function to be paired with a callback. This
|
|
|
|
* function will be called as a final chance to clean up the @opaque
|
|
|
|
* registered with the primary callback, at the time when the primary
|
|
|
|
* callback is deregistered.
|
|
|
|
*
|
|
|
|
* It is forbidden to call any other libvirt APIs from an
|
|
|
|
* implementation of this callback, since it can be invoked
|
|
|
|
* from a context which is not re-entrant safe. Failure to
|
|
|
|
* abide by this requirement may lead to application deadlocks
|
|
|
|
* or crashes.
|
|
|
|
*/
|
|
|
|
typedef void (*virFreeCallback)(void *opaque);
|
|
|
|
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/**
|
|
|
|
* virConnect:
|
|
|
|
*
|
|
|
|
* a virConnect is a private structure representing a connection to
|
2008-07-25 03:52:19 -05:00
|
|
|
* the Hypervisor.
|
2005-12-08 09:08:46 -06:00
|
|
|
*/
|
|
|
|
typedef struct _virConnect virConnect;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectPtr:
|
|
|
|
*
|
|
|
|
* a virConnectPtr is pointer to a virConnect private structure, this is the
|
2008-07-25 03:52:19 -05:00
|
|
|
* type used to reference a connection to the Hypervisor in the API.
|
2005-12-08 09:08:46 -06:00
|
|
|
*/
|
|
|
|
typedef virConnect *virConnectPtr;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomain:
|
|
|
|
*
|
2008-07-25 03:52:19 -05:00
|
|
|
* a virDomain is a private structure representing a domain.
|
2005-12-08 09:08:46 -06:00
|
|
|
*/
|
|
|
|
typedef struct _virDomain virDomain;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainPtr:
|
|
|
|
*
|
|
|
|
* a virDomainPtr is pointer to a virDomain private structure, this is the
|
2008-07-25 03:52:19 -05:00
|
|
|
* type used to reference a domain in the API.
|
2005-12-08 09:08:46 -06:00
|
|
|
*/
|
|
|
|
typedef virDomain *virDomainPtr;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainState:
|
|
|
|
*
|
|
|
|
* A domain may be in different states at a given point in time
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2013-01-10 05:44:23 -06:00
|
|
|
VIR_DOMAIN_NOSTATE = 0, /* no state */
|
|
|
|
VIR_DOMAIN_RUNNING = 1, /* the domain is running */
|
|
|
|
VIR_DOMAIN_BLOCKED = 2, /* the domain is blocked on resource */
|
|
|
|
VIR_DOMAIN_PAUSED = 3, /* the domain is paused by user */
|
|
|
|
VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */
|
|
|
|
VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */
|
|
|
|
VIR_DOMAIN_CRASHED = 6, /* the domain is crashed */
|
|
|
|
VIR_DOMAIN_PMSUSPENDED = 7, /* the domain is suspended by guest
|
2013-01-10 06:49:09 -06:00
|
|
|
power management */
|
2011-08-18 19:14:40 -05:00
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_DOMAIN_LAST
|
2011-08-18 19:14:40 -05:00
|
|
|
/*
|
|
|
|
* NB: this enum value will increase over time as new events are
|
|
|
|
* added to the libvirt API. It reflects the last state supported
|
|
|
|
* by this version of the libvirt API.
|
|
|
|
*/
|
2012-01-20 12:43:28 -06:00
|
|
|
#endif
|
2005-12-08 09:08:46 -06:00
|
|
|
} virDomainState;
|
|
|
|
|
2011-04-22 06:31:35 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_NOSTATE_UNKNOWN = 0,
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_NOSTATE_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainNostateReason;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_RUNNING_UNKNOWN = 0,
|
|
|
|
VIR_DOMAIN_RUNNING_BOOTED = 1, /* normal startup from boot */
|
|
|
|
VIR_DOMAIN_RUNNING_MIGRATED = 2, /* migrated from another host */
|
|
|
|
VIR_DOMAIN_RUNNING_RESTORED = 3, /* restored from a state file */
|
|
|
|
VIR_DOMAIN_RUNNING_FROM_SNAPSHOT = 4, /* restored from snapshot */
|
|
|
|
VIR_DOMAIN_RUNNING_UNPAUSED = 5, /* returned from paused state */
|
|
|
|
VIR_DOMAIN_RUNNING_MIGRATION_CANCELED = 6, /* returned from migration */
|
|
|
|
VIR_DOMAIN_RUNNING_SAVE_CANCELED = 7, /* returned from failed save process */
|
2012-03-14 10:26:55 -05:00
|
|
|
VIR_DOMAIN_RUNNING_WAKEUP = 8, /* returned from pmsuspended due to
|
|
|
|
wakeup event */
|
2013-06-07 05:23:31 -05:00
|
|
|
VIR_DOMAIN_RUNNING_CRASHED = 9, /* resumed from crashed */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_RUNNING_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainRunningReason;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCKED_UNKNOWN = 0, /* the reason is unknown */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_BLOCKED_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainBlockedReason;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_PAUSED_UNKNOWN = 0, /* the reason is unknown */
|
|
|
|
VIR_DOMAIN_PAUSED_USER = 1, /* paused on user request */
|
|
|
|
VIR_DOMAIN_PAUSED_MIGRATION = 2, /* paused for offline migration */
|
|
|
|
VIR_DOMAIN_PAUSED_SAVE = 3, /* paused for save */
|
|
|
|
VIR_DOMAIN_PAUSED_DUMP = 4, /* paused for offline core dump */
|
|
|
|
VIR_DOMAIN_PAUSED_IOERROR = 5, /* paused due to a disk I/O error */
|
|
|
|
VIR_DOMAIN_PAUSED_WATCHDOG = 6, /* paused due to a watchdog event */
|
2011-08-05 17:05:50 -05:00
|
|
|
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT = 7, /* paused after restoring from snapshot */
|
2011-09-15 08:07:51 -05:00
|
|
|
VIR_DOMAIN_PAUSED_SHUTTING_DOWN = 8, /* paused during shutdown process */
|
2012-10-09 05:11:56 -05:00
|
|
|
VIR_DOMAIN_PAUSED_SNAPSHOT = 9, /* paused while creating a snapshot */
|
2013-07-29 11:54:57 -05:00
|
|
|
VIR_DOMAIN_PAUSED_CRASHED = 10, /* paused due to a guest crash */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_PAUSED_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainPausedReason;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SHUTDOWN_UNKNOWN = 0, /* the reason is unknown */
|
|
|
|
VIR_DOMAIN_SHUTDOWN_USER = 1, /* shutting down on user request */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_SHUTDOWN_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainShutdownReason;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SHUTOFF_UNKNOWN = 0, /* the reason is unknown */
|
|
|
|
VIR_DOMAIN_SHUTOFF_SHUTDOWN = 1, /* normal shutdown */
|
|
|
|
VIR_DOMAIN_SHUTOFF_DESTROYED = 2, /* forced poweroff */
|
|
|
|
VIR_DOMAIN_SHUTOFF_CRASHED = 3, /* domain crashed */
|
|
|
|
VIR_DOMAIN_SHUTOFF_MIGRATED = 4, /* migrated to another host */
|
|
|
|
VIR_DOMAIN_SHUTOFF_SAVED = 5, /* saved to a file */
|
|
|
|
VIR_DOMAIN_SHUTOFF_FAILED = 6, /* domain failed to start */
|
|
|
|
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT = 7, /* restored from a snapshot which was
|
|
|
|
* taken while domain was shutoff */
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_SHUTOFF_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainShutoffReason;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CRASHED_UNKNOWN = 0, /* crashed for unknown reason */
|
2013-06-07 05:23:31 -05:00
|
|
|
VIR_DOMAIN_CRASHED_PANICKED = 1, /* domain panicked */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_CRASHED_LAST
|
|
|
|
#endif
|
2011-04-22 06:31:35 -05:00
|
|
|
} virDomainCrashedReason;
|
|
|
|
|
2012-03-14 10:26:53 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_PMSUSPENDED_UNKNOWN = 0,
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_PMSUSPENDED_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainPMSuspendedReason;
|
2011-05-24 03:28:50 -05:00
|
|
|
|
2012-10-12 14:13:39 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN = 0,
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_PMSUSPENDED_DISK_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainPMSuspendedDiskReason;
|
|
|
|
|
2011-05-24 03:28:50 -05:00
|
|
|
/**
|
|
|
|
* virDomainControlState:
|
|
|
|
*
|
|
|
|
* Current state of a control interface to the domain.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CONTROL_OK = 0, /* operational, ready to accept commands */
|
|
|
|
VIR_DOMAIN_CONTROL_JOB = 1, /* background job is running (can be
|
|
|
|
monitored by virDomainGetJobInfo); only
|
|
|
|
limited set of commands may be allowed */
|
|
|
|
VIR_DOMAIN_CONTROL_OCCUPIED = 2, /* occupied by a running command */
|
|
|
|
VIR_DOMAIN_CONTROL_ERROR = 3, /* unusable, domain cannot be fully operated */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_CONTROL_LAST
|
|
|
|
#endif
|
2011-05-24 03:28:50 -05:00
|
|
|
} virDomainControlState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainControlInfo:
|
|
|
|
*
|
|
|
|
* Structure filled in by virDomainGetControlInfo and providing details about
|
|
|
|
* current state of control interface to a domain.
|
|
|
|
*/
|
|
|
|
typedef struct _virDomainControlInfo virDomainControlInfo;
|
|
|
|
struct _virDomainControlInfo {
|
|
|
|
unsigned int state; /* control state, one of virDomainControlState */
|
|
|
|
unsigned int details; /* state details, currently 0 */
|
|
|
|
unsigned long long stateTime; /* for how long (in msec) control interface
|
|
|
|
has been in current state (except for OK
|
|
|
|
and ERROR states) */
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainControlInfoPtr:
|
|
|
|
*
|
|
|
|
* Pointer to virDomainControlInfo structure.
|
|
|
|
*/
|
|
|
|
typedef virDomainControlInfo *virDomainControlInfoPtr;
|
|
|
|
|
2011-06-03 11:10:58 -05:00
|
|
|
/**
|
|
|
|
* virDomainModificationImpact:
|
|
|
|
*
|
2011-06-03 11:06:33 -05:00
|
|
|
* Several modification APIs take flags to determine whether a change
|
|
|
|
* to the domain affects just the running instance, just the
|
|
|
|
* persistent definition, or both at the same time. The counterpart
|
|
|
|
* query APIs also take the same flags to determine whether to query
|
|
|
|
* the running instance or persistent definition, although both cannot
|
|
|
|
* be queried at once.
|
|
|
|
*
|
|
|
|
* The use of VIR_DOMAIN_AFFECT_CURRENT will resolve to either
|
|
|
|
* VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG according to
|
|
|
|
* current domain state. VIR_DOMAIN_AFFECT_LIVE requires a running
|
2011-06-03 11:10:58 -05:00
|
|
|
* domain, and VIR_DOMAIN_AFFECT_CONFIG requires a persistent domain
|
|
|
|
* (whether or not it is running).
|
API: add VIR_TYPED_PARAM_STRING
This allows strings to be transported between client and server
in the context of name-type-value virTypedParameter functions.
For compatibility,
o new clients will not send strings to old servers, based on
a feature check
o new servers will not send strings to old clients without the
flag VIR_TYPED_PARAM_STRING_OKAY; this will be enforced at
the RPC layer in the next patch, so that drivers need not
worry about it in general. The one exception is that
virDomainGetSchedulerParameters lacks a flags argument, so
it must not return a string; drivers that forward that
function on to virDomainGetSchedulerParametersFlags will
have to pay attention to the flag.
o the flag VIR_TYPED_PARAM_STRING_OKAY is set automatically,
based on a feature check (so far, no driver implements it),
so clients do not have to worry about it
Future patches can then enable the feature on a per-driver basis.
This patch also ensures that drivers can blindly strdup() field
names (previously, a malicious client could stuff 80 non-NUL bytes
into field and cause a read overrun).
* src/libvirt_internal.h (VIR_DRV_FEATURE_TYPED_PARAM_STRING): New
driver feature.
* src/libvirt.c (virTypedParameterValidateSet)
(virTypedParameterSanitizeGet): New helper functions.
(virDomainSetMemoryParameters, virDomainSetBlkioParameters)
(virDomainSetSchedulerParameters)
(virDomainSetSchedulerParametersFlags)
(virDomainGetMemoryParameters, virDomainGetBlkioParameters)
(virDomainGetSchedulerParameters)
(virDomainGetSchedulerParametersFlags, virDomainBlockStatsFlags):
Use them.
* src/util/util.h (virTypedParameterArrayClear): New helper
function.
* src/util/util.c (virTypedParameterArrayClear): Implement it.
* src/libvirt_private.syms (util.h): Export it.
Based on an initial patch by Hu Tao, with feedback from
Daniel P. Berrange.
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-10-12 04:26:34 -05:00
|
|
|
*
|
|
|
|
* These enums should not conflict with those of virTypedParameterFlags.
|
2011-06-03 11:10:58 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_AFFECT_CURRENT = 0, /* Affect current domain state. */
|
|
|
|
VIR_DOMAIN_AFFECT_LIVE = 1 << 0, /* Affect running domain state. */
|
|
|
|
VIR_DOMAIN_AFFECT_CONFIG = 1 << 1, /* Affect persistent domain state. */
|
API: add VIR_TYPED_PARAM_STRING
This allows strings to be transported between client and server
in the context of name-type-value virTypedParameter functions.
For compatibility,
o new clients will not send strings to old servers, based on
a feature check
o new servers will not send strings to old clients without the
flag VIR_TYPED_PARAM_STRING_OKAY; this will be enforced at
the RPC layer in the next patch, so that drivers need not
worry about it in general. The one exception is that
virDomainGetSchedulerParameters lacks a flags argument, so
it must not return a string; drivers that forward that
function on to virDomainGetSchedulerParametersFlags will
have to pay attention to the flag.
o the flag VIR_TYPED_PARAM_STRING_OKAY is set automatically,
based on a feature check (so far, no driver implements it),
so clients do not have to worry about it
Future patches can then enable the feature on a per-driver basis.
This patch also ensures that drivers can blindly strdup() field
names (previously, a malicious client could stuff 80 non-NUL bytes
into field and cause a read overrun).
* src/libvirt_internal.h (VIR_DRV_FEATURE_TYPED_PARAM_STRING): New
driver feature.
* src/libvirt.c (virTypedParameterValidateSet)
(virTypedParameterSanitizeGet): New helper functions.
(virDomainSetMemoryParameters, virDomainSetBlkioParameters)
(virDomainSetSchedulerParameters)
(virDomainSetSchedulerParametersFlags)
(virDomainGetMemoryParameters, virDomainGetBlkioParameters)
(virDomainGetSchedulerParameters)
(virDomainGetSchedulerParametersFlags, virDomainBlockStatsFlags):
Use them.
* src/util/util.h (virTypedParameterArrayClear): New helper
function.
* src/util/util.c (virTypedParameterArrayClear): Implement it.
* src/libvirt_private.syms (util.h): Export it.
Based on an initial patch by Hu Tao, with feedback from
Daniel P. Berrange.
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-10-12 04:26:34 -05:00
|
|
|
/* 1 << 2 is reserved for virTypedParameterFlags */
|
2011-06-03 11:10:58 -05:00
|
|
|
} virDomainModificationImpact;
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/**
|
|
|
|
* virDomainInfoPtr:
|
|
|
|
*
|
2006-03-29 06:46:03 -06:00
|
|
|
* a virDomainInfo is a structure filled by virDomainGetInfo() and extracting
|
2008-03-14 06:08:03 -05:00
|
|
|
* runtime information for a given active Domain
|
2005-12-08 09:08:46 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _virDomainInfo virDomainInfo;
|
|
|
|
|
|
|
|
struct _virDomainInfo {
|
2008-09-17 09:15:20 -05:00
|
|
|
unsigned char state; /* the running state, one of virDomainState */
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
unsigned long maxMem; /* the maximum memory in KBytes allowed */
|
|
|
|
unsigned long memory; /* the memory in KBytes used by the domain */
|
|
|
|
unsigned short nrVirtCpu; /* the number of virtual CPUs for the domain */
|
|
|
|
unsigned long long cpuTime; /* the CPU time used in nanoseconds */
|
2005-12-08 09:08:46 -06:00
|
|
|
};
|
|
|
|
|
2006-01-17 10:56:17 -06:00
|
|
|
/**
|
|
|
|
* virDomainInfoPtr:
|
|
|
|
*
|
|
|
|
* a virDomainInfoPtr is a pointer to a virDomainInfo structure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef virDomainInfo *virDomainInfoPtr;
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/**
|
2005-12-16 06:16:41 -06:00
|
|
|
* virDomainCreateFlags:
|
2005-12-08 09:08:46 -06:00
|
|
|
*
|
|
|
|
* Flags OR'ed together to provide specific behaviour when creating a
|
|
|
|
* Domain.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2011-07-06 13:10:11 -05:00
|
|
|
VIR_DOMAIN_NONE = 0, /* Default behavior */
|
|
|
|
VIR_DOMAIN_START_PAUSED = 1 << 0, /* Launch guest in paused state */
|
|
|
|
VIR_DOMAIN_START_AUTODESTROY = 1 << 1, /* Automatically kill guest when virConnectPtr is closed */
|
|
|
|
VIR_DOMAIN_START_BYPASS_CACHE = 1 << 2, /* Avoid file system cache pollution */
|
2011-08-27 18:07:18 -05:00
|
|
|
VIR_DOMAIN_START_FORCE_BOOT = 1 << 3, /* Boot, discarding any managed save */
|
2005-12-16 06:16:41 -06:00
|
|
|
} virDomainCreateFlags;
|
2005-12-08 09:08:46 -06:00
|
|
|
|
2009-07-10 06:18:12 -05:00
|
|
|
|
2011-11-29 00:37:06 -06:00
|
|
|
/**
|
|
|
|
* virNodeSuspendTarget:
|
|
|
|
*
|
|
|
|
* Flags to indicate which system-wide sleep state the host must be
|
|
|
|
* transitioned to.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2011-11-29 07:58:32 -06:00
|
|
|
VIR_NODE_SUSPEND_TARGET_MEM = 0,
|
|
|
|
VIR_NODE_SUSPEND_TARGET_DISK = 1,
|
|
|
|
VIR_NODE_SUSPEND_TARGET_HYBRID = 2,
|
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_NODE_SUSPEND_TARGET_LAST /* This constant is subject to change */
|
2012-01-20 12:43:28 -06:00
|
|
|
#endif
|
2011-11-29 00:37:06 -06:00
|
|
|
} virNodeSuspendTarget;
|
2009-07-10 06:18:12 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virStream:
|
|
|
|
*
|
|
|
|
* a virStream is a private structure representing a data stream.
|
|
|
|
*/
|
|
|
|
typedef struct _virStream virStream;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStreamPtr:
|
|
|
|
*
|
|
|
|
* a virStreamPtr is pointer to a virStream private structure, this is the
|
|
|
|
* type used to reference a data stream in the API.
|
|
|
|
*/
|
|
|
|
typedef virStream *virStreamPtr;
|
|
|
|
|
2009-03-03 03:09:00 -06:00
|
|
|
/**
|
|
|
|
* VIR_SECURITY_LABEL_BUFLEN:
|
|
|
|
*
|
|
|
|
* Macro providing the maximum length of the virSecurityLabel label string.
|
|
|
|
* Note that this value is based on that used by Labeled NFS.
|
|
|
|
*/
|
|
|
|
#define VIR_SECURITY_LABEL_BUFLEN (4096 + 1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virSecurityLabel:
|
|
|
|
*
|
|
|
|
* a virSecurityLabel is a structure filled by virDomainGetSecurityLabel(),
|
|
|
|
* providing the security label and associated attributes for the specified
|
|
|
|
* domain.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct _virSecurityLabel {
|
|
|
|
char label[VIR_SECURITY_LABEL_BUFLEN]; /* security label string */
|
|
|
|
int enforcing; /* 1 if security policy is being enforced for domain */
|
|
|
|
} virSecurityLabel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virSecurityLabelPtr:
|
|
|
|
*
|
|
|
|
* a virSecurityLabelPtr is a pointer to a virSecurityLabel.
|
|
|
|
*/
|
|
|
|
typedef virSecurityLabel *virSecurityLabelPtr;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_SECURITY_MODEL_BUFLEN:
|
|
|
|
*
|
|
|
|
* Macro providing the maximum length of the virSecurityModel model string.
|
|
|
|
*/
|
|
|
|
#define VIR_SECURITY_MODEL_BUFLEN (256 + 1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_SECURITY_DOI_BUFLEN:
|
|
|
|
*
|
|
|
|
* Macro providing the maximum length of the virSecurityModel doi string.
|
|
|
|
*/
|
|
|
|
#define VIR_SECURITY_DOI_BUFLEN (256 + 1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virSecurityModel:
|
|
|
|
*
|
|
|
|
* a virSecurityModel is a structure filled by virNodeGetSecurityModel(),
|
|
|
|
* providing the per-hypervisor security model and DOI attributes for the
|
|
|
|
* specified domain.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct _virSecurityModel {
|
|
|
|
char model[VIR_SECURITY_MODEL_BUFLEN]; /* security model string */
|
|
|
|
char doi[VIR_SECURITY_DOI_BUFLEN]; /* domain of interpetation */
|
|
|
|
} virSecurityModel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virSecurityModelPtr:
|
|
|
|
*
|
|
|
|
* a virSecurityModelPtr is a pointer to a virSecurityModel.
|
|
|
|
*/
|
|
|
|
typedef virSecurityModel *virSecurityModelPtr;
|
|
|
|
|
2012-10-23 12:47:46 -05:00
|
|
|
/* Common data types shared among interfaces with name/type/value lists. */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virTypedParameterType:
|
|
|
|
*
|
|
|
|
* Express the type of a virTypedParameter
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_TYPED_PARAM_INT = 1, /* integer case */
|
|
|
|
VIR_TYPED_PARAM_UINT = 2, /* unsigned integer case */
|
|
|
|
VIR_TYPED_PARAM_LLONG = 3, /* long long case */
|
|
|
|
VIR_TYPED_PARAM_ULLONG = 4, /* unsigned long long case */
|
|
|
|
VIR_TYPED_PARAM_DOUBLE = 5, /* double case */
|
|
|
|
VIR_TYPED_PARAM_BOOLEAN = 6, /* boolean(character) case */
|
|
|
|
VIR_TYPED_PARAM_STRING = 7, /* string case */
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_TYPED_PARAM_LAST
|
|
|
|
#endif
|
|
|
|
} virTypedParameterType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virTypedParameterFlags:
|
|
|
|
*
|
|
|
|
* Flags related to libvirt APIs that use virTypedParameter.
|
|
|
|
*
|
|
|
|
* These enums should not conflict with those of virDomainModificationImpact.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
/* 1 << 0 is reserved for virDomainModificationImpact */
|
|
|
|
/* 1 << 1 is reserved for virDomainModificationImpact */
|
|
|
|
|
|
|
|
/* Older servers lacked the ability to handle string typed
|
|
|
|
* parameters. Attempts to set a string parameter with an older
|
|
|
|
* server will fail at the client, but attempts to retrieve
|
|
|
|
* parameters must not return strings from a new server to an
|
|
|
|
* older client, so this flag exists to identify newer clients to
|
|
|
|
* newer servers. This flag is automatically set when needed, so
|
|
|
|
* the user does not have to worry about it; however, manually
|
|
|
|
* setting the flag can be used to reject servers that cannot
|
|
|
|
* return typed strings, even if no strings would be returned.
|
|
|
|
*/
|
|
|
|
VIR_TYPED_PARAM_STRING_OKAY = 1 << 2,
|
|
|
|
|
|
|
|
} virTypedParameterFlags;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_TYPED_PARAM_FIELD_LENGTH:
|
|
|
|
*
|
|
|
|
* Macro providing the field length of virTypedParameter name
|
|
|
|
*/
|
|
|
|
#define VIR_TYPED_PARAM_FIELD_LENGTH 80
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virTypedParameter:
|
|
|
|
*
|
|
|
|
* A named parameter, including a type and value.
|
|
|
|
*
|
|
|
|
* The types virSchedParameter, virBlkioParameter, and
|
|
|
|
* virMemoryParameter are aliases of this type, for use when
|
|
|
|
* targetting libvirt earlier than 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef struct _virTypedParameter virTypedParameter;
|
|
|
|
|
|
|
|
struct _virTypedParameter {
|
|
|
|
char field[VIR_TYPED_PARAM_FIELD_LENGTH]; /* parameter name */
|
|
|
|
int type; /* parameter type, virTypedParameterType */
|
|
|
|
union {
|
|
|
|
int i; /* type is INT */
|
|
|
|
unsigned int ui; /* type is UINT */
|
|
|
|
long long int l; /* type is LLONG */
|
|
|
|
unsigned long long int ul; /* type is ULLONG */
|
|
|
|
double d; /* type is DOUBLE */
|
|
|
|
char b; /* type is BOOLEAN */
|
|
|
|
char *s; /* type is STRING, may not be NULL */
|
|
|
|
} value; /* parameter value */
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virTypedParameterPtr:
|
|
|
|
*
|
|
|
|
* a pointer to a virTypedParameter structure.
|
|
|
|
*/
|
|
|
|
typedef virTypedParameter *virTypedParameterPtr;
|
|
|
|
|
|
|
|
|
2013-01-15 07:51:45 -06:00
|
|
|
virTypedParameterPtr
|
|
|
|
virTypedParamsGet (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name);
|
|
|
|
int
|
|
|
|
virTypedParamsGetInt (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
int *value);
|
|
|
|
int
|
|
|
|
virTypedParamsGetUInt (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
unsigned int *value);
|
|
|
|
int
|
|
|
|
virTypedParamsGetLLong (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
long long *value);
|
|
|
|
int
|
|
|
|
virTypedParamsGetULLong (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
unsigned long long *value);
|
|
|
|
int
|
|
|
|
virTypedParamsGetDouble (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
double *value);
|
|
|
|
int
|
|
|
|
virTypedParamsGetBoolean(virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
int *value);
|
|
|
|
int
|
|
|
|
virTypedParamsGetString (virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
const char *name,
|
|
|
|
const char **value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddInt (virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
int value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddUInt (virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
unsigned int value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddLLong (virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
long long value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddULLong (virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
unsigned long long value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddDouble (virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
double value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddBoolean(virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
int value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddString (virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
const char *value);
|
|
|
|
int
|
|
|
|
virTypedParamsAddFromString(virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
int *maxparams,
|
|
|
|
const char *name,
|
|
|
|
int type,
|
|
|
|
const char *value);
|
|
|
|
void
|
2013-01-15 17:42:35 -06:00
|
|
|
virTypedParamsClear (virTypedParameterPtr params,
|
|
|
|
int nparams);
|
|
|
|
void
|
2013-01-15 07:51:45 -06:00
|
|
|
virTypedParamsFree (virTypedParameterPtr params,
|
|
|
|
int nparams);
|
|
|
|
|
2012-10-23 12:47:46 -05:00
|
|
|
/* data types related to virNodePtr */
|
|
|
|
|
2006-03-29 06:46:03 -06:00
|
|
|
/**
|
|
|
|
* virNodeInfoPtr:
|
|
|
|
*
|
|
|
|
* a virNodeInfo is a structure filled by virNodeGetInfo() and providing
|
2008-03-14 06:08:03 -05:00
|
|
|
* the information for the Node.
|
2006-03-29 06:46:03 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _virNodeInfo virNodeInfo;
|
|
|
|
|
|
|
|
struct _virNodeInfo {
|
2012-11-07 07:53:36 -06:00
|
|
|
char model[32]; /* string indicating the CPU model */
|
|
|
|
unsigned long memory; /* memory size in kilobytes */
|
|
|
|
unsigned int cpus; /* the number of active CPUs */
|
|
|
|
unsigned int mhz; /* expected CPU frequency */
|
|
|
|
unsigned int nodes; /* the number of NUMA cell, 1 for unusual NUMA
|
|
|
|
topologies or uniform memory access; check
|
|
|
|
capabilities XML for the actual NUMA topology */
|
|
|
|
unsigned int sockets; /* number of CPU sockets per node if nodes > 1,
|
|
|
|
1 in case of unusual NUMA topology */
|
|
|
|
unsigned int cores; /* number of cores per socket, total number of
|
|
|
|
processors in case of unusual NUMA topology*/
|
|
|
|
unsigned int threads; /* number of threads per core, 1 in case of
|
|
|
|
unusual numa topology */
|
2006-03-29 06:46:03 -06:00
|
|
|
};
|
|
|
|
|
2011-06-06 19:58:47 -05:00
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_FIELD_LENGTH:
|
2011-06-06 19:58:47 -05:00
|
|
|
*
|
|
|
|
* Macro providing the field length of virNodeCPUStats
|
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_CPU_STATS_FIELD_LENGTH 80
|
2011-06-06 19:58:47 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_ALL_CPUS:
|
2011-06-06 19:58:47 -05:00
|
|
|
*
|
2011-11-28 11:19:27 -06:00
|
|
|
* Value for specifying request for the total CPU time/utilization
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-11-28 11:19:27 -06:00
|
|
|
typedef enum {
|
|
|
|
VIR_NODE_CPU_STATS_ALL_CPUS = -1,
|
|
|
|
} virNodeGetCPUStatsAllCPUs;
|
2011-06-06 19:58:47 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_KERNEL:
|
2011-06-06 19:58:47 -05:00
|
|
|
*
|
2011-06-15 05:32:19 -05:00
|
|
|
* Macro for the cumulative CPU time which was spent by the kernel,
|
|
|
|
* since the node booting up (in nanoseconds).
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_CPU_STATS_KERNEL "kernel"
|
2011-06-06 19:58:47 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_USER:
|
2011-06-15 05:32:19 -05:00
|
|
|
*
|
|
|
|
* The cumulative CPU time which was spent by user processes,
|
|
|
|
* since the node booting up (in nanoseconds).
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_CPU_STATS_USER "user"
|
2011-06-06 19:58:47 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_IDLE:
|
2011-06-15 05:32:19 -05:00
|
|
|
*
|
2011-06-06 19:58:47 -05:00
|
|
|
* The cumulative idle CPU time,
|
2011-06-15 05:32:19 -05:00
|
|
|
* since the node booting up (in nanoseconds).
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_CPU_STATS_IDLE "idle"
|
2011-06-06 19:58:47 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_IOWAIT:
|
2011-06-15 05:32:19 -05:00
|
|
|
*
|
2011-06-06 19:58:47 -05:00
|
|
|
* The cumulative I/O wait CPU time,
|
2011-06-15 05:32:19 -05:00
|
|
|
* since the node booting up (in nanoseconds).
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_CPU_STATS_IOWAIT "iowait"
|
2011-06-06 19:58:47 -05:00
|
|
|
|
2014-01-28 11:49:24 -06:00
|
|
|
/**
|
|
|
|
* VIR_NODE_CPU_STATS_INTR:
|
|
|
|
*
|
|
|
|
* The cumulative interrupt CPU time,
|
|
|
|
* since the node booting up (in nanoseconds).
|
|
|
|
*/
|
|
|
|
#define VIR_NODE_CPU_STATS_INTR "intr"
|
|
|
|
|
2011-06-06 19:58:47 -05:00
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_CPU_STATS_UTILIZATION:
|
2011-06-15 05:32:19 -05:00
|
|
|
*
|
|
|
|
* The CPU utilization of a node.
|
|
|
|
* The usage value is in percent and 100% represents all CPUs of
|
|
|
|
* the node.
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_CPU_STATS_UTILIZATION "utilization"
|
2011-06-06 19:58:47 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* virNodeCPUStats:
|
2011-06-06 19:58:47 -05:00
|
|
|
*
|
|
|
|
* a virNodeCPUStats is a structure filled by virNodeGetCPUStats()
|
2011-06-15 05:32:19 -05:00
|
|
|
* providing information about the CPU stats of the node.
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
typedef struct _virNodeCPUStats virNodeCPUStats;
|
2011-06-06 19:58:47 -05:00
|
|
|
|
2011-06-15 05:39:57 -05:00
|
|
|
struct _virNodeCPUStats {
|
|
|
|
char field[VIR_NODE_CPU_STATS_FIELD_LENGTH];
|
2011-06-06 19:58:47 -05:00
|
|
|
unsigned long long value;
|
|
|
|
};
|
|
|
|
|
2011-06-06 20:03:36 -05:00
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_FIELD_LENGTH:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
2011-06-15 05:39:57 -05:00
|
|
|
* Macro providing the field length of virNodeMemoryStats
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_MEMORY_STATS_FIELD_LENGTH 80
|
2011-06-06 20:03:36 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_ALL_CELLS:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
2011-11-28 11:19:28 -06:00
|
|
|
* Value for specifying request for the total memory of all cells.
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
2011-11-28 11:19:28 -06:00
|
|
|
typedef enum {
|
|
|
|
VIR_NODE_MEMORY_STATS_ALL_CELLS = -1,
|
|
|
|
} virNodeGetMemoryStatsAllCells;
|
2011-06-06 20:03:36 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_TOTAL:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
|
|
|
* Macro for the total memory of specified cell:
|
|
|
|
* it represents the maximum memory.
|
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_MEMORY_STATS_TOTAL "total"
|
2011-06-06 20:03:36 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_FREE:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
|
|
|
* Macro for the free memory of specified cell:
|
2011-06-15 05:32:19 -05:00
|
|
|
* On Linux, it includes buffer and cached memory, in case of
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_ALL_CELLS.
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_MEMORY_STATS_FREE "free"
|
2011-06-06 20:03:36 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_BUFFERS:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
2011-06-15 05:32:19 -05:00
|
|
|
* Macro for the buffer memory: On Linux, it is only returned in case of
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_ALL_CELLS.
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_MEMORY_STATS_BUFFERS "buffers"
|
2011-06-06 20:03:36 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_CACHED:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
2011-06-15 05:32:19 -05:00
|
|
|
* Macro for the cached memory: On Linux, it is only returned in case of
|
2011-06-15 05:39:57 -05:00
|
|
|
* VIR_NODE_MEMORY_STATS_ALL_CELLS.
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
#define VIR_NODE_MEMORY_STATS_CACHED "cached"
|
2011-06-06 20:03:36 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* virNodeMemoryStats:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
2011-06-15 05:39:57 -05:00
|
|
|
* a virNodeMemoryStats is a structure filled by virNodeGetMemoryStats()
|
2011-06-15 05:32:19 -05:00
|
|
|
* providing information about the memory of the node.
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
2011-06-15 05:39:57 -05:00
|
|
|
typedef struct _virNodeMemoryStats virNodeMemoryStats;
|
2011-06-06 20:03:36 -05:00
|
|
|
|
2011-06-15 05:39:57 -05:00
|
|
|
struct _virNodeMemoryStats {
|
|
|
|
char field[VIR_NODE_MEMORY_STATS_FIELD_LENGTH];
|
2011-06-06 20:03:36 -05:00
|
|
|
unsigned long long value;
|
|
|
|
};
|
2006-08-07 12:37:42 -05:00
|
|
|
|
2012-10-23 12:47:46 -05:00
|
|
|
/*
|
|
|
|
* VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many present pages
|
|
|
|
* to scan before the shared memory service goes to sleep.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN "shm_pages_to_scan"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many milliseconds
|
|
|
|
* the shared memory service should sleep before next scan.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS "shm_sleep_millisecs"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VIR_NODE_MEMORY_SHARED_PAGES_SHARED:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many the shared
|
|
|
|
* memory pages are being used.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_PAGES_SHARED "shm_pages_shared"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VIR_NODE_MEMORY_SHARED_PAGES_SHARING:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many sites are
|
|
|
|
* sharing the pages i.e. how much saved.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_PAGES_SHARING "shm_pages_sharing"
|
|
|
|
|
|
|
|
/* VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many pages unique
|
|
|
|
* but repeatedly checked for merging.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED "shm_pages_unshared"
|
|
|
|
|
|
|
|
/* VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many pages changing
|
|
|
|
* too fast to be placed in a tree.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE "shm_pages_volatile"
|
|
|
|
|
|
|
|
/* VIR_NODE_MEMORY_SHARED_FULL_SCAN:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents how many times all
|
|
|
|
* mergeable areas have been scanned.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_FULL_SCANS "shm_full_scans"
|
|
|
|
|
|
|
|
/* VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter that represents whether pages from
|
|
|
|
* different NUMA nodes can be merged. The parameter has type int,
|
|
|
|
* when its value is 0, only pages which physically reside in the
|
|
|
|
* memory area of same NUMA node are merged; When its value is 1,
|
|
|
|
* pages from all nodes can be merged. Other values are reserved
|
|
|
|
* for future use.
|
|
|
|
*/
|
|
|
|
# define VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES "shm_merge_across_nodes"
|
|
|
|
|
|
|
|
|
|
|
|
int virNodeGetMemoryParameters(virConnectPtr conn,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virNodeSetMemoryParameters(virConnectPtr conn,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2012-10-23 15:34:53 -05:00
|
|
|
/*
|
|
|
|
* node CPU map
|
|
|
|
*/
|
|
|
|
int virNodeGetCPUMap(virConnectPtr conn,
|
|
|
|
unsigned char **cpumap,
|
|
|
|
unsigned int *online,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-05-17 12:44:53 -05:00
|
|
|
|
2011-05-29 05:24:20 -05:00
|
|
|
/* Management of scheduler parameters */
|
2007-06-05 07:06:08 -05:00
|
|
|
|
2011-11-01 15:38:42 -05:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_CPU_SHARES:
|
|
|
|
*
|
|
|
|
* Macro represents proportional weight of the scheduler used on the
|
|
|
|
* host cpu, when using the posix scheduler, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_CPU_SHARES "cpu_shares"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_VCPU_PERIOD:
|
|
|
|
*
|
|
|
|
* Macro represents the enforcement period for a quota, in microseconds,
|
2012-08-21 04:18:43 -05:00
|
|
|
* for vcpus only, when using the posix scheduler, as a ullong.
|
2011-11-01 15:38:42 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD "vcpu_period"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_VCPU_QUOTA:
|
|
|
|
*
|
2012-08-21 04:18:43 -05:00
|
|
|
* Macro represents the maximum bandwidth to be used within a period for
|
|
|
|
* vcpus only, when using the posix scheduler, as an llong.
|
2011-11-01 15:38:42 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA "vcpu_quota"
|
|
|
|
|
2012-08-21 04:18:43 -05:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD:
|
|
|
|
*
|
|
|
|
* Macro represents the enforcement period for a quota in microseconds,
|
|
|
|
* when using the posix scheduler, for all emulator activity not tied to
|
|
|
|
* vcpus, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD "emulator_period"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA:
|
|
|
|
*
|
|
|
|
* Macro represents the maximum bandwidth to be used within a period for
|
|
|
|
* all emulator activity not tied to vcpus, when using the posix scheduler,
|
|
|
|
* as an llong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA "emulator_quota"
|
|
|
|
|
2011-11-01 15:38:42 -05:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_WEIGHT:
|
|
|
|
*
|
|
|
|
* Macro represents the relative weight, when using the credit
|
|
|
|
* scheduler, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_WEIGHT "weight"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_CAP:
|
|
|
|
*
|
|
|
|
* Macro represents the maximum scheduler cap, when using the credit
|
|
|
|
* scheduler, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_CAP "cap"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_RESERVATION:
|
|
|
|
*
|
|
|
|
* Macro represents the scheduler reservation value, when using the
|
|
|
|
* allocation scheduler, as an llong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_RESERVATION "reservation"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_LIMIT:
|
|
|
|
*
|
|
|
|
* Macro represents the scheduler limit value, when using the
|
|
|
|
* allocation scheduler, as an llong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_LIMIT "limit"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHEDULER_SHARES:
|
|
|
|
*
|
|
|
|
* Macro represents the scheduler shares value, when using the
|
|
|
|
* allocation scheduler, as an int.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHEDULER_SHARES "shares"
|
|
|
|
|
2007-06-05 07:06:08 -05:00
|
|
|
/*
|
|
|
|
* Fetch scheduler parameters, caller allocates 'params' field of size 'nparams'
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainGetSchedulerParameters (virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
2008-04-10 11:54:54 -05:00
|
|
|
int *nparams);
|
2011-05-17 16:17:14 -05:00
|
|
|
int virDomainGetSchedulerParametersFlags (virDomainPtr domain,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
2007-06-05 07:06:08 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Change scheduler parameters
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainSetSchedulerParameters (virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
2008-04-10 11:54:54 -05:00
|
|
|
int nparams);
|
2011-05-17 01:20:00 -05:00
|
|
|
int virDomainSetSchedulerParametersFlags (virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
2011-05-17 01:20:00 -05:00
|
|
|
int nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2007-09-10 04:37:10 -05:00
|
|
|
/**
|
|
|
|
* virDomainBlockStats:
|
|
|
|
*
|
|
|
|
* Block device stats for virDomainBlockStats.
|
2007-08-21 05:08:12 -05:00
|
|
|
*
|
|
|
|
* Hypervisors may return a field set to ((long long)-1) which indicates
|
|
|
|
* that the hypervisor does not support that statistic.
|
|
|
|
*
|
|
|
|
* NB. Here 'long long' means 64 bit integer.
|
|
|
|
*/
|
2007-09-10 04:37:10 -05:00
|
|
|
typedef struct _virDomainBlockStats virDomainBlockStatsStruct;
|
|
|
|
|
2007-08-21 05:08:12 -05:00
|
|
|
struct _virDomainBlockStats {
|
2012-07-11 09:27:38 -05:00
|
|
|
long long rd_req; /* number of read requests */
|
|
|
|
long long rd_bytes; /* number of read bytes */
|
|
|
|
long long wr_req; /* number of write requests */
|
|
|
|
long long wr_bytes; /* number of written bytes */
|
|
|
|
long long errs; /* In Xen this returns the mysterious 'oo_req'. */
|
2007-08-21 05:08:12 -05:00
|
|
|
};
|
|
|
|
|
2007-09-10 04:37:10 -05:00
|
|
|
/**
|
|
|
|
* virDomainBlockStatsPtr:
|
|
|
|
*
|
|
|
|
* A pointer to a virDomainBlockStats structure
|
|
|
|
*/
|
|
|
|
typedef virDomainBlockStatsStruct *virDomainBlockStatsPtr;
|
|
|
|
|
2011-09-05 03:14:29 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH:
|
|
|
|
*
|
2011-11-01 15:38:42 -05:00
|
|
|
* Macro providing the field length of parameter names when using
|
|
|
|
* virDomainBlockStatsFlags().
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
2011-11-01 15:38:42 -05:00
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH
|
2011-09-05 03:14:29 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_READ_BYTES:
|
|
|
|
*
|
|
|
|
* Macro represents the total number of read bytes of the
|
2011-11-01 15:38:42 -05:00
|
|
|
* block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_READ_BYTES "rd_bytes"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_READ_REQ:
|
|
|
|
*
|
|
|
|
* Macro represents the total read requests of the
|
2011-11-01 15:38:42 -05:00
|
|
|
* block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_READ_REQ "rd_operations"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES:
|
|
|
|
*
|
|
|
|
* Macro represents the total time spend on cache reads in
|
2011-11-01 15:38:42 -05:00
|
|
|
* nano-seconds of the block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES "rd_total_times"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES:
|
|
|
|
*
|
|
|
|
* Macro represents the total number of write bytes of the
|
2011-11-01 15:38:42 -05:00
|
|
|
* block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES "wr_bytes"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_WRITE_REQ:
|
|
|
|
*
|
|
|
|
* Macro represents the total write requests of the
|
2011-11-01 15:38:42 -05:00
|
|
|
* block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_WRITE_REQ "wr_operations"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES:
|
|
|
|
*
|
|
|
|
* Macro represents the total time spend on cache writes in
|
2011-11-01 15:38:42 -05:00
|
|
|
* nano-seconds of the block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES "wr_total_times"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ:
|
|
|
|
*
|
|
|
|
* Macro represents the total flush requests of the
|
2011-11-01 15:38:42 -05:00
|
|
|
* block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ "flush_operations"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES:
|
|
|
|
*
|
|
|
|
* Macro represents the total time spend on cache flushing in
|
2011-11-01 15:38:42 -05:00
|
|
|
* nano-seconds of the block device, as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES "flush_total_times"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_STATS_ERRS:
|
|
|
|
*
|
2011-11-01 15:38:42 -05:00
|
|
|
* In Xen this returns the mysterious 'oo_req', as an llong.
|
2011-09-05 03:14:29 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_STATS_ERRS "errs"
|
|
|
|
|
2007-09-10 04:37:10 -05:00
|
|
|
/**
|
|
|
|
* virDomainInterfaceStats:
|
|
|
|
*
|
|
|
|
* Network interface stats for virDomainInterfaceStats.
|
2007-08-21 05:08:12 -05:00
|
|
|
*
|
|
|
|
* Hypervisors may return a field set to ((long long)-1) which indicates
|
|
|
|
* that the hypervisor does not support that statistic.
|
|
|
|
*
|
|
|
|
* NB. Here 'long long' means 64 bit integer.
|
|
|
|
*/
|
2007-09-10 04:37:10 -05:00
|
|
|
typedef struct _virDomainInterfaceStats virDomainInterfaceStatsStruct;
|
|
|
|
|
2007-08-21 05:08:12 -05:00
|
|
|
struct _virDomainInterfaceStats {
|
2012-07-11 09:27:38 -05:00
|
|
|
long long rx_bytes;
|
|
|
|
long long rx_packets;
|
|
|
|
long long rx_errs;
|
|
|
|
long long rx_drop;
|
|
|
|
long long tx_bytes;
|
|
|
|
long long tx_packets;
|
|
|
|
long long tx_errs;
|
|
|
|
long long tx_drop;
|
2007-08-21 05:08:12 -05:00
|
|
|
};
|
2007-09-10 04:37:10 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainInterfaceStatsPtr:
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* A pointer to a virDomainInterfaceStats structure
|
2007-09-10 04:37:10 -05:00
|
|
|
*/
|
|
|
|
typedef virDomainInterfaceStatsStruct *virDomainInterfaceStatsPtr;
|
|
|
|
|
2009-12-20 06:28:42 -06:00
|
|
|
/**
|
|
|
|
* Memory Statistics Tags:
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
/* The total amount of data read from swap space (in kB). */
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_SWAP_IN = 0,
|
|
|
|
/* The total amount of memory written out to swap space (in kB). */
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_SWAP_OUT = 1,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Page faults occur when a process makes a valid access to virtual memory
|
|
|
|
* that is not available. When servicing the page fault, if disk IO is
|
|
|
|
* required, it is considered a major fault. If not, it is a minor fault.
|
|
|
|
* These are expressed as the number of faults that have occurred.
|
|
|
|
*/
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT = 2,
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT = 3,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The amount of memory left completely unused by the system. Memory that
|
|
|
|
* is available but used for reclaimable caches should NOT be reported as
|
|
|
|
* free. This value is expressed in kB.
|
|
|
|
*/
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_UNUSED = 4,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The total amount of usable memory as seen by the domain. This value
|
|
|
|
* may be less than the amount of memory assigned to the domain if a
|
|
|
|
* balloon driver is in use or if the guest OS does not initialize all
|
|
|
|
* assigned pages. This value is expressed in kB.
|
|
|
|
*/
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_AVAILABLE = 5,
|
|
|
|
|
qemu: Parse current balloon value returned by query_balloon
Qemu once supported following memory stats which will returned by
"query_balloon":
stat_put(dict, "actual", actual);
stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]);
stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]);
stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]);
stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]);
stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]);
stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]);
But it later disabled all the stats except "actual" by commit
07b0403dfc2b2ac179ae5b48105096cc2d03375a.
libvirt doesn't parse "actual", so user will always see a empty result
with "virsh dommemstat $domain". Even qemu haven't disabled the stats,
we should support parsing "actual".
2011-06-13 22:21:35 -05:00
|
|
|
/* Current balloon value (in KB). */
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON = 6,
|
2012-01-24 07:25:05 -06:00
|
|
|
|
|
|
|
/* Resident Set Size of the process running the domain. This value
|
|
|
|
* is in kB */
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_RSS = 7,
|
|
|
|
|
2009-12-20 06:28:42 -06:00
|
|
|
/*
|
|
|
|
* The number of statistics supported by this version of the interface.
|
|
|
|
* To add new statistics, add them to the enum and increase this value.
|
|
|
|
*/
|
2012-01-24 07:25:05 -06:00
|
|
|
VIR_DOMAIN_MEMORY_STAT_NR = 8,
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR
|
|
|
|
#endif
|
2009-12-20 06:28:42 -06:00
|
|
|
} virDomainMemoryStatTags;
|
|
|
|
|
|
|
|
typedef struct _virDomainMemoryStat virDomainMemoryStatStruct;
|
|
|
|
|
|
|
|
struct _virDomainMemoryStat {
|
|
|
|
int tag;
|
|
|
|
unsigned long long val;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef virDomainMemoryStatStruct *virDomainMemoryStatPtr;
|
|
|
|
|
2007-08-21 05:08:12 -05:00
|
|
|
|
2009-12-14 04:59:27 -06:00
|
|
|
/* Domain core dump flags. */
|
|
|
|
typedef enum {
|
2011-07-06 13:10:11 -05:00
|
|
|
VIR_DUMP_CRASH = (1 << 0), /* crash after dump */
|
|
|
|
VIR_DUMP_LIVE = (1 << 1), /* live dump */
|
|
|
|
VIR_DUMP_BYPASS_CACHE = (1 << 2), /* avoid file system cache pollution */
|
2011-09-26 07:39:16 -05:00
|
|
|
VIR_DUMP_RESET = (1 << 3), /* reset domain after dump finishes */
|
2012-06-11 22:06:33 -05:00
|
|
|
VIR_DUMP_MEMORY_ONLY = (1 << 4), /* use dump-guest-memory */
|
2009-12-14 04:59:27 -06:00
|
|
|
} virDomainCoreDumpFlags;
|
|
|
|
|
2014-03-22 22:51:12 -05:00
|
|
|
/**
|
|
|
|
* virDomainCoreDumpFormat:
|
|
|
|
*
|
|
|
|
* Values for specifying different formats of domain core dumps.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CORE_DUMP_FORMAT_RAW, /* dump guest memory in raw format */
|
|
|
|
VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB, /* kdump-compressed format, with
|
|
|
|
* zlib compression */
|
|
|
|
VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO, /* kdump-compressed format, with
|
|
|
|
* lzo compression */
|
|
|
|
VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY, /* kdump-compressed format, with
|
|
|
|
* snappy compression */
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_CORE_DUMP_FORMAT_LAST
|
|
|
|
/*
|
|
|
|
* NB: this enum value will increase over time as new events are
|
|
|
|
* added to the libvirt API. It reflects the last state supported
|
|
|
|
* by this version of the libvirt API.
|
|
|
|
*/
|
|
|
|
#endif
|
|
|
|
} virDomainCoreDumpFormat;
|
|
|
|
|
2007-08-21 04:31:12 -05:00
|
|
|
/* Domain migration flags. */
|
|
|
|
typedef enum {
|
2009-09-17 12:10:04 -05:00
|
|
|
VIR_MIGRATE_LIVE = (1 << 0), /* live migration */
|
|
|
|
VIR_MIGRATE_PEER2PEER = (1 << 1), /* direct source -> dest host control channel */
|
2010-05-18 12:13:20 -05:00
|
|
|
/* Note the less-common spelling that we're stuck with:
|
|
|
|
VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED */
|
2009-09-17 12:10:04 -05:00
|
|
|
VIR_MIGRATE_TUNNELLED = (1 << 2), /* tunnel migration data over libvirtd connection */
|
2009-07-31 05:10:22 -05:00
|
|
|
VIR_MIGRATE_PERSIST_DEST = (1 << 3), /* persist the VM on the destination */
|
|
|
|
VIR_MIGRATE_UNDEFINE_SOURCE = (1 << 4), /* undefine the VM on the source */
|
2009-12-11 03:00:44 -06:00
|
|
|
VIR_MIGRATE_PAUSED = (1 << 5), /* pause on remote side */
|
2010-05-04 16:36:42 -05:00
|
|
|
VIR_MIGRATE_NON_SHARED_DISK = (1 << 6), /* migration with non-shared storage with full disk copy */
|
|
|
|
VIR_MIGRATE_NON_SHARED_INC = (1 << 7), /* migration with non-shared storage with incremental copy */
|
|
|
|
/* (same base image shared between source and destination) */
|
2011-07-18 19:27:32 -05:00
|
|
|
VIR_MIGRATE_CHANGE_PROTECTION = (1 << 8), /* protect for changing domain configuration through the
|
|
|
|
* whole migration process; this will be used automatically
|
|
|
|
* when supported */
|
2012-02-20 02:16:23 -06:00
|
|
|
VIR_MIGRATE_UNSAFE = (1 << 9), /* force migration even if it is considered unsafe */
|
2012-11-21 02:28:49 -06:00
|
|
|
VIR_MIGRATE_OFFLINE = (1 << 10), /* offline migrate */
|
2013-01-10 06:39:34 -06:00
|
|
|
VIR_MIGRATE_COMPRESSED = (1 << 11), /* compress data during migration */
|
2013-06-12 09:11:21 -05:00
|
|
|
VIR_MIGRATE_ABORT_ON_ERROR = (1 << 12), /* abort migration on I/O errors happened during migration */
|
2014-02-06 17:44:36 -06:00
|
|
|
VIR_MIGRATE_AUTO_CONVERGE = (1 << 13), /* force convergence */
|
2014-01-13 00:28:12 -06:00
|
|
|
VIR_MIGRATE_RDMA_PIN_ALL = (1 << 14), /* RDMA memory pinning */
|
2007-08-21 04:31:12 -05:00
|
|
|
} virDomainMigrateFlags;
|
|
|
|
|
2013-05-07 07:28:45 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_MIGRATE_PARAM_URI:
|
|
|
|
*
|
|
|
|
* virDomainMigrate* params field: URI to use for initiating domain migration
|
|
|
|
* as VIR_TYPED_PARAM_STRING. It takes a hypervisor specific format. The
|
|
|
|
* uri_transports element of the hypervisor capabilities XML includes details
|
|
|
|
* of the supported URI schemes. When omitted libvirt will auto-generate
|
|
|
|
* suitable default URI. It is typically only necessary to specify this URI if
|
|
|
|
* the destination host has multiple interfaces and a specific interface is
|
|
|
|
* required to transmit migration data.
|
|
|
|
*
|
|
|
|
* This filed may not be used when VIR_MIGRATE_TUNNELLED flag is set.
|
|
|
|
*/
|
|
|
|
#define VIR_MIGRATE_PARAM_URI "migrate_uri"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_MIGRATE_PARAM_DEST_NAME:
|
|
|
|
*
|
|
|
|
* virDomainMigrate* params field: the name to be used for the domain on the
|
|
|
|
* destination host as VIR_TYPED_PARAM_STRING. Omitting this parameter keeps
|
|
|
|
* the domain name the same. This field is only allowed to be used with
|
|
|
|
* hypervisors that support domain renaming during migration.
|
|
|
|
*/
|
|
|
|
#define VIR_MIGRATE_PARAM_DEST_NAME "destination_name"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_MIGRATE_PARAM_DEST_XML:
|
|
|
|
*
|
|
|
|
* virDomainMigrate* params field: the new configuration to be used for the
|
|
|
|
* domain on the destination host as VIR_TYPED_PARAM_STRING. The configuration
|
|
|
|
* must include an identical set of virtual devices, to ensure a stable guest
|
|
|
|
* ABI across migration. Only parameters related to host side configuration
|
|
|
|
* can be changed in the XML. Hypervisors which support this field will forbid
|
|
|
|
* migration if the provided XML would cause a change in the guest ABI. This
|
|
|
|
* field cannot be used to rename the domain during migration (use
|
|
|
|
* VIR_MIGRATE_PARAM_DEST_NAME field for that purpose). Domain name in the
|
|
|
|
* destination XML must match the original domain name.
|
|
|
|
*
|
|
|
|
* Omitting this parameter keeps the original domain configuration. Using this
|
|
|
|
* field with hypervisors that do not support changing domain configuration
|
|
|
|
* during migration will result in a failure.
|
|
|
|
*/
|
|
|
|
#define VIR_MIGRATE_PARAM_DEST_XML "destination_xml"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_MIGRATE_PARAM_BANDWIDTH:
|
|
|
|
*
|
|
|
|
* virDomainMigrate* params field: the maximum bandwidth (in MiB/s) that will
|
|
|
|
* be used for migration as VIR_TYPED_PARAM_ULLONG. If set to 0 or omitted,
|
|
|
|
* libvirt will choose a suitable default. Some hypervisors do not support this
|
|
|
|
* feature and will return an error if this field is used and is not 0.
|
|
|
|
*/
|
|
|
|
#define VIR_MIGRATE_PARAM_BANDWIDTH "bandwidth"
|
|
|
|
|
2013-06-18 02:46:49 -05:00
|
|
|
/**
|
|
|
|
* VIR_MIGRATE_PARAM_GRAPHICS_URI:
|
|
|
|
*
|
|
|
|
* virDomainMigrate* params field: URI to use for migrating client's connection
|
|
|
|
* to domain's graphical console as VIR_TYPED_PARAM_STRING. If specified, the
|
|
|
|
* client will be asked to automatically reconnect using these parameters
|
|
|
|
* instead of the automatically computed ones. This can be useful if, e.g., the
|
|
|
|
* client does not have a direct access to the network virtualization hosts are
|
|
|
|
* connected to and needs to connect through a proxy. The URI is formed as
|
|
|
|
* follows:
|
|
|
|
*
|
|
|
|
* protocol://hostname[:port]/[?parameters]
|
|
|
|
*
|
|
|
|
* where protocol is either "spice" or "vnc" and parameters is a list of
|
|
|
|
* protocol specific parameters separated by '&'. Currently recognized
|
|
|
|
* parameters are "tlsPort" and "tlsSubject". For example,
|
|
|
|
*
|
|
|
|
* spice://target.host.com:1234/?tlsPort=4567
|
|
|
|
*/
|
|
|
|
#define VIR_MIGRATE_PARAM_GRAPHICS_URI "graphics_uri"
|
|
|
|
|
2013-10-08 06:49:25 -05:00
|
|
|
/**
|
|
|
|
* VIR_MIGRATE_PARAM_LISTEN_ADDRESS:
|
|
|
|
*
|
|
|
|
* virDomainMigrate* params field: The listen address that hypervisor on the
|
2013-11-08 10:39:25 -06:00
|
|
|
* destination side should bind to for incoming migration. Both IPv4 and IPv6
|
2013-10-08 06:49:25 -05:00
|
|
|
* addresses are accepted as well as hostnames (the resolving is done on
|
2013-11-08 10:39:25 -06:00
|
|
|
* destination). Some hypervisors do not support this feature and will return
|
|
|
|
* an error if this field is used.
|
2013-10-08 06:49:25 -05:00
|
|
|
*/
|
|
|
|
#define VIR_MIGRATE_PARAM_LISTEN_ADDRESS "listen_address"
|
2013-05-07 07:28:45 -05:00
|
|
|
|
2007-08-21 04:31:12 -05:00
|
|
|
/* Domain migration. */
|
|
|
|
virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned long flags, const char *dname,
|
|
|
|
const char *uri, unsigned long bandwidth);
|
2011-05-18 08:45:28 -05:00
|
|
|
virDomainPtr virDomainMigrate2(virDomainPtr domain, virConnectPtr dconn,
|
|
|
|
const char *dxml,
|
|
|
|
unsigned long flags, const char *dname,
|
|
|
|
const char *uri, unsigned long bandwidth);
|
2013-05-07 07:29:19 -05:00
|
|
|
virDomainPtr virDomainMigrate3(virDomainPtr domain,
|
|
|
|
virConnectPtr dconn,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
unsigned int nparams,
|
|
|
|
unsigned int flags);
|
2007-08-21 04:31:12 -05:00
|
|
|
|
2009-09-17 12:10:04 -05:00
|
|
|
int virDomainMigrateToURI (virDomainPtr domain, const char *duri,
|
|
|
|
unsigned long flags, const char *dname,
|
|
|
|
unsigned long bandwidth);
|
|
|
|
|
2011-05-18 08:45:28 -05:00
|
|
|
int virDomainMigrateToURI2(virDomainPtr domain,
|
|
|
|
const char *dconnuri,
|
|
|
|
const char *miguri,
|
|
|
|
const char *dxml,
|
|
|
|
unsigned long flags,
|
|
|
|
const char *dname,
|
|
|
|
unsigned long bandwidth);
|
2013-05-07 07:29:19 -05:00
|
|
|
int virDomainMigrateToURI3(virDomainPtr domain,
|
|
|
|
const char *dconnuri,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
unsigned int nparams,
|
|
|
|
unsigned int flags);
|
2011-05-18 08:45:28 -05:00
|
|
|
|
2010-03-12 07:55:27 -06:00
|
|
|
int virDomainMigrateSetMaxDowntime (virDomainPtr domain,
|
|
|
|
unsigned long long downtime,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2013-02-18 10:31:08 -06:00
|
|
|
int virDomainMigrateGetCompressionCache(virDomainPtr domain,
|
|
|
|
unsigned long long *cacheSize,
|
|
|
|
unsigned int flags);
|
|
|
|
int virDomainMigrateSetCompressionCache(virDomainPtr domain,
|
|
|
|
unsigned long long cacheSize,
|
|
|
|
unsigned int flags);
|
|
|
|
|
Add public API for setting migration speed on the fly
It is possible to set a migration speed limit when starting
migration. This new API allows the speed limit to be changed
on the fly to adjust to changing conditions
* src/driver.h, src/libvirt.c, src/libvirt_public.syms,
include/libvirt/libvirt.h.in: Add virDomainMigrateSetMaxSpeed
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/vmware/vmware_driver.c, src/xen/xen_driver.c,
src/libxl/libxl_driver.c: Stub new API
2011-02-17 07:57:53 -06:00
|
|
|
int virDomainMigrateSetMaxSpeed(virDomainPtr domain,
|
|
|
|
unsigned long bandwidth,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-08-26 13:10:21 -05:00
|
|
|
int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
|
|
|
|
unsigned long *bandwidth,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2006-08-07 12:37:42 -05:00
|
|
|
/**
|
|
|
|
* VIR_NODEINFO_MAXCPUS:
|
|
|
|
* @nodeinfo: virNodeInfo instance
|
|
|
|
*
|
|
|
|
* This macro is to calculate the total number of CPUs supported
|
2008-02-29 06:53:10 -06:00
|
|
|
* but not necessary active in the host.
|
2006-08-07 12:37:42 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define VIR_NODEINFO_MAXCPUS(nodeinfo) ((nodeinfo).nodes*(nodeinfo).sockets*(nodeinfo).cores*(nodeinfo).threads)
|
|
|
|
|
2006-03-29 06:46:03 -06:00
|
|
|
/**
|
|
|
|
* virNodeInfoPtr:
|
|
|
|
*
|
|
|
|
* a virNodeInfoPtr is a pointer to a virNodeInfo structure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef virNodeInfo *virNodeInfoPtr;
|
|
|
|
|
2011-06-06 19:58:47 -05:00
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* virNodeCPUStatsPtr:
|
2011-06-06 19:58:47 -05:00
|
|
|
*
|
2011-06-15 05:39:57 -05:00
|
|
|
* a virNodeCPUStatsPtr is a pointer to a virNodeCPUStats structure.
|
2011-06-06 19:58:47 -05:00
|
|
|
*/
|
|
|
|
|
2011-06-15 05:39:57 -05:00
|
|
|
typedef virNodeCPUStats *virNodeCPUStatsPtr;
|
2011-06-06 19:58:47 -05:00
|
|
|
|
2011-06-06 20:03:36 -05:00
|
|
|
/**
|
2011-06-15 05:39:57 -05:00
|
|
|
* virNodeMemoryStatsPtr:
|
2011-06-06 20:03:36 -05:00
|
|
|
*
|
2011-06-15 05:39:57 -05:00
|
|
|
* a virNodeMemoryStatsPtr is a pointer to a virNodeMemoryStats structure.
|
2011-06-06 20:03:36 -05:00
|
|
|
*/
|
|
|
|
|
2011-06-15 05:39:57 -05:00
|
|
|
typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
|
2011-06-06 20:03:36 -05:00
|
|
|
|
2007-12-05 12:28:05 -06:00
|
|
|
/**
|
|
|
|
* virConnectFlags
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* Flags when opening a connection to a hypervisor
|
2007-12-05 12:28:05 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
2011-10-13 05:49:45 -05:00
|
|
|
VIR_CONNECT_RO = (1 << 0), /* A readonly connection */
|
|
|
|
VIR_CONNECT_NO_ALIASES = (1 << 1), /* Don't try to resolve URI aliases */
|
2007-12-05 12:28:05 -06:00
|
|
|
} virConnectFlags;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_CRED_USERNAME = 1, /* Identity to act as */
|
|
|
|
VIR_CRED_AUTHNAME = 2, /* Identify to authorize as */
|
|
|
|
VIR_CRED_LANGUAGE = 3, /* RFC 1766 languages, comma separated */
|
|
|
|
VIR_CRED_CNONCE = 4, /* client supplies a nonce */
|
|
|
|
VIR_CRED_PASSPHRASE = 5, /* Passphrase secret */
|
|
|
|
VIR_CRED_ECHOPROMPT = 6, /* Challenge response */
|
|
|
|
VIR_CRED_NOECHOPROMPT = 7, /* Challenge response */
|
|
|
|
VIR_CRED_REALM = 8, /* Authentication realm */
|
|
|
|
VIR_CRED_EXTERNAL = 9, /* Externally managed credential */
|
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_CRED_LAST /* More may be added - expect the unexpected */
|
2012-01-20 12:43:28 -06:00
|
|
|
#endif
|
2007-12-05 12:28:05 -06:00
|
|
|
} virConnectCredentialType;
|
|
|
|
|
|
|
|
struct _virConnectCredential {
|
|
|
|
int type; /* One of virConnectCredentialType constants */
|
|
|
|
const char *prompt; /* Prompt to show to user */
|
|
|
|
const char *challenge; /* Additional challenge to show */
|
|
|
|
const char *defresult; /* Optional default result */
|
|
|
|
char *result; /* Result to be filled with user response (or defresult) */
|
|
|
|
unsigned int resultlen; /* Length of the result */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virConnectCredential virConnectCredential;
|
|
|
|
typedef virConnectCredential *virConnectCredentialPtr;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2010-10-13 05:19:02 -05:00
|
|
|
* virConnectAuthCallbackPtr:
|
|
|
|
* @cred: list of virConnectCredential object to fetch from user
|
|
|
|
* @ncred: size of cred list
|
|
|
|
* @cbdata: opaque data passed to virConnectOpenAuth
|
2008-02-05 13:27:37 -06:00
|
|
|
*
|
2007-12-05 12:28:05 -06:00
|
|
|
* When authentication requires one or more interactions, this callback
|
|
|
|
* is invoked. For each interaction supplied, data must be gathered
|
|
|
|
* from the user and filled in to the 'result' and 'resultlen' fields.
|
2011-04-11 17:25:25 -05:00
|
|
|
* If an interaction cannot be filled, fill in NULL and 0.
|
2007-12-05 12:28:05 -06:00
|
|
|
*
|
2010-10-13 05:19:02 -05:00
|
|
|
* Returns 0 if all interactions were filled, or -1 upon error
|
2007-12-05 12:28:05 -06:00
|
|
|
*/
|
|
|
|
typedef int (*virConnectAuthCallbackPtr)(virConnectCredentialPtr cred,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int ncred,
|
|
|
|
void *cbdata);
|
2007-12-05 12:28:05 -06:00
|
|
|
|
|
|
|
struct _virConnectAuth {
|
|
|
|
int *credtype; /* List of supported virConnectCredentialType values */
|
|
|
|
unsigned int ncredtype;
|
|
|
|
|
|
|
|
virConnectAuthCallbackPtr cb; /* Callback used to collect credentials */
|
|
|
|
void *cbdata;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _virConnectAuth virConnectAuth;
|
|
|
|
typedef virConnectAuth *virConnectAuthPtr;
|
|
|
|
|
2010-03-16 17:54:22 -05:00
|
|
|
VIR_EXPORT_VAR virConnectAuthPtr virConnectAuthPtrDefault;
|
2007-12-05 12:55:04 -06:00
|
|
|
|
Mon Jan 23 14:36:18 IST 2007 Mark McLoughlin <markmc@redhat.com>
* include/libvirt/libvirt.h.in: add VIR_UUID_BUFLEN and
VIR_UUID_STRING_BUFLEN
* libvirt/proxy/libvirt_proxy.c, libvirt/src/hash.c,
libvirt/src/internal.h, libvirt/src/libvirt.c,
libvirt/src/proxy_internal.c, libvirt/src/test.c,
libvirt/src/virsh.c, libvirt/src/xend_internal.c,
libvirt/src/xm_internal.c, libvirt/src/xml.c,
libvirt/python/libvir.c: use them
2007-01-23 08:39:45 -06:00
|
|
|
/**
|
2007-03-15 12:24:56 -05:00
|
|
|
* VIR_UUID_BUFLEN:
|
Mon Jan 23 14:36:18 IST 2007 Mark McLoughlin <markmc@redhat.com>
* include/libvirt/libvirt.h.in: add VIR_UUID_BUFLEN and
VIR_UUID_STRING_BUFLEN
* libvirt/proxy/libvirt_proxy.c, libvirt/src/hash.c,
libvirt/src/internal.h, libvirt/src/libvirt.c,
libvirt/src/proxy_internal.c, libvirt/src/test.c,
libvirt/src/virsh.c, libvirt/src/xend_internal.c,
libvirt/src/xm_internal.c, libvirt/src/xml.c,
libvirt/python/libvir.c: use them
2007-01-23 08:39:45 -06:00
|
|
|
*
|
|
|
|
* This macro provides the length of the buffer required
|
|
|
|
* for virDomainGetUUID()
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIR_UUID_BUFLEN (16)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_UUID_STRING_BUFLEN:
|
|
|
|
*
|
|
|
|
* This macro provides the length of the buffer required
|
|
|
|
* for virDomainGetUUIDString()
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIR_UUID_STRING_BUFLEN (36+1)
|
|
|
|
|
2008-05-15 01:12:32 -05:00
|
|
|
/* library versioning */
|
2005-12-08 09:08:46 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* LIBVIR_VERSION_NUMBER:
|
|
|
|
*
|
2008-02-05 13:27:37 -06:00
|
|
|
* Macro providing the version of the library as
|
2005-12-08 09:08:46 -06:00
|
|
|
* version * 1,000,000 + minor * 1000 + micro
|
|
|
|
*/
|
|
|
|
|
2006-02-15 07:21:17 -06:00
|
|
|
#define LIBVIR_VERSION_NUMBER @LIBVIRT_VERSION_NUMBER@
|
2005-12-08 09:08:46 -06:00
|
|
|
|
2013-11-13 10:46:03 -06:00
|
|
|
/**
|
|
|
|
* LIBVIR_CHECK_VERSION:
|
|
|
|
* @major: major component of the version number
|
|
|
|
* @minor: minor component of the version number
|
|
|
|
* @micro: micro component of the version number
|
|
|
|
*
|
|
|
|
* Macro for developers to easily check what version of the library
|
|
|
|
* their code is compiling against.
|
|
|
|
* e.g.
|
|
|
|
* #if LIBVIR_CHECK_VERSION(1,1,3)
|
|
|
|
* // some code that only works in 1.1.3 and newer
|
|
|
|
* #endif
|
|
|
|
*/
|
|
|
|
#define LIBVIR_CHECK_VERSION(major, minor, micro) \
|
|
|
|
((major) * 1000000 + (minor) * 1000 + (micro) <= LIBVIR_VERSION_NUMBER)
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virGetVersion (unsigned long *libVer,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *type,
|
|
|
|
unsigned long *typeVer);
|
2005-12-08 09:08:46 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Connection and disconnections to the Hypervisor
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virInitialize (void);
|
2006-03-27 09:24:36 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virConnectPtr virConnectOpen (const char *name);
|
|
|
|
virConnectPtr virConnectOpenReadOnly (const char *name);
|
2007-12-05 12:28:05 -06:00
|
|
|
virConnectPtr virConnectOpenAuth (const char *name,
|
2008-04-10 11:54:54 -05:00
|
|
|
virConnectAuthPtr auth,
|
public API: prefer unsigned int for flags
Most APIs use 'unsigned int flags'; but a few stragglers were using
a signed value. In particular, the vir*GetXMLDesc APIs were
split-brain, with inconsistent choice of types. Although it is
an API break to use 'int' instead of 'unsigned int', it is ABI
compatible (pre-compiled apps will have no difference in behavior),
and generally apps can be recompiled without any issue (only rare
apps that compiled with extremely high warning levels, or which
pass libvirt API around as typed function pointers, would have to
make any code changes to deal with the change).
The migrate APIs use 'unsigned long flags', which can't be changed,
due to ABI constraints.
This patch intentionally touches only the public API, to prove the
claim that most existing code (including driver callbacks and virsh)
still compiles just fine in spite of the type change.
* include/libvirt/libvirt.h.in (virConnectOpenAuth)
(virDomainCoreDump, virDomainGetXMLDesc, virNetworkGetXMLDesc)
(virNWFilterGetXMLDesc): Use unsigned int for flags.
(virDomainHasCurrentSnapshot): Use consistent spelling.
* src/libvirt.c (virConnectOpenAuth, virDomainCoreDump)
(virDomainGetXMLDesc, virNetworkGetXMLDesc)
(virNWFilterGetXMLDesc, do_open): Update accordingly.
2011-07-06 14:55:47 -05:00
|
|
|
unsigned int flags);
|
2009-01-20 06:14:03 -06:00
|
|
|
int virConnectRef (virConnectPtr conn);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virConnectClose (virConnectPtr conn);
|
|
|
|
const char * virConnectGetType (virConnectPtr conn);
|
|
|
|
int virConnectGetVersion (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned long *hvVer);
|
2009-11-12 09:53:26 -06:00
|
|
|
int virConnectGetLibVersion (virConnectPtr conn,
|
|
|
|
unsigned long *libVer);
|
2007-06-26 06:42:46 -05:00
|
|
|
char * virConnectGetHostname (virConnectPtr conn);
|
|
|
|
char * virConnectGetURI (virConnectPtr conn);
|
2011-02-07 13:52:29 -06:00
|
|
|
char * virConnectGetSysinfo (virConnectPtr conn,
|
|
|
|
unsigned int flags);
|
2007-06-26 06:42:46 -05:00
|
|
|
|
2012-01-28 08:37:55 -06:00
|
|
|
int virConnectSetKeepAlive(virConnectPtr conn,
|
|
|
|
int interval,
|
|
|
|
unsigned int count);
|
|
|
|
|
2012-07-19 05:01:07 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_CONNECT_CLOSE_REASON_ERROR = 0, /* Misc I/O error */
|
|
|
|
VIR_CONNECT_CLOSE_REASON_EOF = 1, /* End-of-file from server */
|
|
|
|
VIR_CONNECT_CLOSE_REASON_KEEPALIVE = 2, /* Keepalive timer triggered */
|
|
|
|
VIR_CONNECT_CLOSE_REASON_CLIENT = 3, /* Client requested it */
|
|
|
|
|
|
|
|
# ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_CONNECT_CLOSE_REASON_LAST
|
|
|
|
# endif
|
|
|
|
} virConnectCloseReason;
|
|
|
|
|
2013-01-30 01:35:38 -06:00
|
|
|
/**
|
|
|
|
* virConnectCloseFunc:
|
|
|
|
* @conn: virConnect connection
|
|
|
|
* @reason: reason why the connection was closed (one of virConnectCloseReason)
|
|
|
|
* @opaque: opaque user data
|
|
|
|
*
|
|
|
|
* A callback function to be registered, and called when the connection
|
|
|
|
* is closed.
|
|
|
|
*/
|
2012-07-19 05:01:07 -05:00
|
|
|
typedef void (*virConnectCloseFunc)(virConnectPtr conn,
|
|
|
|
int reason,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virConnectRegisterCloseCallback(virConnectPtr conn,
|
|
|
|
virConnectCloseFunc cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback freecb);
|
|
|
|
int virConnectUnregisterCloseCallback(virConnectPtr conn,
|
|
|
|
virConnectCloseFunc cb);
|
2007-06-26 06:42:46 -05:00
|
|
|
|
2007-03-15 12:24:56 -05:00
|
|
|
/*
|
|
|
|
* Capabilities of the connection / driver.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int virConnectGetMaxVcpus (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *type);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virNodeGetInfo (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
virNodeInfoPtr info);
|
2007-03-15 12:24:56 -05:00
|
|
|
char * virConnectGetCapabilities (virConnectPtr conn);
|
2005-12-08 09:08:46 -06:00
|
|
|
|
2014-06-25 10:05:20 -05:00
|
|
|
char * virConnectGetDomainCapabilities(virConnectPtr conn,
|
|
|
|
const char *emulatorbin,
|
|
|
|
const char *arch,
|
|
|
|
const char *machine,
|
|
|
|
const char *virttype,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-06-06 19:58:47 -05:00
|
|
|
int virNodeGetCPUStats (virConnectPtr conn,
|
|
|
|
int cpuNum,
|
2011-06-15 05:39:57 -05:00
|
|
|
virNodeCPUStatsPtr params,
|
2011-06-06 19:58:47 -05:00
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-06-06 20:03:36 -05:00
|
|
|
int virNodeGetMemoryStats (virConnectPtr conn,
|
|
|
|
int cellNum,
|
2011-06-15 05:39:57 -05:00
|
|
|
virNodeMemoryStatsPtr params,
|
2011-06-06 20:03:36 -05:00
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
unsigned long long virNodeGetFreeMemory (virConnectPtr conn);
|
2007-09-30 08:09:07 -05:00
|
|
|
|
2009-03-03 03:09:00 -06:00
|
|
|
int virNodeGetSecurityModel (virConnectPtr conn,
|
|
|
|
virSecurityModelPtr secmodel);
|
|
|
|
|
2011-11-29 00:37:06 -06:00
|
|
|
int virNodeSuspendForDuration (virConnectPtr conn,
|
|
|
|
unsigned int target,
|
|
|
|
unsigned long long duration,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/*
|
|
|
|
* Gather list of running domains
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virConnectListDomains (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
int *ids,
|
|
|
|
int maxids);
|
2005-12-08 09:08:46 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Number of domains
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virConnectNumOfDomains (virConnectPtr conn);
|
2005-12-08 09:08:46 -06:00
|
|
|
|
|
|
|
|
2007-06-25 10:56:18 -05:00
|
|
|
/*
|
|
|
|
* Get connection from domain.
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virConnectPtr virDomainGetConnect (virDomainPtr domain);
|
2007-06-25 10:56:18 -05:00
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/*
|
|
|
|
* Domain creation and destruction
|
|
|
|
*/
|
2011-07-20 10:02:48 -05:00
|
|
|
|
2008-10-10 04:32:27 -05:00
|
|
|
virDomainPtr virDomainCreateXML (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int flags);
|
Introduce new domain create APIs to pass pre-opened FDs to LXC
With container based virt, it is useful to be able to pass
pre-opened file descriptors to the container init process.
This allows for containers to be auto-activated from incoming
socket connections, passing the active socket into the container.
To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
and virDomainCreateWithFiles, which accept an array of file
descriptors. For the LXC driver, UNIX file descriptor passing
will be used to send them to libvirtd, which will them pass
them down to libvirt_lxc, which will then pass them to the container
init process.
This will only be implemented for LXC right now, but the design
is generic enough it could work with other hypervisors, hence
I suggest adding this to libvirt.so, rather than libvirt-lxc.so
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-09 11:12:38 -05:00
|
|
|
virDomainPtr virDomainCreateXMLWithFiles(virConnectPtr conn,
|
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int nfiles,
|
|
|
|
int *files,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virDomainPtr virDomainLookupByName (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *name);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virDomainPtr virDomainLookupByID (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
int id);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virDomainPtr virDomainLookupByUUID (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const unsigned char *uuid);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn,
|
2013-01-10 06:49:09 -06:00
|
|
|
const char *uuid);
|
2006-05-22 09:38:33 -05:00
|
|
|
|
2011-10-05 12:31:55 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SHUTDOWN_DEFAULT = 0, /* hypervisor choice */
|
|
|
|
VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = (1 << 0), /* Send ACPI event */
|
|
|
|
VIR_DOMAIN_SHUTDOWN_GUEST_AGENT = (1 << 1), /* Use guest agent */
|
2012-11-28 07:24:23 -06:00
|
|
|
VIR_DOMAIN_SHUTDOWN_INITCTL = (1 << 2), /* Use initctl */
|
|
|
|
VIR_DOMAIN_SHUTDOWN_SIGNAL = (1 << 3), /* Send a signal */
|
2014-05-01 12:42:54 -05:00
|
|
|
VIR_DOMAIN_SHUTDOWN_PARAVIRT = (1 << 4), /* Use paravirt guest control */
|
2011-10-05 12:31:55 -05:00
|
|
|
} virDomainShutdownFlagValues;
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainShutdown (virDomainPtr domain);
|
2011-10-05 12:31:55 -05:00
|
|
|
int virDomainShutdownFlags (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_REBOOT_DEFAULT = 0, /* hypervisor choice */
|
|
|
|
VIR_DOMAIN_REBOOT_ACPI_POWER_BTN = (1 << 0), /* Send ACPI event */
|
|
|
|
VIR_DOMAIN_REBOOT_GUEST_AGENT = (1 << 1), /* Use guest agent */
|
2012-11-28 07:24:23 -06:00
|
|
|
VIR_DOMAIN_REBOOT_INITCTL = (1 << 2), /* Use initctl */
|
|
|
|
VIR_DOMAIN_REBOOT_SIGNAL = (1 << 3), /* Send a signal */
|
2014-05-01 12:42:54 -05:00
|
|
|
VIR_DOMAIN_REBOOT_PARAVIRT = (1 << 4), /* Use paravirt guest control */
|
2011-10-05 12:31:55 -05:00
|
|
|
} virDomainRebootFlagValues;
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainReboot (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
2011-09-29 03:53:29 -05:00
|
|
|
int virDomainReset (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainDestroy (virDomainPtr domain);
|
qemu: new GRACEFUL flag for virDomainDestroy w/ QEMU support
When libvirt's virDomainDestroy API is shutting down the qemu process,
it first sends SIGTERM, then waits for 1.6 seconds and, if it sees the
process still there, sends a SIGKILL.
There have been reports that this behavior can lead to data loss
because the guest running in qemu doesn't have time to flush its disk
cache buffers before it's unceremoniously whacked.
This patch maintains that default behavior, but provides a new flag
VIR_DOMAIN_DESTROY_GRACEFUL to alter the behavior. If this flag is set
in the call to virDomainDestroyFlags, SIGKILL will never be sent to
the qemu process; instead, if the timeout is reached and the qemu
process still exists, virDomainDestroy will return an error.
Once this patch is in, the recommended method for applications to call
virDomainDestroyFlags will be with VIR_DOMAIN_DESTROY_GRACEFUL
included. If that fails, then the application can decide if and when
to call virDomainDestroyFlags again without
VIR_DOMAIN_DESTROY_GRACEFUL (to force the issue with SIGKILL).
(Note that this does not address the issue of existing applications
that have not yet been modified to use VIR_DOMAIN_DESTROY_GRACEFUL.
That is a separate patch.)
2012-01-27 12:28:23 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainDestroyFlagsValues:
|
|
|
|
*
|
|
|
|
* Flags used to provide specific behaviour to the
|
|
|
|
* virDomainDestroyFlags() function
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DESTROY_DEFAULT = 0, /* Default behavior - could lead to data loss!! */
|
|
|
|
VIR_DOMAIN_DESTROY_GRACEFUL = 1 << 0, /* only SIGTERM, no SIGKILL */
|
|
|
|
} virDomainDestroyFlagsValues;
|
|
|
|
|
2011-07-20 10:02:48 -05:00
|
|
|
int virDomainDestroyFlags (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
2009-01-20 06:14:03 -06:00
|
|
|
int virDomainRef (virDomainPtr domain);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainFree (virDomainPtr domain);
|
2005-12-08 09:08:46 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Domain suspend/resume
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainSuspend (virDomainPtr domain);
|
|
|
|
int virDomainResume (virDomainPtr domain);
|
2012-01-26 12:05:46 -06:00
|
|
|
int virDomainPMSuspendForDuration (virDomainPtr domain,
|
|
|
|
unsigned int target,
|
|
|
|
unsigned long long duration,
|
|
|
|
unsigned int flags);
|
2012-02-10 05:40:52 -06:00
|
|
|
int virDomainPMWakeup (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
2006-01-18 04:37:08 -06:00
|
|
|
/*
|
|
|
|
* Domain save/restore
|
|
|
|
*/
|
2011-07-06 13:10:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainSaveRestoreFlags:
|
2011-08-26 16:27:50 -05:00
|
|
|
* Flags for use in virDomainSaveFlags(), virDomainManagedSave(),
|
|
|
|
* virDomainRestoreFlags(), and virDomainSaveImageDefineXML(). Not all
|
|
|
|
* flags apply to all these functions.
|
2011-07-06 13:10:11 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SAVE_BYPASS_CACHE = 1 << 0, /* Avoid file system cache pollution */
|
2011-08-26 16:27:50 -05:00
|
|
|
VIR_DOMAIN_SAVE_RUNNING = 1 << 1, /* Favor running over paused */
|
|
|
|
VIR_DOMAIN_SAVE_PAUSED = 1 << 2, /* Favor paused over running */
|
2011-07-06 13:10:11 -05:00
|
|
|
} virDomainSaveRestoreFlags;
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainSave (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *to);
|
2011-07-06 13:10:11 -05:00
|
|
|
int virDomainSaveFlags (virDomainPtr domain,
|
|
|
|
const char *to,
|
|
|
|
const char *dxml,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainRestore (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *from);
|
2011-07-06 13:10:11 -05:00
|
|
|
int virDomainRestoreFlags (virConnectPtr conn,
|
|
|
|
const char *from,
|
|
|
|
const char *dxml,
|
|
|
|
unsigned int flags);
|
2006-01-18 04:37:08 -06:00
|
|
|
|
2011-07-19 23:29:26 -05:00
|
|
|
char * virDomainSaveImageGetXMLDesc (virConnectPtr conn,
|
|
|
|
const char *file,
|
|
|
|
unsigned int flags);
|
|
|
|
int virDomainSaveImageDefineXML (virConnectPtr conn,
|
|
|
|
const char *file,
|
|
|
|
const char *dxml,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2010-04-01 03:46:28 -05:00
|
|
|
/*
|
|
|
|
* Managed domain save
|
|
|
|
*/
|
|
|
|
int virDomainManagedSave (virDomainPtr dom,
|
|
|
|
unsigned int flags);
|
|
|
|
int virDomainHasManagedSaveImage(virDomainPtr dom,
|
2013-01-10 06:49:09 -06:00
|
|
|
unsigned int flags);
|
2010-04-01 03:46:28 -05:00
|
|
|
int virDomainManagedSaveRemove(virDomainPtr dom,
|
2013-01-10 06:49:09 -06:00
|
|
|
unsigned int flags);
|
2010-04-01 03:46:28 -05:00
|
|
|
|
2006-11-22 11:48:29 -06:00
|
|
|
/*
|
|
|
|
* Domain core dump
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainCoreDump (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *to,
|
public API: prefer unsigned int for flags
Most APIs use 'unsigned int flags'; but a few stragglers were using
a signed value. In particular, the vir*GetXMLDesc APIs were
split-brain, with inconsistent choice of types. Although it is
an API break to use 'int' instead of 'unsigned int', it is ABI
compatible (pre-compiled apps will have no difference in behavior),
and generally apps can be recompiled without any issue (only rare
apps that compiled with extremely high warning levels, or which
pass libvirt API around as typed function pointers, would have to
make any code changes to deal with the change).
The migrate APIs use 'unsigned long flags', which can't be changed,
due to ABI constraints.
This patch intentionally touches only the public API, to prove the
claim that most existing code (including driver callbacks and virsh)
still compiles just fine in spite of the type change.
* include/libvirt/libvirt.h.in (virConnectOpenAuth)
(virDomainCoreDump, virDomainGetXMLDesc, virNetworkGetXMLDesc)
(virNWFilterGetXMLDesc): Use unsigned int for flags.
(virDomainHasCurrentSnapshot): Use consistent spelling.
* src/libvirt.c (virConnectOpenAuth, virDomainCoreDump)
(virDomainGetXMLDesc, virNetworkGetXMLDesc)
(virNWFilterGetXMLDesc, do_open): Update accordingly.
2011-07-06 14:55:47 -05:00
|
|
|
unsigned int flags);
|
2006-11-22 11:48:29 -06:00
|
|
|
|
2014-03-22 22:51:12 -05:00
|
|
|
/*
|
|
|
|
* Domain core dump with format specified
|
|
|
|
*/
|
|
|
|
int virDomainCoreDumpWithFormat (virDomainPtr domain,
|
|
|
|
const char *to,
|
|
|
|
unsigned int dumpformat,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-04-04 04:58:53 -05:00
|
|
|
/*
|
|
|
|
* Screenshot of current domain console
|
|
|
|
*/
|
|
|
|
char * virDomainScreenshot (virDomainPtr domain,
|
|
|
|
virStreamPtr stream,
|
|
|
|
unsigned int screen,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/*
|
2012-01-28 08:37:55 -06:00
|
|
|
* Domain runtime information, and collecting CPU statistics
|
2005-12-08 09:08:46 -06:00
|
|
|
*/
|
2012-01-28 08:37:55 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainGetInfo (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
virDomainInfoPtr info);
|
2011-04-22 06:31:35 -05:00
|
|
|
int virDomainGetState (virDomainPtr domain,
|
|
|
|
int *state,
|
|
|
|
int *reason,
|
|
|
|
unsigned int flags);
|
2012-01-28 08:37:55 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_CPU_STATS_CPUTIME:
|
2012-05-09 03:41:37 -05:00
|
|
|
* cpu usage (sum of both vcpu and hypervisor usage) in nanoseconds,
|
|
|
|
* as a ullong
|
2012-01-28 08:37:55 -06:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_CPU_STATS_CPUTIME "cpu_time"
|
|
|
|
|
2012-03-09 09:20:20 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_CPU_STATS_USERTIME:
|
|
|
|
* cpu time charged to user instructions in nanoseconds, as a ullong
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_CPU_STATS_USERTIME "user_time"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_CPU_STATS_SYSTEMTIME:
|
|
|
|
* cpu time charged to system instructions in nanoseconds, as a ullong
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_CPU_STATS_SYSTEMTIME "system_time"
|
|
|
|
|
2012-05-09 03:41:37 -05:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_CPU_STATS_VCPUTIME:
|
|
|
|
* vcpu usage in nanoseconds (cpu_time excluding hypervisor time),
|
|
|
|
* as a ullong
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_CPU_STATS_VCPUTIME "vcpu_time"
|
|
|
|
|
2012-01-28 08:37:55 -06:00
|
|
|
int virDomainGetCPUStats(virDomainPtr domain,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
unsigned int nparams,
|
|
|
|
int start_cpu,
|
|
|
|
unsigned int ncpus,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-05-24 03:28:50 -05:00
|
|
|
int virDomainGetControlInfo (virDomainPtr domain,
|
|
|
|
virDomainControlInfoPtr info,
|
|
|
|
unsigned int flags);
|
2008-02-05 13:27:37 -06:00
|
|
|
|
2007-06-05 07:06:08 -05:00
|
|
|
/*
|
|
|
|
* Return scheduler type in effect 'sedf', 'credit', 'linux'
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
char * virDomainGetSchedulerType(virDomainPtr domain,
|
2013-01-10 06:49:09 -06:00
|
|
|
int *nparams);
|
2011-05-17 12:44:53 -05:00
|
|
|
|
2011-02-21 23:30:33 -06:00
|
|
|
|
2011-05-29 05:24:20 -05:00
|
|
|
/* Manage blkio parameters. */
|
2011-02-21 23:30:33 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_WEIGHT:
|
|
|
|
*
|
|
|
|
* Macro for the Blkio tunable weight: it represents the io weight
|
2011-11-01 15:38:42 -05:00
|
|
|
* the guest can use, as a uint.
|
2011-02-21 23:30:33 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIR_DOMAIN_BLKIO_WEIGHT "weight"
|
|
|
|
|
2011-11-08 05:00:33 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_DEVICE_WEIGHT:
|
|
|
|
*
|
|
|
|
* Macro for the blkio tunable weight_device: it represents the
|
|
|
|
* per-device weight, as a string. The string is parsed as a
|
|
|
|
* series of /path/to/device,weight elements, separated by ','.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIR_DOMAIN_BLKIO_DEVICE_WEIGHT "device_weight"
|
|
|
|
|
virsh: add setting throttle blkio cgroup option to blkiotune
With this patch, user can setup the throttle blkio cgorup
for domain through the virsh cmd, such as:
virsh blkiotune domain1 --device-read-bytes-sec /dev/sda1,1000000,/dev/sda2,2000000
--device-write-bytes-sec /dev/sda1,1000000 --device-read-iops-sec /dev/sda1,10000
--device-write-iops-sec /dev/sda1,10000,/dev/sda2,0
This patch also add manpage for these new options.
Signed-off-by: Guan Qiang <hzguanqiang@corp.netease.com>
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
2013-12-11 02:29:51 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS:
|
|
|
|
*
|
|
|
|
* Macro for the blkio tunable throttle.read_iops_device: it represents
|
|
|
|
* the number of reading the block device per second, as a string. The
|
|
|
|
* string is parsed as a series of /path/to/device, read_iops elements,
|
|
|
|
* separated by ','.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS "device_read_iops_sec"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS:
|
|
|
|
*
|
|
|
|
* Macro for the blkio tunable throttle.write_iops_device: it represents
|
|
|
|
* the number of writing the block device per second, as a string. The
|
|
|
|
* string is parsed as a series of /path/to/device, write_iops elements,
|
|
|
|
* separated by ','.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS "device_write_iops_sec"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_DEVICE_READ_BPS:
|
|
|
|
*
|
|
|
|
* Macro for the blkio tunable throttle.read_iops_device: it represents
|
|
|
|
* the bytes of reading the block device per second, as a string. The
|
|
|
|
* string is parsed as a series of /path/to/device, read_bps elements,
|
|
|
|
* separated by ','.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLKIO_DEVICE_READ_BPS "device_read_bytes_sec"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS:
|
|
|
|
*
|
|
|
|
* Macro for the blkio tunable throttle.read_iops_device: it represents
|
|
|
|
* the number of reading the block device per second, as a string. The
|
|
|
|
* string is parsed as a series of /path/to/device, write_bps elements,
|
|
|
|
* separated by ','.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS "device_write_bytes_sec"
|
|
|
|
|
|
|
|
|
2011-02-21 23:30:33 -06:00
|
|
|
/* Set Blkio tunables for the domain*/
|
|
|
|
int virDomainSetBlkioParameters(virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams, unsigned int flags);
|
2011-02-21 23:30:33 -06:00
|
|
|
int virDomainGetBlkioParameters(virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams, unsigned int flags);
|
2007-06-05 07:06:08 -05:00
|
|
|
|
2011-05-17 12:44:53 -05:00
|
|
|
/* Manage memory parameters. */
|
|
|
|
|
2011-01-15 08:03:08 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_MEMORY_PARAM_UNLIMITED:
|
|
|
|
*
|
|
|
|
* Macro providing the virMemoryParameter value that indicates "unlimited"
|
|
|
|
*/
|
|
|
|
|
2011-03-09 03:42:49 -06:00
|
|
|
#define VIR_DOMAIN_MEMORY_PARAM_UNLIMITED 9007199254740991LL /* = INT64_MAX >> 10 */
|
2010-10-12 14:24:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_MEMORY_HARD_LIMIT:
|
|
|
|
*
|
2010-10-20 04:38:39 -05:00
|
|
|
* Macro for the memory tunable hard_limit: it represents the maximum memory
|
2011-11-01 15:38:42 -05:00
|
|
|
* the guest can use, as a ullong.
|
2010-10-12 14:24:11 -05:00
|
|
|
*/
|
|
|
|
|
2010-10-12 08:43:27 -05:00
|
|
|
#define VIR_DOMAIN_MEMORY_HARD_LIMIT "hard_limit"
|
2010-10-12 14:24:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_MEMORY_SOFT_LIMIT:
|
|
|
|
*
|
2010-10-20 04:38:39 -05:00
|
|
|
* Macro for the memory tunable soft_limit: it represents the memory upper
|
2011-11-01 15:38:42 -05:00
|
|
|
* limit enforced during memory contention, as a ullong.
|
2010-10-12 14:24:11 -05:00
|
|
|
*/
|
|
|
|
|
2010-10-12 08:43:27 -05:00
|
|
|
#define VIR_DOMAIN_MEMORY_SOFT_LIMIT "soft_limit"
|
2010-10-12 14:24:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_MEMORY_MIN_GUARANTEE:
|
|
|
|
*
|
2010-10-20 04:38:39 -05:00
|
|
|
* Macro for the memory tunable min_guarantee: it represents the minimum
|
2011-11-01 15:38:42 -05:00
|
|
|
* memory guaranteed to be reserved for the guest, as a ullong.
|
2010-10-12 14:24:11 -05:00
|
|
|
*/
|
|
|
|
|
2010-10-12 08:43:27 -05:00
|
|
|
#define VIR_DOMAIN_MEMORY_MIN_GUARANTEE "min_guarantee"
|
2010-10-12 14:24:11 -05:00
|
|
|
|
|
|
|
/**
|
2010-10-20 06:52:48 -05:00
|
|
|
* VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT:
|
2010-10-12 14:24:11 -05:00
|
|
|
*
|
2010-10-20 04:38:39 -05:00
|
|
|
* Macro for the swap tunable swap_hard_limit: it represents the maximum swap
|
2011-11-01 15:38:42 -05:00
|
|
|
* plus memory the guest can use, as a ullong. This limit has to be more than
|
2011-03-16 00:07:12 -05:00
|
|
|
* VIR_DOMAIN_MEMORY_HARD_LIMIT.
|
2010-10-12 14:24:11 -05:00
|
|
|
*/
|
|
|
|
|
2010-10-20 06:52:48 -05:00
|
|
|
#define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT "swap_hard_limit"
|
2010-10-12 08:43:27 -05:00
|
|
|
|
|
|
|
/* Set memory tunables for the domain*/
|
|
|
|
int virDomainSetMemoryParameters(virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
2010-10-12 08:43:27 -05:00
|
|
|
int nparams, unsigned int flags);
|
|
|
|
int virDomainGetMemoryParameters(virDomainPtr domain,
|
2011-05-29 05:24:20 -05:00
|
|
|
virTypedParameterPtr params,
|
2010-10-12 08:43:27 -05:00
|
|
|
int *nparams, unsigned int flags);
|
|
|
|
|
2011-03-02 02:07:48 -06:00
|
|
|
/* Memory size modification flags. */
|
|
|
|
typedef enum {
|
2011-06-08 01:33:33 -05:00
|
|
|
/* See virDomainModificationImpact for these flags. */
|
|
|
|
VIR_DOMAIN_MEM_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
|
|
|
|
VIR_DOMAIN_MEM_LIVE = VIR_DOMAIN_AFFECT_LIVE,
|
|
|
|
VIR_DOMAIN_MEM_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
|
|
|
|
|
|
|
|
/* Additionally, these flags may be bitwise-OR'd in. */
|
2011-04-08 00:07:27 -05:00
|
|
|
VIR_DOMAIN_MEM_MAXIMUM = (1 << 2), /* affect Max rather than current */
|
2011-03-02 02:07:48 -06:00
|
|
|
} virDomainMemoryModFlags;
|
|
|
|
|
|
|
|
|
2011-12-20 02:35:00 -06:00
|
|
|
/* Manage numa parameters */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainNumatuneMemMode:
|
|
|
|
* Representation of the various modes in the <numatune> element of
|
|
|
|
* a domain.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_STRICT = 0,
|
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_PREFERRED = 1,
|
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE = 2,
|
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_LAST /* This constant is subject to change */
|
2012-01-20 12:43:28 -06:00
|
|
|
#endif
|
2011-12-20 02:35:00 -06:00
|
|
|
} virDomainNumatuneMemMode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_NUMA_NODESET:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter name that lists the numa nodeset of a
|
|
|
|
* domain, as a string.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_NUMA_NODESET "numa_nodeset"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_NUMA_MODE:
|
|
|
|
*
|
|
|
|
* Macro for typed parameter name that lists the numa mode of a domain,
|
|
|
|
* as an int containing a virDomainNumatuneMemMode value.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_NUMA_MODE "numa_mode"
|
|
|
|
|
|
|
|
int virDomainSetNumaParameters(virDomainPtr domain,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams, unsigned int flags);
|
|
|
|
int virDomainGetNumaParameters(virDomainPtr domain,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams, unsigned int flags);
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
/*
|
|
|
|
* Dynamic control of domains
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
const char * virDomainGetName (virDomainPtr domain);
|
|
|
|
unsigned int virDomainGetID (virDomainPtr domain);
|
|
|
|
int virDomainGetUUID (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned char *uuid);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainGetUUIDString (virDomainPtr domain,
|
2013-01-10 06:49:09 -06:00
|
|
|
char *buf);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
char * virDomainGetOSType (virDomainPtr domain);
|
|
|
|
unsigned long virDomainGetMaxMemory (virDomainPtr domain);
|
|
|
|
int virDomainSetMaxMemory (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned long memory);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainSetMemory (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned long memory);
|
2011-03-02 02:07:48 -06:00
|
|
|
int virDomainSetMemoryFlags (virDomainPtr domain,
|
|
|
|
unsigned long memory,
|
|
|
|
unsigned int flags);
|
2013-07-08 09:22:38 -05:00
|
|
|
int virDomainSetMemoryStatsPeriod (virDomainPtr domain,
|
|
|
|
int period,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainGetMaxVcpus (virDomainPtr domain);
|
2009-03-03 03:09:00 -06:00
|
|
|
int virDomainGetSecurityLabel (virDomainPtr domain,
|
|
|
|
virSecurityLabelPtr seclabel);
|
2012-07-10 02:34:23 -05:00
|
|
|
char * virDomainGetHostname (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
2012-08-15 17:10:39 -05:00
|
|
|
int virDomainGetSecurityLabelList (virDomainPtr domain,
|
|
|
|
virSecurityLabelPtr* seclabels);
|
2007-03-08 02:31:07 -06:00
|
|
|
|
2012-02-01 07:03:50 -06:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_METADATA_DESCRIPTION = 0, /* Operate on <description> */
|
|
|
|
VIR_DOMAIN_METADATA_TITLE = 1, /* Operate on <title> */
|
|
|
|
VIR_DOMAIN_METADATA_ELEMENT = 2, /* Operate on <metadata> */
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_METADATA_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainMetadataType;
|
|
|
|
|
|
|
|
int
|
|
|
|
virDomainSetMetadata(virDomainPtr domain,
|
|
|
|
int type,
|
|
|
|
const char *metadata,
|
|
|
|
const char *key,
|
|
|
|
const char *uri,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
char *
|
|
|
|
virDomainGetMetadata(virDomainPtr domain,
|
|
|
|
int type,
|
|
|
|
const char *uri,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2005-12-15 18:51:27 -06:00
|
|
|
/*
|
|
|
|
* XML domain description
|
|
|
|
*/
|
2007-09-30 08:09:07 -05:00
|
|
|
/**
|
|
|
|
* virDomainXMLFlags:
|
|
|
|
*
|
|
|
|
* Flags available for virDomainGetXMLDesc
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum {
|
2010-03-23 03:34:19 -05:00
|
|
|
VIR_DOMAIN_XML_SECURE = (1 << 0), /* dump security sensitive information too */
|
|
|
|
VIR_DOMAIN_XML_INACTIVE = (1 << 1), /* dump inactive domain information */
|
|
|
|
VIR_DOMAIN_XML_UPDATE_CPU = (1 << 2), /* update guest CPU requirements according to host CPU */
|
2012-10-08 04:58:05 -05:00
|
|
|
VIR_DOMAIN_XML_MIGRATABLE = (1 << 3), /* dump XML suitable for migration */
|
2007-09-30 08:09:07 -05:00
|
|
|
} virDomainXMLFlags;
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
char * virDomainGetXMLDesc (virDomainPtr domain,
|
public API: prefer unsigned int for flags
Most APIs use 'unsigned int flags'; but a few stragglers were using
a signed value. In particular, the vir*GetXMLDesc APIs were
split-brain, with inconsistent choice of types. Although it is
an API break to use 'int' instead of 'unsigned int', it is ABI
compatible (pre-compiled apps will have no difference in behavior),
and generally apps can be recompiled without any issue (only rare
apps that compiled with extremely high warning levels, or which
pass libvirt API around as typed function pointers, would have to
make any code changes to deal with the change).
The migrate APIs use 'unsigned long flags', which can't be changed,
due to ABI constraints.
This patch intentionally touches only the public API, to prove the
claim that most existing code (including driver callbacks and virsh)
still compiles just fine in spite of the type change.
* include/libvirt/libvirt.h.in (virConnectOpenAuth)
(virDomainCoreDump, virDomainGetXMLDesc, virNetworkGetXMLDesc)
(virNWFilterGetXMLDesc): Use unsigned int for flags.
(virDomainHasCurrentSnapshot): Use consistent spelling.
* src/libvirt.c (virConnectOpenAuth, virDomainCoreDump)
(virDomainGetXMLDesc, virNetworkGetXMLDesc)
(virNWFilterGetXMLDesc, do_open): Update accordingly.
2011-07-06 14:55:47 -05:00
|
|
|
unsigned int flags);
|
2005-12-08 09:08:46 -06:00
|
|
|
|
2009-05-21 08:46:35 -05:00
|
|
|
|
|
|
|
char * virConnectDomainXMLFromNative(virConnectPtr conn,
|
|
|
|
const char *nativeFormat,
|
|
|
|
const char *nativeConfig,
|
|
|
|
unsigned int flags);
|
|
|
|
char * virConnectDomainXMLToNative(virConnectPtr conn,
|
|
|
|
const char *nativeFormat,
|
|
|
|
const char *domainXml,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2007-08-21 05:08:12 -05:00
|
|
|
int virDomainBlockStats (virDomainPtr dom,
|
2011-11-22 18:15:43 -06:00
|
|
|
const char *disk,
|
2008-04-10 11:54:54 -05:00
|
|
|
virDomainBlockStatsPtr stats,
|
|
|
|
size_t size);
|
2011-09-05 03:14:29 -05:00
|
|
|
int virDomainBlockStatsFlags (virDomainPtr dom,
|
2011-11-22 18:15:43 -06:00
|
|
|
const char *disk,
|
2011-09-05 03:14:29 -05:00
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
2007-08-21 05:08:12 -05:00
|
|
|
int virDomainInterfaceStats (virDomainPtr dom,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *path,
|
|
|
|
virDomainInterfaceStatsPtr stats,
|
|
|
|
size_t size);
|
2012-01-02 15:35:12 -06:00
|
|
|
|
|
|
|
/* Management of interface parameters */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BANDWIDTH_IN_AVERAGE:
|
|
|
|
*
|
|
|
|
* Macro represents the inbound average of NIC bandwidth, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BANDWIDTH_IN_AVERAGE "inbound.average"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BANDWIDTH_IN_PEAK:
|
|
|
|
*
|
|
|
|
* Macro represents the inbound peak of NIC bandwidth, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BANDWIDTH_IN_PEAK "inbound.peak"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BANDWIDTH_IN_BURST:
|
|
|
|
*
|
|
|
|
* Macro represents the inbound burst of NIC bandwidth, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BANDWIDTH_IN_BURST "inbound.burst"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE:
|
|
|
|
*
|
|
|
|
* Macro represents the outbound average of NIC bandwidth, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE "outbound.average"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BANDWIDTH_OUT_PEAK:
|
|
|
|
*
|
|
|
|
* Macro represents the outbound peak of NIC bandwidth, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BANDWIDTH_OUT_PEAK "outbound.peak"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BANDWIDTH_OUT_BURST:
|
|
|
|
*
|
|
|
|
* Macro represents the outbound burst of NIC bandwidth, as a uint.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BANDWIDTH_OUT_BURST "outbound.burst"
|
|
|
|
|
2011-12-29 01:33:16 -06:00
|
|
|
int virDomainSetInterfaceParameters (virDomainPtr dom,
|
2013-01-10 06:49:09 -06:00
|
|
|
const char *device,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams, unsigned int flags);
|
2011-12-29 01:33:16 -06:00
|
|
|
int virDomainGetInterfaceParameters (virDomainPtr dom,
|
2013-01-10 06:49:09 -06:00
|
|
|
const char *device,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams, unsigned int flags);
|
2012-01-02 15:35:12 -06:00
|
|
|
|
|
|
|
/* Management of domain block devices */
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainBlockPeek (virDomainPtr dom,
|
2011-11-22 18:15:43 -06:00
|
|
|
const char *disk,
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
unsigned long long offset,
|
|
|
|
size_t size,
|
|
|
|
void *buffer,
|
|
|
|
unsigned int flags);
|
2012-03-03 08:43:22 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainBlockResizeFlags:
|
|
|
|
*
|
|
|
|
* Flags available for virDomainBlockResize().
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_RESIZE_BYTES = 1 << 0, /* size in bytes instead of KiB */
|
|
|
|
} virDomainBlockResizeFlags;
|
|
|
|
|
2011-11-29 03:59:15 -06:00
|
|
|
int virDomainBlockResize (virDomainPtr dom,
|
|
|
|
const char *disk,
|
|
|
|
unsigned long long size,
|
|
|
|
unsigned int flags);
|
2010-04-27 14:24:30 -05:00
|
|
|
|
|
|
|
/** virDomainBlockInfo:
|
|
|
|
*
|
2013-12-17 15:47:28 -06:00
|
|
|
* This struct provides information about the size of a block device
|
|
|
|
* backing store
|
2010-04-27 14:24:30 -05:00
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* - Fully allocated raw file in filesystem:
|
|
|
|
* * capacity, allocation, physical: All the same
|
|
|
|
*
|
|
|
|
* - Sparse raw file in filesystem:
|
|
|
|
* * capacity: logical size of the file
|
|
|
|
* * allocation, physical: number of blocks allocated to file
|
|
|
|
*
|
|
|
|
* - qcow2 file in filesystem
|
|
|
|
* * capacity: logical size from qcow2 header
|
2013-12-17 15:47:28 -06:00
|
|
|
* * allocation, physical: logical size of the file /
|
|
|
|
* highest qcow extent (identical)
|
2010-04-27 14:24:30 -05:00
|
|
|
*
|
|
|
|
* - qcow2 file in a block device
|
|
|
|
* * capacity: logical size from qcow2 header
|
2013-12-17 15:47:28 -06:00
|
|
|
* * allocation: highest qcow extent written for an active domain
|
2010-04-27 14:24:30 -05:00
|
|
|
* * physical: size of the block device container
|
|
|
|
*/
|
|
|
|
typedef struct _virDomainBlockInfo virDomainBlockInfo;
|
|
|
|
typedef virDomainBlockInfo *virDomainBlockInfoPtr;
|
|
|
|
struct _virDomainBlockInfo {
|
|
|
|
unsigned long long capacity; /* logical size in bytes of the block device backing image */
|
|
|
|
unsigned long long allocation; /* highest allocated extent in bytes of the block device backing image */
|
|
|
|
unsigned long long physical; /* physical size in bytes of the container of the backing image */
|
|
|
|
};
|
|
|
|
|
|
|
|
int virDomainGetBlockInfo(virDomainPtr dom,
|
2011-11-22 18:15:43 -06:00
|
|
|
const char *disk,
|
2010-04-27 14:24:30 -05:00
|
|
|
virDomainBlockInfoPtr info,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2012-01-02 15:35:12 -06:00
|
|
|
/* Management of domain memory */
|
|
|
|
|
|
|
|
int virDomainMemoryStats (virDomainPtr dom,
|
|
|
|
virDomainMemoryStatPtr stats,
|
|
|
|
unsigned int nr_stats,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2008-06-10 05:43:28 -05:00
|
|
|
/* Memory peeking flags. */
|
2012-01-02 15:35:12 -06:00
|
|
|
|
2008-06-10 05:43:28 -05:00
|
|
|
typedef enum {
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_MEMORY_VIRTUAL = 1 << 0, /* addresses are virtual addresses */
|
|
|
|
VIR_MEMORY_PHYSICAL = 1 << 1, /* addresses are physical addresses */
|
2008-06-10 05:43:28 -05:00
|
|
|
} virDomainMemoryFlags;
|
|
|
|
|
|
|
|
int virDomainMemoryPeek (virDomainPtr dom,
|
|
|
|
unsigned long long start,
|
|
|
|
size_t size,
|
|
|
|
void *buffer,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2006-04-28 13:29:26 -05:00
|
|
|
/*
|
|
|
|
* defined but not running domains
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virDomainPtr virDomainDefineXML (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *xml);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainUndefine (virDomainPtr domain);
|
2011-07-19 21:59:54 -05:00
|
|
|
|
|
|
|
typedef enum {
|
2011-08-12 10:07:08 -05:00
|
|
|
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE = (1 << 0), /* Also remove any
|
|
|
|
managed save */
|
|
|
|
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA = (1 << 1), /* If last use of domain,
|
|
|
|
then also remove any
|
|
|
|
snapshot metadata */
|
2014-09-11 06:17:11 -05:00
|
|
|
VIR_DOMAIN_UNDEFINE_NVRAM = (1 << 2), /* Also remove any
|
|
|
|
nvram file */
|
2011-07-19 21:59:54 -05:00
|
|
|
|
|
|
|
/* Future undefine control flags should come here. */
|
|
|
|
} virDomainUndefineFlagsValues;
|
|
|
|
|
|
|
|
|
|
|
|
int virDomainUndefineFlags (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
2006-08-30 09:21:03 -05:00
|
|
|
int virConnectNumOfDefinedDomains (virConnectPtr conn);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virConnectListDefinedDomains (virConnectPtr conn,
|
2012-05-18 10:22:02 -05:00
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
|
|
|
/**
|
|
|
|
* virConnectListAllDomainsFlags:
|
|
|
|
*
|
|
|
|
* Flags used to tune which domains are listed by virConnectListAllDomains().
|
|
|
|
* Note that these flags come in groups; if all bits from a group are 0,
|
|
|
|
* then that group is not used to filter results.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_ACTIVE = 1 << 0,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_INACTIVE = 1 << 1,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_PERSISTENT = 1 << 2,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_TRANSIENT = 1 << 3,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_RUNNING = 1 << 4,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_PAUSED = 1 << 5,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_SHUTOFF = 1 << 6,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_OTHER = 1 << 7,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE = 1 << 8,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE = 1 << 9,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_AUTOSTART = 1 << 10,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART = 1 << 11,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT = 1 << 12,
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT = 1 << 13,
|
|
|
|
} virConnectListAllDomainsFlags;
|
|
|
|
|
|
|
|
int virConnectListAllDomains (virConnectPtr conn,
|
|
|
|
virDomainPtr **domains,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainCreate (virDomainPtr domain);
|
2010-06-10 08:28:05 -05:00
|
|
|
int virDomainCreateWithFlags (virDomainPtr domain,
|
2013-01-10 06:49:09 -06:00
|
|
|
unsigned int flags);
|
2006-04-28 13:29:26 -05:00
|
|
|
|
Introduce new domain create APIs to pass pre-opened FDs to LXC
With container based virt, it is useful to be able to pass
pre-opened file descriptors to the container init process.
This allows for containers to be auto-activated from incoming
socket connections, passing the active socket into the container.
To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
and virDomainCreateWithFiles, which accept an array of file
descriptors. For the LXC driver, UNIX file descriptor passing
will be used to send them to libvirtd, which will them pass
them down to libvirt_lxc, which will then pass them to the container
init process.
This will only be implemented for LXC right now, but the design
is generic enough it could work with other hypervisors, hence
I suggest adding this to libvirt.so, rather than libvirt-lxc.so
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-09 11:12:38 -05:00
|
|
|
int virDomainCreateWithFiles (virDomainPtr domain,
|
|
|
|
unsigned int nfiles,
|
|
|
|
int *files,
|
|
|
|
unsigned int flags);
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainGetAutostart (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
int *autostart);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainSetAutostart (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
int autostart);
|
2007-02-23 02:51:30 -06:00
|
|
|
|
2006-08-04 05:41:05 -05:00
|
|
|
/**
|
|
|
|
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum {
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
VIR_VCPU_OFFLINE = 0, /* the virtual CPU is offline */
|
|
|
|
VIR_VCPU_RUNNING = 1, /* the virtual CPU is running */
|
|
|
|
VIR_VCPU_BLOCKED = 2, /* the virtual CPU is blocked on resource */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_VCPU_LAST
|
|
|
|
#endif
|
2006-08-04 05:41:05 -05:00
|
|
|
} virVcpuState;
|
|
|
|
|
|
|
|
typedef struct _virVcpuInfo virVcpuInfo;
|
|
|
|
struct _virVcpuInfo {
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
unsigned int number; /* virtual CPU number */
|
|
|
|
int state; /* value from virVcpuState */
|
2006-08-04 05:41:05 -05:00
|
|
|
unsigned long long cpuTime; /* CPU time used, in nanoseconds */
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int cpu; /* real CPU number, or -1 if offline */
|
2006-08-04 05:41:05 -05:00
|
|
|
};
|
|
|
|
typedef virVcpuInfo *virVcpuInfoPtr;
|
|
|
|
|
2010-09-24 17:48:45 -05:00
|
|
|
/* Flags for controlling virtual CPU hot-plugging. */
|
|
|
|
typedef enum {
|
2011-07-15 02:00:37 -05:00
|
|
|
/* See virDomainModificationImpact for these flags. */
|
|
|
|
VIR_DOMAIN_VCPU_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
|
2011-06-08 01:33:33 -05:00
|
|
|
VIR_DOMAIN_VCPU_LIVE = VIR_DOMAIN_AFFECT_LIVE,
|
|
|
|
VIR_DOMAIN_VCPU_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
|
2010-09-24 17:48:45 -05:00
|
|
|
|
2011-06-08 01:33:33 -05:00
|
|
|
/* Additionally, these flags may be bitwise-OR'd in. */
|
2010-09-24 17:48:45 -05:00
|
|
|
VIR_DOMAIN_VCPU_MAXIMUM = (1 << 2), /* Max rather than current count */
|
2013-06-07 10:12:47 -05:00
|
|
|
VIR_DOMAIN_VCPU_GUEST = (1 << 3), /* Modify state of the cpu in the guest */
|
2010-09-24 17:48:45 -05:00
|
|
|
} virDomainVcpuFlags;
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainSetVcpus (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int nvcpus);
|
2010-09-24 17:48:45 -05:00
|
|
|
int virDomainSetVcpusFlags (virDomainPtr domain,
|
|
|
|
unsigned int nvcpus,
|
|
|
|
unsigned int flags);
|
|
|
|
int virDomainGetVcpusFlags (virDomainPtr domain,
|
|
|
|
unsigned int flags);
|
2006-08-04 05:41:05 -05:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainPinVcpu (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int vcpu,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen);
|
2011-06-13 10:35:54 -05:00
|
|
|
int virDomainPinVcpuFlags (virDomainPtr domain,
|
|
|
|
unsigned int vcpu,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen,
|
|
|
|
unsigned int flags);
|
2006-08-04 05:41:05 -05:00
|
|
|
|
2011-06-24 18:09:46 -05:00
|
|
|
int virDomainGetVcpuPinInfo (virDomainPtr domain,
|
2011-06-24 03:56:21 -05:00
|
|
|
int ncpumaps,
|
|
|
|
unsigned char *cpumaps,
|
|
|
|
int maplen,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2012-08-21 04:18:35 -05:00
|
|
|
int virDomainPinEmulator (virDomainPtr domain,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virDomainGetEmulatorPinInfo (virDomainPtr domain,
|
|
|
|
unsigned char *cpumaps,
|
|
|
|
int maplen,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2006-08-04 05:41:05 -05:00
|
|
|
/**
|
|
|
|
* VIR_USE_CPU:
|
|
|
|
* @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT)
|
|
|
|
* @cpu: the physical CPU number
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* This macro is to be used in conjunction with virDomainPinVcpu() API.
|
2012-10-16 09:05:12 -05:00
|
|
|
* It sets the bit (CPU usable) of the related cpu in cpumap.
|
2006-08-04 05:41:05 -05:00
|
|
|
*/
|
|
|
|
|
2012-10-16 09:05:12 -05:00
|
|
|
#define VIR_USE_CPU(cpumap, cpu) ((cpumap)[(cpu) / 8] |= (1 << ((cpu) % 8)))
|
2006-08-04 05:41:05 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_UNUSE_CPU:
|
|
|
|
* @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT)
|
|
|
|
* @cpu: the physical CPU number
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* This macro is to be used in conjunction with virDomainPinVcpu() API.
|
2012-10-16 09:05:12 -05:00
|
|
|
* It resets the bit (CPU not usable) of the related cpu in cpumap.
|
2006-08-04 05:41:05 -05:00
|
|
|
*/
|
|
|
|
|
2012-10-16 09:05:12 -05:00
|
|
|
#define VIR_UNUSE_CPU(cpumap, cpu) ((cpumap)[(cpu) / 8] &= ~(1 << ((cpu) % 8)))
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_CPU_USED:
|
|
|
|
* @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) (IN)
|
|
|
|
* @cpu: the physical CPU number
|
|
|
|
*
|
|
|
|
* This macro can be used in conjunction with virNodeGetCPUMap() API.
|
|
|
|
* It returns non-zero if the bit of the related CPU is set.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIR_CPU_USED(cpumap, cpu) ((cpumap)[(cpu) / 8] & (1 << ((cpu) % 8)))
|
2006-08-04 05:41:05 -05:00
|
|
|
|
2006-08-07 12:37:42 -05:00
|
|
|
/**
|
2006-08-16 12:58:23 -05:00
|
|
|
* VIR_CPU_MAPLEN:
|
2006-08-07 12:37:42 -05:00
|
|
|
* @cpu: number of physical CPUs
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* This macro is to be used in conjunction with virDomainPinVcpu() API.
|
2006-08-07 12:37:42 -05:00
|
|
|
* It returns the length (in bytes) required to store the complete
|
|
|
|
* CPU map between a single virtual & all physical CPUs of a domain.
|
|
|
|
*/
|
|
|
|
|
2012-10-16 09:05:12 -05:00
|
|
|
#define VIR_CPU_MAPLEN(cpu) (((cpu) + 7) / 8)
|
2006-08-07 12:37:42 -05:00
|
|
|
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virDomainGetVcpus (virDomainPtr domain,
|
2008-04-10 11:54:54 -05:00
|
|
|
virVcpuInfoPtr info,
|
|
|
|
int maxinfo,
|
|
|
|
unsigned char *cpumaps,
|
|
|
|
int maplen);
|
2006-08-04 05:41:05 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_CPU_USABLE:
|
|
|
|
* @cpumaps: pointer to an array of cpumap (in 8-bit bytes) (IN)
|
|
|
|
* @maplen: the length (in bytes) of one cpumap
|
|
|
|
* @vcpu: the virtual CPU number
|
|
|
|
* @cpu: the physical CPU number
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* This macro is to be used in conjunction with virDomainGetVcpus() API.
|
2012-10-16 09:05:12 -05:00
|
|
|
* VIR_CPU_USABLE macro returns a non-zero value (true) if the cpu
|
2006-08-04 05:41:05 -05:00
|
|
|
* is usable by the vcpu, and 0 otherwise.
|
|
|
|
*/
|
|
|
|
|
2012-10-16 09:05:12 -05:00
|
|
|
#define VIR_CPU_USABLE(cpumaps, maplen, vcpu, cpu) \
|
|
|
|
VIR_CPU_USED(VIR_GET_CPUMAP(cpumaps, maplen, vcpu), cpu)
|
2006-08-04 05:41:05 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_COPY_CPUMAP:
|
|
|
|
* @cpumaps: pointer to an array of cpumap (in 8-bit bytes) (IN)
|
|
|
|
* @maplen: the length (in bytes) of one cpumap
|
|
|
|
* @vcpu: the virtual CPU number
|
|
|
|
* @cpumap: pointer to a cpumap (in 8-bit bytes) (OUT)
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
* This cpumap must be previously allocated by the caller
|
2006-08-04 05:41:05 -05:00
|
|
|
* (ie: malloc(maplen))
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* This macro is to be used in conjunction with virDomainGetVcpus() and
|
2012-10-16 09:05:12 -05:00
|
|
|
* virDomainPinVcpu() APIs. VIR_COPY_CPUMAP macro extracts the cpumap of
|
|
|
|
* the specified vcpu from cpumaps array and copies it into cpumap to be used
|
2006-08-04 05:41:05 -05:00
|
|
|
* later by virDomainPinVcpu() API.
|
|
|
|
*/
|
2012-10-16 09:05:12 -05:00
|
|
|
#define VIR_COPY_CPUMAP(cpumaps, maplen, vcpu, cpumap) \
|
|
|
|
memcpy(cpumap, VIR_GET_CPUMAP(cpumaps, maplen, vcpu), maplen)
|
2006-08-04 05:41:05 -05:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_GET_CPUMAP:
|
|
|
|
* @cpumaps: pointer to an array of cpumap (in 8-bit bytes) (IN)
|
|
|
|
* @maplen: the length (in bytes) of one cpumap
|
|
|
|
* @vcpu: the virtual CPU number
|
|
|
|
*
|
2008-02-29 06:53:10 -06:00
|
|
|
* This macro is to be used in conjunction with virDomainGetVcpus() and
|
2006-08-04 05:41:05 -05:00
|
|
|
* virDomainPinVcpu() APIs. VIR_GET_CPUMAP macro returns a pointer to the
|
|
|
|
* cpumap of the specified vcpu from cpumaps array.
|
|
|
|
*/
|
2012-10-16 09:05:12 -05:00
|
|
|
#define VIR_GET_CPUMAP(cpumaps, maplen, vcpu) (&((cpumaps)[(vcpu) * (maplen)]))
|
2006-08-04 05:41:05 -05:00
|
|
|
|
2010-01-13 19:29:16 -06:00
|
|
|
|
|
|
|
typedef enum {
|
2011-06-08 01:33:33 -05:00
|
|
|
/* See virDomainModificationImpact for these flags. */
|
|
|
|
VIR_DOMAIN_DEVICE_MODIFY_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
|
|
|
|
VIR_DOMAIN_DEVICE_MODIFY_LIVE = VIR_DOMAIN_AFFECT_LIVE,
|
|
|
|
VIR_DOMAIN_DEVICE_MODIFY_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
|
|
|
|
|
|
|
|
/* Additionally, these flags may be bitwise-OR'd in. */
|
|
|
|
VIR_DOMAIN_DEVICE_MODIFY_FORCE = (1 << 2), /* Forcibly modify device
|
|
|
|
(ex. force eject a cdrom) */
|
2010-01-13 19:29:16 -06:00
|
|
|
} virDomainDeviceModifyFlags;
|
|
|
|
|
2007-10-15 16:38:56 -05:00
|
|
|
int virDomainAttachDevice(virDomainPtr domain, const char *xml);
|
|
|
|
int virDomainDetachDevice(virDomainPtr domain, const char *xml);
|
2006-08-04 05:41:05 -05:00
|
|
|
|
2010-01-13 19:29:16 -06:00
|
|
|
int virDomainAttachDeviceFlags(virDomainPtr domain,
|
|
|
|
const char *xml, unsigned int flags);
|
|
|
|
int virDomainDetachDeviceFlags(virDomainPtr domain,
|
|
|
|
const char *xml, unsigned int flags);
|
Introduce a new virDomainUpdateDeviceFlags public API
The current virDomainAttachDevice API can be (ab)used to change
the media of an existing CDROM/Floppy device. Going forward there
will be more devices that can be configured on the fly and overloading
virDomainAttachDevice for this is not too pleasant. This patch adds
a new virDomainUpdateDeviceFlags() explicitly just for modifying
existing devices.
* include/libvirt/libvirt.h.in: Add virDomainUpdateDeviceFlags
* src/driver.h: Internal API for virDomainUpdateDeviceFlags
* src/libvirt.c, src/libvirt_public.syms: Glue public API to
driver API
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Add
stubs for new driver entry point
2010-03-22 07:23:41 -05:00
|
|
|
int virDomainUpdateDeviceFlags(virDomainPtr domain,
|
|
|
|
const char *xml, unsigned int flags);
|
2010-01-13 19:29:16 -06:00
|
|
|
|
2014-08-26 14:11:42 -05:00
|
|
|
typedef struct _virDomainStatsRecord virDomainStatsRecord;
|
|
|
|
typedef virDomainStatsRecord *virDomainStatsRecordPtr;
|
|
|
|
struct _virDomainStatsRecord {
|
|
|
|
virDomainPtr dom;
|
|
|
|
virTypedParameterPtr params;
|
|
|
|
int nparams;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_STATS_STATE = (1 << 0), /* return domain state */
|
2014-09-15 03:48:05 -05:00
|
|
|
VIR_DOMAIN_STATS_CPU_TOTAL = (1 << 1), /* return domain CPU info */
|
2014-09-15 03:48:06 -05:00
|
|
|
VIR_DOMAIN_STATS_BALLOON = (1 << 2), /* return domain balloon info */
|
2014-09-15 03:48:07 -05:00
|
|
|
VIR_DOMAIN_STATS_VCPU = (1 << 3), /* return domain virtual CPU info */
|
2014-09-15 03:48:08 -05:00
|
|
|
VIR_DOMAIN_STATS_INTERFACE = (1 << 4), /* return domain interfaces info */
|
2014-09-15 03:48:09 -05:00
|
|
|
VIR_DOMAIN_STATS_BLOCK = (1 << 5), /* return domain block info */
|
2014-08-26 14:11:42 -05:00
|
|
|
} virDomainStatsTypes;
|
|
|
|
|
2014-08-27 10:02:50 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE = VIR_CONNECT_LIST_DOMAINS_ACTIVE,
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE = VIR_CONNECT_LIST_DOMAINS_INACTIVE,
|
|
|
|
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT = VIR_CONNECT_LIST_DOMAINS_PERSISTENT,
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT = VIR_CONNECT_LIST_DOMAINS_TRANSIENT,
|
|
|
|
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING = VIR_CONNECT_LIST_DOMAINS_RUNNING,
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED = VIR_CONNECT_LIST_DOMAINS_PAUSED,
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF = VIR_CONNECT_LIST_DOMAINS_SHUTOFF,
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER = VIR_CONNECT_LIST_DOMAINS_OTHER,
|
|
|
|
|
|
|
|
VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = 1 << 31, /* enforce requested stats */
|
|
|
|
} virConnectGetAllDomainStatsFlags;
|
|
|
|
|
2014-08-26 14:11:42 -05:00
|
|
|
int virConnectGetAllDomainStats(virConnectPtr conn,
|
|
|
|
unsigned int stats,
|
|
|
|
virDomainStatsRecordPtr **retStats,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virDomainListGetStats(virDomainPtr *doms,
|
|
|
|
unsigned int stats,
|
|
|
|
virDomainStatsRecordPtr **retStats,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats);
|
|
|
|
|
2011-07-22 00:18:06 -05:00
|
|
|
/*
|
|
|
|
* BlockJob API
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainBlockJobType:
|
|
|
|
*
|
2014-06-14 07:42:41 -05:00
|
|
|
* Describes various possible block jobs.
|
2011-07-22 00:18:06 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
2014-06-14 07:42:41 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN = 0, /* Placeholder */
|
|
|
|
|
2011-07-22 00:18:06 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_TYPE_PULL = 1,
|
2014-06-14 07:42:41 -05:00
|
|
|
/* Block Pull (virDomainBlockPull, or virDomainBlockRebase without
|
|
|
|
* flags), job ends on completion */
|
|
|
|
|
blockjob: add new API flags
This patch introduces a new block job, useful for live storage
migration using pre-copy streaming. Justification for including
this under virDomainBlockRebase rather than adding a new command
includes: 1) there are now two possible block jobs in qemu, with
virDomainBlockRebase starting either type of command, and
virDomainBlockJobInfo and virDomainBlockJobAbort working to end
either type; 2) reusing this command allows distros to backport
this feature to the libvirt 0.9.10 API without a .so bump.
Note that a future patch may add a more powerful interface named
virDomainBlockJobCopy, dedicated to just the block copy job, in
order to expose even more options (such as setting an arbitrary
format type for the destination without having to probe it from a
pre-existing destination file); adding a new command for targetting
just block copy would be similar to how we already have
virDomainBlockPull for targetting just the block pull job.
Using a live VM with the backing chain:
base <- snap1 <- snap2
as the starting point, we have:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY)
creates /path/to/copy with the same format as snap2, with no backing
file, so entire chain is copied and flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
creates /path/to/copy as a raw file, so entire chain is copied and
flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
creates /path/to/copy with the same format as snap2, but with snap1 as
a backing file, so only snap2 is copied.
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
reuse existing /path/to/copy (must have empty contents, and format is
probed[*] from the metadata), and copy the full chain
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
reuse existing /path/to/copy (contents must be identical to snap1,
and format is probed[*] from the metadata), and copy only the contents
of snap2
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
reuse existing /path/to/copy (must be raw volume with contents
identical to snap1), and copy only the contents of snap2
Less useful combinations:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
fail if source is not raw, otherwise create /path/to/copy as raw and
the single file is copied (no chain involved)
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
makes little sense: the destination must be raw but have no contents,
meaning that it is an empty file, so there is nothing to reuse
The other three flags are rejected without VIR_DOMAIN_BLOCK_COPY.
[*] Note that probing an existing file for its format can be a security
risk _if_ there is a possibility that the existing file is 'raw', in
which case the guest can manipulate the file to appear like some other
format. But, by virtue of the VIR_DOMAIN_BLOCK_REBASE_COPY_RAW flag,
it is possible to avoid probing of raw files, at which point, probing
of any remaining file type is no longer a security risk.
It would be nice if we could issue an event when pivoting from phase 1
to phase 2, but qemu hasn't implemented that, and we would have to poll
in order to synthesize it ourselves. Meanwhile, qemu will give us a
distinct job info and completion event when we either cancel or pivot
to end the job. Pivoting is accomplished via the new:
virDomainBlockJobAbort(dom, disk, VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)
Management applications can pre-create the copy with a relative
backing file name, and use the VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
flag to have qemu reuse the metadata; if the management application
also copies the backing files to a new location, this can be used
to perform live storage migration of an entire backing chain.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_TYPE_COPY):
New block job type.
(virDomainBlockJobAbortFlags, virDomainBlockRebaseFlags): New enums.
* src/libvirt.c (virDomainBlockRebase): Document the new flags,
and implement general restrictions on flag combinations.
(virDomainBlockJobAbort): Document the new flag.
(virDomainSaveFlags, virDomainSnapshotCreateXML)
(virDomainRevertToSnapshot, virDomainDetachDeviceFlags): Document
restrictions.
* include/libvirt/virterror.h (VIR_ERR_BLOCK_COPY_ACTIVE): New
error.
* src/util/virterror.c (virErrorMsg): Define it.
2012-04-02 17:56:07 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_TYPE_COPY = 2,
|
blockcopy: virDomainBlockCopy with XML destination, typed params
This commit (finally) adds the virDomainBlockCopy API, with the
intent that it will provide more power to the existing 'virsh
blockcopy' command.
'virsh blockcopy' was first added in Apr 2012 (v0.9.12), which
corresponds to the upstream qemu 1.2 timeframe. It was done as
a hack on top of the existing virDomainBlockRebase() API call,
for two reasons: 1) it was targetting a feature that landed first
in downstream RHEL qemu, but had not stabilized in upstream qemu
at the time (and indeed, 'drive-mirror' only landed upstream in
qemu 1.3 with slight differences to the first RHEL attempt,
and later gained further parameters like granularity and buf-size
that are also worth exposing), and 2) extending an existing API
allowed it to be backported without worrying about bumping .so
versions. A virDomainBlockCopy() API was proposed at that time
[1], but we decided not to accept it into libvirt until after
upstream qemu stabilized, and it ended up getting scrapped.
Whether or not RHEL should have attempted adding a new feature
without getting it upstream first is a debate that can be held
another day; but enough time has now elapsed that we are ready to
do the interface cleanly.
[1] https://www.redhat.com/archives/libvir-list/2012-April/msg00768.html
Delaying the creation of a clean API until now has also had a
benefit: we've only recently learned of a few shortcomings in the
original design: 1) it is unable to target a network destination
(such as a gluster volume) because it hard-coded the assumption
that the destination is a local file name. Because of all the
refactoring we've done to add virStorageSourcePtr, we are in a
better position to declare an API that parses XML describing a
host storage source as the copy destination, which was not
possible had we implemented virDomainBlockCopy as it had been
originally envisioned (although a network target will have to wait
until a later libvirt release compared to the API addition to
actually be implemented). 2) the design of using MiB/sec as the
bandwidth throttle is rather coarse; qemu is actually tuned to
bytes/second, and libvirt is preventing access to that level of
detail. A later patch will add flags to existing block job API
that can request bytes/second instead of back-compat MiB/s, but as
this is a new API, we can get it right to begin with.
At least I had the foresight to create 'virsh blockcopy' as a
separate command at the UI level (commit 1f06c00) rather than
leaking the underlying API overload of virDomainBlockRebase onto
shell users.
A further note on the bandwidth option: virTypedParameters
intentionally lacks unsigned long (since variable-width
interaction between mixed 32- vs. 64-bit client/server setups is
nasty), but we have to deal with the fact that we are interacting
with existing older code that mistakenly chose unsigned long
bandwidth at a point before we decided to prohibit it in all new
API. The typed parameter is therefore unsigned long long, but
the implementation (in a later patch) will have to do overflow
detection on 32-bit platforms, as well as capping the value to
match the LLONG_MAX>>20 cap of the existing MiB/s interfaces.
* include/libvirt/libvirt.h.in (virDomainBlockCopy): New API.
(virDomainBlockJobType, virConnectDomainEventBlockJobStatus):
Update related documentation.
* src/libvirt.c (virDomainBlockCopy): Implement it.
* src/libvirt_public.syms (LIBVIRT_1.2.8): Export it.
* src/driver.h (_virDriver): New driver callback.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-26 16:16:48 -05:00
|
|
|
/* Block Copy (virDomainBlockCopy, or virDomainBlockRebase with
|
|
|
|
* flags), job exists as long as mirroring is active */
|
2014-06-14 07:42:41 -05:00
|
|
|
|
blockjob: add virDomainBlockCommit
A block commit moves data in the opposite direction of block pull.
Block pull reduces the chain length by dropping backing files after
data has been pulled into the top overlay, and is always safe; block
commit reduces the chain length by dropping overlays after data has
been committed into the backing file, and any files that depended
on base but not on top are invalidated at any point where they have
unallocated data that is now pointing to changed contents in base.
Both directions are useful, however: a qcow2 layer that is more than
50% allocated will typically be faster with a pull operation, while
a qcow2 layer with less than 50% allocation will be faster as a
commit operation. Committing across multiple layers can be more
efficient than repeatedly committing one layer at a time, but
requires extra support from the hypervisor.
This API matches Jeff Cody's proposed qemu command 'block-commit':
https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html
Jeff's command is still in the works for qemu 1.3, and may gain
further enhancements, such as the ability to control on-error
handling (it will be comparable to the error handling Paolo is
adding to 'drive-mirror', so a similar solution will be needed
when I finally propose virDomainBlockCopy with more functionality
than the basics supported by virDomainBlockRebase). However, even
without qemu support, this API will be useful for _offline_ block
commits, by wrapping qemu-img calls and turning them into a block
job, so this API is worth committing now.
For some examples of how this will be implemented, all starting
with the chain: base <- snap1 <- snap2 <- active
+ These are equivalent:
virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0)
virDomainBlockCommit(dom, disk, NULL, "active", 0, 0)
virDomainBlockCommit(dom, disk, "base", NULL, 0, 0)
virDomainBlockCommit(dom, disk, "base", "active", 0, 0)
but cannot be implemented for online qemu with round 1 of
Jeff's patches; and for offline images, it would require
three back-to-back qemu-img invocations unless qemu-img
is patched to allow more efficient multi-layer commits;
the end result would be 'base' as the active disk with
contents from all three other files, where 'snap1' and
'snap2' are invalid right away, and 'active' is invalid
once any further changes to 'base' are made.
+ These are equivalent:
virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0)
virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW)
they cannot be implemented for online qemu, but for offline,
it is a matter of 'qemu-img commit active', so that 'snap2'
is now the active disk with contents formerly in 'active'.
+ Similarly:
virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE)
for an offline domain will merge 'active' into 'snap2', then
delete 'active' to avoid leaving a potentially invalid file
around.
+ This version:
virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW)
can be implemented online with 'block-commit' passing a base of
snap1 and a top of snap2; and can be implemented offline by
'qemu-img commit snap2' followed by 'qemu-img rebase -u
-b snap1 active'
* include/libvirt/libvirt.h.in (virDomainBlockCommit): New API.
* src/libvirt.c (virDomainBlockCommit): Implement it.
* src/libvirt_public.syms (LIBVIRT_0.10.2): Export it.
* src/driver.h (virDrvDomainBlockCommit): New driver callback.
* docs/apibuild.py (CParser.parseSignature): Add exception.
2012-09-17 12:56:27 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT = 3,
|
2014-06-14 07:42:41 -05:00
|
|
|
/* Block Commit (virDomainBlockCommit without flags), job ends on
|
|
|
|
* completion */
|
|
|
|
|
blockcommit: document semantics of committing active layer
Now that qemu 2.0 allows commit of the active layer, people are
attempting to use virsh blockcommit and getting into a stuck
state, because libvirt is unprepared to handle the two-phase
commit required by qemu.
Stepping back a bit, there are two valid semantics for a
commit operation:
1. Maintain a 'golden' base, and a transient overlay. Make
changes in the overlay, and if everything appears to work,
commit those changes into the base, but still keep the overlay
for the next round of changes; repeat the cycle as desired.
2. Create an external snapshot, then back up the stable state
in the backing file. Once the backup is complete, commit the
overlay back into the base, and delete the temporary snapshot.
Since qemu doesn't know up front which of the two styles is
preferred, a block commit of the active layer merely gets
the job into a synchronized state, and sends an event; then
the user must either cancel (case 1) or complete (case 2),
where qemu then sends a second event that actually ends the
job. However, until commit e6bcbcd, libvirt was blindly
assuming the semantics that apply to a commit of an
intermediate image, where there is only one sane conclusion
(the job automatically ends with fewer elements in the chain);
and getting stuck because it wasn't prepared for qemu to enter
a second phase of the job.
This patch adds a flag to the libvirt API that a user MUST
supply in order to acknowledge that they will be using two-phase
semantics. It might be possible to have a mode where if the
flag is omitted, we automatically do the case 2 semantics on
the user's behalf; but before that happens, I must do additional
patches to track the fact that we are doing an active commit
in the domain XML. Later patches will add support of the flag,
and once 2-phase semantics are working, we can then decide
whether to relax things to allow an omitted flag to cause an
automatic pivot.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)
(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT): New enums.
* src/libvirt.c (virDomainBlockCommit): Document two-phase job
when committing active layer, through new flag.
(virDomainBlockJobAbort): Document that pivot also occurs after
active commit.
* tools/virsh-domain.c (vshDomainBlockJob): Cover new job.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Explicitly
reject active copy; later patches will add it in.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-05-16 14:48:43 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT = 4,
|
2014-06-14 07:42:41 -05:00
|
|
|
/* Active Block Commit (virDomainBlockCommit with flags), job
|
|
|
|
* exists as long as sync is active */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_TYPE_LAST
|
|
|
|
#endif
|
2011-07-22 00:18:06 -05:00
|
|
|
} virDomainBlockJobType;
|
|
|
|
|
blockjob: add API for async virDomainBlockJobAbort
Block job cancellation can take a while. Now that upstream qemu 1.1
has asynchronous block cancellation, we want to expose that to the user.
Therefore, the following updates are made to the virDomainBlockJob API:
A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
libvirt. Regardless of the flags used with virDomainBlockJobAbort, this
event will be raised: 1. when using synchronous block_job_cancel (the
event will be synthesized by libvirt), and 2. whenever it is received
from qemu (via asynchronous block-job-cancel). Note that the event
may be detected by libvirt even before the virDomainBlockJobAbort
completes (always true when it is synthesized, but also possible if
cancellation was fast).
A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
virDomainBlockJobAbort API. When enabled, this function will allow
(but not require) asynchronous operation (ie, it returns as soon as
possible, which might be before the job has actually been canceled).
When the API is used in this mode, it is the responsibility of the
caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
the virDomainGetBlockJobInfo API to check the cancellation status.
This patch also exposes the new flag through virsh, and makes virsh
slightly easier to use (--async implies --abort, and lack of any options
implies --info), although it leaves the qemu implementation for later
patches.
Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-01-13 14:51:23 -06:00
|
|
|
/**
|
|
|
|
* virDomainBlockJobAbortFlags:
|
|
|
|
*
|
|
|
|
* VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC: Request only, do not wait for completion
|
blockcommit: document semantics of committing active layer
Now that qemu 2.0 allows commit of the active layer, people are
attempting to use virsh blockcommit and getting into a stuck
state, because libvirt is unprepared to handle the two-phase
commit required by qemu.
Stepping back a bit, there are two valid semantics for a
commit operation:
1. Maintain a 'golden' base, and a transient overlay. Make
changes in the overlay, and if everything appears to work,
commit those changes into the base, but still keep the overlay
for the next round of changes; repeat the cycle as desired.
2. Create an external snapshot, then back up the stable state
in the backing file. Once the backup is complete, commit the
overlay back into the base, and delete the temporary snapshot.
Since qemu doesn't know up front which of the two styles is
preferred, a block commit of the active layer merely gets
the job into a synchronized state, and sends an event; then
the user must either cancel (case 1) or complete (case 2),
where qemu then sends a second event that actually ends the
job. However, until commit e6bcbcd, libvirt was blindly
assuming the semantics that apply to a commit of an
intermediate image, where there is only one sane conclusion
(the job automatically ends with fewer elements in the chain);
and getting stuck because it wasn't prepared for qemu to enter
a second phase of the job.
This patch adds a flag to the libvirt API that a user MUST
supply in order to acknowledge that they will be using two-phase
semantics. It might be possible to have a mode where if the
flag is omitted, we automatically do the case 2 semantics on
the user's behalf; but before that happens, I must do additional
patches to track the fact that we are doing an active commit
in the domain XML. Later patches will add support of the flag,
and once 2-phase semantics are working, we can then decide
whether to relax things to allow an omitted flag to cause an
automatic pivot.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)
(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT): New enums.
* src/libvirt.c (virDomainBlockCommit): Document two-phase job
when committing active layer, through new flag.
(virDomainBlockJobAbort): Document that pivot also occurs after
active commit.
* tools/virsh-domain.c (vshDomainBlockJob): Cover new job.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Explicitly
reject active copy; later patches will add it in.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-05-16 14:48:43 -05:00
|
|
|
* VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT: Pivot to new file when ending a copy or
|
|
|
|
* active commit job
|
blockjob: add API for async virDomainBlockJobAbort
Block job cancellation can take a while. Now that upstream qemu 1.1
has asynchronous block cancellation, we want to expose that to the user.
Therefore, the following updates are made to the virDomainBlockJob API:
A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
libvirt. Regardless of the flags used with virDomainBlockJobAbort, this
event will be raised: 1. when using synchronous block_job_cancel (the
event will be synthesized by libvirt), and 2. whenever it is received
from qemu (via asynchronous block-job-cancel). Note that the event
may be detected by libvirt even before the virDomainBlockJobAbort
completes (always true when it is synthesized, but also possible if
cancellation was fast).
A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
virDomainBlockJobAbort API. When enabled, this function will allow
(but not require) asynchronous operation (ie, it returns as soon as
possible, which might be before the job has actually been canceled).
When the API is used in this mode, it is the responsibility of the
caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
the virDomainGetBlockJobInfo API to check the cancellation status.
This patch also exposes the new flag through virsh, and makes virsh
slightly easier to use (--async implies --abort, and lack of any options
implies --info), although it leaves the qemu implementation for later
patches.
Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-01-13 14:51:23 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC = 1 << 0,
|
blockjob: add new API flags
This patch introduces a new block job, useful for live storage
migration using pre-copy streaming. Justification for including
this under virDomainBlockRebase rather than adding a new command
includes: 1) there are now two possible block jobs in qemu, with
virDomainBlockRebase starting either type of command, and
virDomainBlockJobInfo and virDomainBlockJobAbort working to end
either type; 2) reusing this command allows distros to backport
this feature to the libvirt 0.9.10 API without a .so bump.
Note that a future patch may add a more powerful interface named
virDomainBlockJobCopy, dedicated to just the block copy job, in
order to expose even more options (such as setting an arbitrary
format type for the destination without having to probe it from a
pre-existing destination file); adding a new command for targetting
just block copy would be similar to how we already have
virDomainBlockPull for targetting just the block pull job.
Using a live VM with the backing chain:
base <- snap1 <- snap2
as the starting point, we have:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY)
creates /path/to/copy with the same format as snap2, with no backing
file, so entire chain is copied and flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
creates /path/to/copy as a raw file, so entire chain is copied and
flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
creates /path/to/copy with the same format as snap2, but with snap1 as
a backing file, so only snap2 is copied.
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
reuse existing /path/to/copy (must have empty contents, and format is
probed[*] from the metadata), and copy the full chain
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
reuse existing /path/to/copy (contents must be identical to snap1,
and format is probed[*] from the metadata), and copy only the contents
of snap2
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
reuse existing /path/to/copy (must be raw volume with contents
identical to snap1), and copy only the contents of snap2
Less useful combinations:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
fail if source is not raw, otherwise create /path/to/copy as raw and
the single file is copied (no chain involved)
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
makes little sense: the destination must be raw but have no contents,
meaning that it is an empty file, so there is nothing to reuse
The other three flags are rejected without VIR_DOMAIN_BLOCK_COPY.
[*] Note that probing an existing file for its format can be a security
risk _if_ there is a possibility that the existing file is 'raw', in
which case the guest can manipulate the file to appear like some other
format. But, by virtue of the VIR_DOMAIN_BLOCK_REBASE_COPY_RAW flag,
it is possible to avoid probing of raw files, at which point, probing
of any remaining file type is no longer a security risk.
It would be nice if we could issue an event when pivoting from phase 1
to phase 2, but qemu hasn't implemented that, and we would have to poll
in order to synthesize it ourselves. Meanwhile, qemu will give us a
distinct job info and completion event when we either cancel or pivot
to end the job. Pivoting is accomplished via the new:
virDomainBlockJobAbort(dom, disk, VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)
Management applications can pre-create the copy with a relative
backing file name, and use the VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
flag to have qemu reuse the metadata; if the management application
also copies the backing files to a new location, this can be used
to perform live storage migration of an entire backing chain.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_TYPE_COPY):
New block job type.
(virDomainBlockJobAbortFlags, virDomainBlockRebaseFlags): New enums.
* src/libvirt.c (virDomainBlockRebase): Document the new flags,
and implement general restrictions on flag combinations.
(virDomainBlockJobAbort): Document the new flag.
(virDomainSaveFlags, virDomainSnapshotCreateXML)
(virDomainRevertToSnapshot, virDomainDetachDeviceFlags): Document
restrictions.
* include/libvirt/virterror.h (VIR_ERR_BLOCK_COPY_ACTIVE): New
error.
* src/util/virterror.c (virErrorMsg): Define it.
2012-04-02 17:56:07 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT = 1 << 1,
|
blockjob: add API for async virDomainBlockJobAbort
Block job cancellation can take a while. Now that upstream qemu 1.1
has asynchronous block cancellation, we want to expose that to the user.
Therefore, the following updates are made to the virDomainBlockJob API:
A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
libvirt. Regardless of the flags used with virDomainBlockJobAbort, this
event will be raised: 1. when using synchronous block_job_cancel (the
event will be synthesized by libvirt), and 2. whenever it is received
from qemu (via asynchronous block-job-cancel). Note that the event
may be detected by libvirt even before the virDomainBlockJobAbort
completes (always true when it is synthesized, but also possible if
cancellation was fast).
A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
virDomainBlockJobAbort API. When enabled, this function will allow
(but not require) asynchronous operation (ie, it returns as soon as
possible, which might be before the job has actually been canceled).
When the API is used in this mode, it is the responsibility of the
caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
the virDomainGetBlockJobInfo API to check the cancellation status.
This patch also exposes the new flag through virsh, and makes virsh
slightly easier to use (--async implies --abort, and lack of any options
implies --info), although it leaves the qemu implementation for later
patches.
Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-01-13 14:51:23 -06:00
|
|
|
} virDomainBlockJobAbortFlags;
|
|
|
|
|
2014-08-27 15:04:36 -05:00
|
|
|
int virDomainBlockJobAbort(virDomainPtr dom, const char *disk,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
/* Flags for use with virDomainGetBlockJobInfo */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES = 1 << 0, /* bandwidth in bytes/s
|
|
|
|
instead of MiB/s */
|
|
|
|
} virDomainBlockJobInfoFlags;
|
|
|
|
|
2011-07-22 00:18:06 -05:00
|
|
|
/* An iterator for monitoring block job operations */
|
|
|
|
typedef unsigned long long virDomainBlockJobCursor;
|
|
|
|
|
|
|
|
typedef struct _virDomainBlockJobInfo virDomainBlockJobInfo;
|
|
|
|
struct _virDomainBlockJobInfo {
|
2014-06-14 07:42:41 -05:00
|
|
|
int type; /* virDomainBlockJobType */
|
2014-08-27 15:04:36 -05:00
|
|
|
unsigned long bandwidth; /* either bytes/s or MiB/s, according to flags */
|
|
|
|
|
2011-07-22 00:18:06 -05:00
|
|
|
/*
|
|
|
|
* The following fields provide an indication of block job progress. @cur
|
|
|
|
* indicates the current position and will be between 0 and @end. @end is
|
|
|
|
* the final cursor position for this operation and represents completion.
|
|
|
|
* To approximate progress, divide @cur by @end.
|
|
|
|
*/
|
|
|
|
virDomainBlockJobCursor cur;
|
|
|
|
virDomainBlockJobCursor end;
|
|
|
|
};
|
|
|
|
typedef virDomainBlockJobInfo *virDomainBlockJobInfoPtr;
|
|
|
|
|
2014-08-27 15:04:36 -05:00
|
|
|
int virDomainGetBlockJobInfo(virDomainPtr dom, const char *disk,
|
|
|
|
virDomainBlockJobInfoPtr info,
|
|
|
|
unsigned int flags);
|
|
|
|
|
blockjob: allow finer bandwidth tuning for set speed
We stupidly modeled block job bandwidth after migration
bandwidth, which in turn was an 'unsigned long' and therefore
subject to 32-bit vs. 64-bit interpretations. To work around
the fact that 10-gigabit interfaces are possible but don't fit
within 32 bits, the original interface took the number scaled
as MiB/sec. But this scaling is rather coarse, and it might
be nice to tune bandwidth finer than in megabyte chunks.
Several of the block job calls that can set speed are fed
through a common interface, so it was easier to adjust them all
at once. Note that there is intentionally no flag for the new
virDomainBlockCopy; there, since the API already uses a 64-bit
type always, instead of a possible 32-bit type, and is brand
new, it was easier to just avoid scaling issues. As with the
previous patch that adjusted the query side (commit db33cc24),
omitting the new flag preserves old behavior, and the
documentation now mentions limits of what happens when a 32-bit
machine is on either client or server side.
* include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
(virDomainBlockPullFlags)
(VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
* src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
(virDomainBlockRebase, virDomainBlockCommit): Document them.
* src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
(qemuDomainBlockPull, qemuDomainBlockRebase)
(qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-30 22:56:19 -05:00
|
|
|
/* Flags for use with virDomainBlockJobSetSpeed */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES = 1 << 0, /* bandwidth in bytes/s
|
|
|
|
instead of MiB/s */
|
|
|
|
} virDomainBlockJobSetSpeedFlags;
|
|
|
|
|
|
|
|
int virDomainBlockJobSetSpeed(virDomainPtr dom, const char *disk,
|
|
|
|
unsigned long bandwidth, unsigned int flags);
|
2011-07-22 00:18:06 -05:00
|
|
|
|
blockjob: allow finer bandwidth tuning for set speed
We stupidly modeled block job bandwidth after migration
bandwidth, which in turn was an 'unsigned long' and therefore
subject to 32-bit vs. 64-bit interpretations. To work around
the fact that 10-gigabit interfaces are possible but don't fit
within 32 bits, the original interface took the number scaled
as MiB/sec. But this scaling is rather coarse, and it might
be nice to tune bandwidth finer than in megabyte chunks.
Several of the block job calls that can set speed are fed
through a common interface, so it was easier to adjust them all
at once. Note that there is intentionally no flag for the new
virDomainBlockCopy; there, since the API already uses a 64-bit
type always, instead of a possible 32-bit type, and is brand
new, it was easier to just avoid scaling issues. As with the
previous patch that adjusted the query side (commit db33cc24),
omitting the new flag preserves old behavior, and the
documentation now mentions limits of what happens when a 32-bit
machine is on either client or server side.
* include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
(virDomainBlockPullFlags)
(VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
* src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
(virDomainBlockRebase, virDomainBlockCommit): Document them.
* src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
(qemuDomainBlockPull, qemuDomainBlockRebase)
(qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-30 22:56:19 -05:00
|
|
|
/* Flags for use with virDomainBlockPull (values chosen to be a subset
|
|
|
|
* of the flags for virDomainBlockRebase) */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES = 1 << 6, /* bandwidth in bytes/s
|
|
|
|
instead of MiB/s */
|
|
|
|
} virDomainBlockPullFlags;
|
|
|
|
|
|
|
|
int virDomainBlockPull(virDomainPtr dom, const char *disk,
|
|
|
|
unsigned long bandwidth, unsigned int flags);
|
blockjob: add new API flags
This patch introduces a new block job, useful for live storage
migration using pre-copy streaming. Justification for including
this under virDomainBlockRebase rather than adding a new command
includes: 1) there are now two possible block jobs in qemu, with
virDomainBlockRebase starting either type of command, and
virDomainBlockJobInfo and virDomainBlockJobAbort working to end
either type; 2) reusing this command allows distros to backport
this feature to the libvirt 0.9.10 API without a .so bump.
Note that a future patch may add a more powerful interface named
virDomainBlockJobCopy, dedicated to just the block copy job, in
order to expose even more options (such as setting an arbitrary
format type for the destination without having to probe it from a
pre-existing destination file); adding a new command for targetting
just block copy would be similar to how we already have
virDomainBlockPull for targetting just the block pull job.
Using a live VM with the backing chain:
base <- snap1 <- snap2
as the starting point, we have:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY)
creates /path/to/copy with the same format as snap2, with no backing
file, so entire chain is copied and flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
creates /path/to/copy as a raw file, so entire chain is copied and
flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
creates /path/to/copy with the same format as snap2, but with snap1 as
a backing file, so only snap2 is copied.
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
reuse existing /path/to/copy (must have empty contents, and format is
probed[*] from the metadata), and copy the full chain
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
reuse existing /path/to/copy (contents must be identical to snap1,
and format is probed[*] from the metadata), and copy only the contents
of snap2
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
reuse existing /path/to/copy (must be raw volume with contents
identical to snap1), and copy only the contents of snap2
Less useful combinations:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
fail if source is not raw, otherwise create /path/to/copy as raw and
the single file is copied (no chain involved)
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
makes little sense: the destination must be raw but have no contents,
meaning that it is an empty file, so there is nothing to reuse
The other three flags are rejected without VIR_DOMAIN_BLOCK_COPY.
[*] Note that probing an existing file for its format can be a security
risk _if_ there is a possibility that the existing file is 'raw', in
which case the guest can manipulate the file to appear like some other
format. But, by virtue of the VIR_DOMAIN_BLOCK_REBASE_COPY_RAW flag,
it is possible to avoid probing of raw files, at which point, probing
of any remaining file type is no longer a security risk.
It would be nice if we could issue an event when pivoting from phase 1
to phase 2, but qemu hasn't implemented that, and we would have to poll
in order to synthesize it ourselves. Meanwhile, qemu will give us a
distinct job info and completion event when we either cancel or pivot
to end the job. Pivoting is accomplished via the new:
virDomainBlockJobAbort(dom, disk, VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)
Management applications can pre-create the copy with a relative
backing file name, and use the VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
flag to have qemu reuse the metadata; if the management application
also copies the backing files to a new location, this can be used
to perform live storage migration of an entire backing chain.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_TYPE_COPY):
New block job type.
(virDomainBlockJobAbortFlags, virDomainBlockRebaseFlags): New enums.
* src/libvirt.c (virDomainBlockRebase): Document the new flags,
and implement general restrictions on flag combinations.
(virDomainBlockJobAbort): Document the new flag.
(virDomainSaveFlags, virDomainSnapshotCreateXML)
(virDomainRevertToSnapshot, virDomainDetachDeviceFlags): Document
restrictions.
* include/libvirt/virterror.h (VIR_ERR_BLOCK_COPY_ACTIVE): New
error.
* src/util/virterror.c (virErrorMsg): Define it.
2012-04-02 17:56:07 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainBlockRebaseFlags:
|
|
|
|
*
|
|
|
|
* Flags available for virDomainBlockRebase().
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW = 1 << 0, /* Limit copy to top of source
|
|
|
|
backing chain */
|
|
|
|
VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT = 1 << 1, /* Reuse existing external
|
|
|
|
file for a copy */
|
|
|
|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW = 1 << 2, /* Make destination file raw */
|
|
|
|
VIR_DOMAIN_BLOCK_REBASE_COPY = 1 << 3, /* Start a copy job */
|
2014-05-16 08:40:06 -05:00
|
|
|
VIR_DOMAIN_BLOCK_REBASE_RELATIVE = 1 << 4, /* Keep backing chain
|
|
|
|
referenced using relative
|
|
|
|
names */
|
2014-08-27 23:03:04 -05:00
|
|
|
VIR_DOMAIN_BLOCK_REBASE_COPY_DEV = 1 << 5, /* Treat destination as block
|
|
|
|
device instead of file */
|
blockjob: allow finer bandwidth tuning for set speed
We stupidly modeled block job bandwidth after migration
bandwidth, which in turn was an 'unsigned long' and therefore
subject to 32-bit vs. 64-bit interpretations. To work around
the fact that 10-gigabit interfaces are possible but don't fit
within 32 bits, the original interface took the number scaled
as MiB/sec. But this scaling is rather coarse, and it might
be nice to tune bandwidth finer than in megabyte chunks.
Several of the block job calls that can set speed are fed
through a common interface, so it was easier to adjust them all
at once. Note that there is intentionally no flag for the new
virDomainBlockCopy; there, since the API already uses a 64-bit
type always, instead of a possible 32-bit type, and is brand
new, it was easier to just avoid scaling issues. As with the
previous patch that adjusted the query side (commit db33cc24),
omitting the new flag preserves old behavior, and the
documentation now mentions limits of what happens when a 32-bit
machine is on either client or server side.
* include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
(virDomainBlockPullFlags)
(VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
* src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
(virDomainBlockRebase, virDomainBlockCommit): Document them.
* src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
(qemuDomainBlockPull, qemuDomainBlockRebase)
(qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-30 22:56:19 -05:00
|
|
|
VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES = 1 << 6, /* bandwidth in bytes/s
|
|
|
|
instead of MiB/s */
|
blockjob: add new API flags
This patch introduces a new block job, useful for live storage
migration using pre-copy streaming. Justification for including
this under virDomainBlockRebase rather than adding a new command
includes: 1) there are now two possible block jobs in qemu, with
virDomainBlockRebase starting either type of command, and
virDomainBlockJobInfo and virDomainBlockJobAbort working to end
either type; 2) reusing this command allows distros to backport
this feature to the libvirt 0.9.10 API without a .so bump.
Note that a future patch may add a more powerful interface named
virDomainBlockJobCopy, dedicated to just the block copy job, in
order to expose even more options (such as setting an arbitrary
format type for the destination without having to probe it from a
pre-existing destination file); adding a new command for targetting
just block copy would be similar to how we already have
virDomainBlockPull for targetting just the block pull job.
Using a live VM with the backing chain:
base <- snap1 <- snap2
as the starting point, we have:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY)
creates /path/to/copy with the same format as snap2, with no backing
file, so entire chain is copied and flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
creates /path/to/copy as a raw file, so entire chain is copied and
flattened
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
creates /path/to/copy with the same format as snap2, but with snap1 as
a backing file, so only snap2 is copied.
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
reuse existing /path/to/copy (must have empty contents, and format is
probed[*] from the metadata), and copy the full chain
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
reuse existing /path/to/copy (contents must be identical to snap1,
and format is probed[*] from the metadata), and copy only the contents
of snap2
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_SHALLOW|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
reuse existing /path/to/copy (must be raw volume with contents
identical to snap1), and copy only the contents of snap2
Less useful combinations:
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
fail if source is not raw, otherwise create /path/to/copy as raw and
the single file is copied (no chain involved)
- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
makes little sense: the destination must be raw but have no contents,
meaning that it is an empty file, so there is nothing to reuse
The other three flags are rejected without VIR_DOMAIN_BLOCK_COPY.
[*] Note that probing an existing file for its format can be a security
risk _if_ there is a possibility that the existing file is 'raw', in
which case the guest can manipulate the file to appear like some other
format. But, by virtue of the VIR_DOMAIN_BLOCK_REBASE_COPY_RAW flag,
it is possible to avoid probing of raw files, at which point, probing
of any remaining file type is no longer a security risk.
It would be nice if we could issue an event when pivoting from phase 1
to phase 2, but qemu hasn't implemented that, and we would have to poll
in order to synthesize it ourselves. Meanwhile, qemu will give us a
distinct job info and completion event when we either cancel or pivot
to end the job. Pivoting is accomplished via the new:
virDomainBlockJobAbort(dom, disk, VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)
Management applications can pre-create the copy with a relative
backing file name, and use the VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
flag to have qemu reuse the metadata; if the management application
also copies the backing files to a new location, this can be used
to perform live storage migration of an entire backing chain.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_TYPE_COPY):
New block job type.
(virDomainBlockJobAbortFlags, virDomainBlockRebaseFlags): New enums.
* src/libvirt.c (virDomainBlockRebase): Document the new flags,
and implement general restrictions on flag combinations.
(virDomainBlockJobAbort): Document the new flag.
(virDomainSaveFlags, virDomainSnapshotCreateXML)
(virDomainRevertToSnapshot, virDomainDetachDeviceFlags): Document
restrictions.
* include/libvirt/virterror.h (VIR_ERR_BLOCK_COPY_ACTIVE): New
error.
* src/util/virterror.c (virErrorMsg): Define it.
2012-04-02 17:56:07 -05:00
|
|
|
} virDomainBlockRebaseFlags;
|
|
|
|
|
blockjob: allow finer bandwidth tuning for set speed
We stupidly modeled block job bandwidth after migration
bandwidth, which in turn was an 'unsigned long' and therefore
subject to 32-bit vs. 64-bit interpretations. To work around
the fact that 10-gigabit interfaces are possible but don't fit
within 32 bits, the original interface took the number scaled
as MiB/sec. But this scaling is rather coarse, and it might
be nice to tune bandwidth finer than in megabyte chunks.
Several of the block job calls that can set speed are fed
through a common interface, so it was easier to adjust them all
at once. Note that there is intentionally no flag for the new
virDomainBlockCopy; there, since the API already uses a 64-bit
type always, instead of a possible 32-bit type, and is brand
new, it was easier to just avoid scaling issues. As with the
previous patch that adjusted the query side (commit db33cc24),
omitting the new flag preserves old behavior, and the
documentation now mentions limits of what happens when a 32-bit
machine is on either client or server side.
* include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
(virDomainBlockPullFlags)
(VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
* src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
(virDomainBlockRebase, virDomainBlockCommit): Document them.
* src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
(qemuDomainBlockPull, qemuDomainBlockRebase)
(qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-30 22:56:19 -05:00
|
|
|
int virDomainBlockRebase(virDomainPtr dom, const char *disk,
|
|
|
|
const char *base, unsigned long bandwidth,
|
|
|
|
unsigned int flags);
|
2011-11-15 03:02:43 -06:00
|
|
|
|
blockcopy: virDomainBlockCopy with XML destination, typed params
This commit (finally) adds the virDomainBlockCopy API, with the
intent that it will provide more power to the existing 'virsh
blockcopy' command.
'virsh blockcopy' was first added in Apr 2012 (v0.9.12), which
corresponds to the upstream qemu 1.2 timeframe. It was done as
a hack on top of the existing virDomainBlockRebase() API call,
for two reasons: 1) it was targetting a feature that landed first
in downstream RHEL qemu, but had not stabilized in upstream qemu
at the time (and indeed, 'drive-mirror' only landed upstream in
qemu 1.3 with slight differences to the first RHEL attempt,
and later gained further parameters like granularity and buf-size
that are also worth exposing), and 2) extending an existing API
allowed it to be backported without worrying about bumping .so
versions. A virDomainBlockCopy() API was proposed at that time
[1], but we decided not to accept it into libvirt until after
upstream qemu stabilized, and it ended up getting scrapped.
Whether or not RHEL should have attempted adding a new feature
without getting it upstream first is a debate that can be held
another day; but enough time has now elapsed that we are ready to
do the interface cleanly.
[1] https://www.redhat.com/archives/libvir-list/2012-April/msg00768.html
Delaying the creation of a clean API until now has also had a
benefit: we've only recently learned of a few shortcomings in the
original design: 1) it is unable to target a network destination
(such as a gluster volume) because it hard-coded the assumption
that the destination is a local file name. Because of all the
refactoring we've done to add virStorageSourcePtr, we are in a
better position to declare an API that parses XML describing a
host storage source as the copy destination, which was not
possible had we implemented virDomainBlockCopy as it had been
originally envisioned (although a network target will have to wait
until a later libvirt release compared to the API addition to
actually be implemented). 2) the design of using MiB/sec as the
bandwidth throttle is rather coarse; qemu is actually tuned to
bytes/second, and libvirt is preventing access to that level of
detail. A later patch will add flags to existing block job API
that can request bytes/second instead of back-compat MiB/s, but as
this is a new API, we can get it right to begin with.
At least I had the foresight to create 'virsh blockcopy' as a
separate command at the UI level (commit 1f06c00) rather than
leaking the underlying API overload of virDomainBlockRebase onto
shell users.
A further note on the bandwidth option: virTypedParameters
intentionally lacks unsigned long (since variable-width
interaction between mixed 32- vs. 64-bit client/server setups is
nasty), but we have to deal with the fact that we are interacting
with existing older code that mistakenly chose unsigned long
bandwidth at a point before we decided to prohibit it in all new
API. The typed parameter is therefore unsigned long long, but
the implementation (in a later patch) will have to do overflow
detection on 32-bit platforms, as well as capping the value to
match the LLONG_MAX>>20 cap of the existing MiB/s interfaces.
* include/libvirt/libvirt.h.in (virDomainBlockCopy): New API.
(virDomainBlockJobType, virConnectDomainEventBlockJobStatus):
Update related documentation.
* src/libvirt.c (virDomainBlockCopy): Implement it.
* src/libvirt_public.syms (LIBVIRT_1.2.8): Export it.
* src/driver.h (_virDriver): New driver callback.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-26 16:16:48 -05:00
|
|
|
/**
|
|
|
|
* virDomainBlockCopyFlags:
|
|
|
|
*
|
|
|
|
* Flags available for virDomainBlockCopy().
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_COPY_SHALLOW = 1 << 0, /* Limit copy to top of source
|
|
|
|
backing chain */
|
|
|
|
VIR_DOMAIN_BLOCK_COPY_REUSE_EXT = 1 << 1, /* Reuse existing external
|
|
|
|
file for a copy */
|
|
|
|
} virDomainBlockCopyFlags;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_COPY_BANDWIDTH:
|
|
|
|
* Macro for the virDomainBlockCopy bandwidth tunable: it represents
|
|
|
|
* the maximum bandwidth in bytes/s, and is used while getting the
|
|
|
|
* copy operation into the mirrored phase, with a type of ullong. For
|
|
|
|
* compatibility with virDomainBlockJobSetSpeed(), values larger than
|
2014-08-27 15:04:36 -05:00
|
|
|
* 2^52 bytes/sec (a 32-bit MiB/s value) may be rejected on input due
|
|
|
|
* to overflow considerations (but do you really have an interface
|
|
|
|
* with that much bandwidth?), and values larger than 2^31 bytes/sec
|
|
|
|
* may cause overflow problems if queried in bytes/sec. Hypervisors
|
|
|
|
* may further restrict the set of valid values. Specifying 0 is the
|
|
|
|
* same as omitting this parameter, to request no bandwidth limiting.
|
|
|
|
* Some hypervisors may lack support for this parameter, while still
|
|
|
|
* allowing a subsequent change of bandwidth via
|
|
|
|
* virDomainBlockJobSetSpeed(). The actual speed can be determined
|
|
|
|
* with virDomainGetBlockJobInfo().
|
blockcopy: virDomainBlockCopy with XML destination, typed params
This commit (finally) adds the virDomainBlockCopy API, with the
intent that it will provide more power to the existing 'virsh
blockcopy' command.
'virsh blockcopy' was first added in Apr 2012 (v0.9.12), which
corresponds to the upstream qemu 1.2 timeframe. It was done as
a hack on top of the existing virDomainBlockRebase() API call,
for two reasons: 1) it was targetting a feature that landed first
in downstream RHEL qemu, but had not stabilized in upstream qemu
at the time (and indeed, 'drive-mirror' only landed upstream in
qemu 1.3 with slight differences to the first RHEL attempt,
and later gained further parameters like granularity and buf-size
that are also worth exposing), and 2) extending an existing API
allowed it to be backported without worrying about bumping .so
versions. A virDomainBlockCopy() API was proposed at that time
[1], but we decided not to accept it into libvirt until after
upstream qemu stabilized, and it ended up getting scrapped.
Whether or not RHEL should have attempted adding a new feature
without getting it upstream first is a debate that can be held
another day; but enough time has now elapsed that we are ready to
do the interface cleanly.
[1] https://www.redhat.com/archives/libvir-list/2012-April/msg00768.html
Delaying the creation of a clean API until now has also had a
benefit: we've only recently learned of a few shortcomings in the
original design: 1) it is unable to target a network destination
(such as a gluster volume) because it hard-coded the assumption
that the destination is a local file name. Because of all the
refactoring we've done to add virStorageSourcePtr, we are in a
better position to declare an API that parses XML describing a
host storage source as the copy destination, which was not
possible had we implemented virDomainBlockCopy as it had been
originally envisioned (although a network target will have to wait
until a later libvirt release compared to the API addition to
actually be implemented). 2) the design of using MiB/sec as the
bandwidth throttle is rather coarse; qemu is actually tuned to
bytes/second, and libvirt is preventing access to that level of
detail. A later patch will add flags to existing block job API
that can request bytes/second instead of back-compat MiB/s, but as
this is a new API, we can get it right to begin with.
At least I had the foresight to create 'virsh blockcopy' as a
separate command at the UI level (commit 1f06c00) rather than
leaking the underlying API overload of virDomainBlockRebase onto
shell users.
A further note on the bandwidth option: virTypedParameters
intentionally lacks unsigned long (since variable-width
interaction between mixed 32- vs. 64-bit client/server setups is
nasty), but we have to deal with the fact that we are interacting
with existing older code that mistakenly chose unsigned long
bandwidth at a point before we decided to prohibit it in all new
API. The typed parameter is therefore unsigned long long, but
the implementation (in a later patch) will have to do overflow
detection on 32-bit platforms, as well as capping the value to
match the LLONG_MAX>>20 cap of the existing MiB/s interfaces.
* include/libvirt/libvirt.h.in (virDomainBlockCopy): New API.
(virDomainBlockJobType, virConnectDomainEventBlockJobStatus):
Update related documentation.
* src/libvirt.c (virDomainBlockCopy): Implement it.
* src/libvirt_public.syms (LIBVIRT_1.2.8): Export it.
* src/driver.h (_virDriver): New driver callback.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-26 16:16:48 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_COPY_BANDWIDTH "bandwidth"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_COPY_GRANULARITY:
|
|
|
|
* Macro for the virDomainBlockCopy granularity tunable: it represents
|
|
|
|
* the granularity in bytes at which the copy operation recognizes
|
|
|
|
* dirty blocks that need copying, as an unsigned int. Hypervisors may
|
|
|
|
* restrict this to be a power of two or fall within a certain
|
|
|
|
* range. Specifying 0 is the same as omitting this parameter, to
|
|
|
|
* request the hypervisor default.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_COPY_GRANULARITY "granularity"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_COPY_BUF_SIZE:
|
|
|
|
* Macro for the virDomainBlockCopy buffer size tunable: it represents
|
|
|
|
* how much data in bytes can be in flight between source and destination,
|
2014-08-30 23:02:19 -05:00
|
|
|
* as an unsigned long long. Specifying 0 is the same as omitting this
|
|
|
|
* parameter, to request the hypervisor default.
|
blockcopy: virDomainBlockCopy with XML destination, typed params
This commit (finally) adds the virDomainBlockCopy API, with the
intent that it will provide more power to the existing 'virsh
blockcopy' command.
'virsh blockcopy' was first added in Apr 2012 (v0.9.12), which
corresponds to the upstream qemu 1.2 timeframe. It was done as
a hack on top of the existing virDomainBlockRebase() API call,
for two reasons: 1) it was targetting a feature that landed first
in downstream RHEL qemu, but had not stabilized in upstream qemu
at the time (and indeed, 'drive-mirror' only landed upstream in
qemu 1.3 with slight differences to the first RHEL attempt,
and later gained further parameters like granularity and buf-size
that are also worth exposing), and 2) extending an existing API
allowed it to be backported without worrying about bumping .so
versions. A virDomainBlockCopy() API was proposed at that time
[1], but we decided not to accept it into libvirt until after
upstream qemu stabilized, and it ended up getting scrapped.
Whether or not RHEL should have attempted adding a new feature
without getting it upstream first is a debate that can be held
another day; but enough time has now elapsed that we are ready to
do the interface cleanly.
[1] https://www.redhat.com/archives/libvir-list/2012-April/msg00768.html
Delaying the creation of a clean API until now has also had a
benefit: we've only recently learned of a few shortcomings in the
original design: 1) it is unable to target a network destination
(such as a gluster volume) because it hard-coded the assumption
that the destination is a local file name. Because of all the
refactoring we've done to add virStorageSourcePtr, we are in a
better position to declare an API that parses XML describing a
host storage source as the copy destination, which was not
possible had we implemented virDomainBlockCopy as it had been
originally envisioned (although a network target will have to wait
until a later libvirt release compared to the API addition to
actually be implemented). 2) the design of using MiB/sec as the
bandwidth throttle is rather coarse; qemu is actually tuned to
bytes/second, and libvirt is preventing access to that level of
detail. A later patch will add flags to existing block job API
that can request bytes/second instead of back-compat MiB/s, but as
this is a new API, we can get it right to begin with.
At least I had the foresight to create 'virsh blockcopy' as a
separate command at the UI level (commit 1f06c00) rather than
leaking the underlying API overload of virDomainBlockRebase onto
shell users.
A further note on the bandwidth option: virTypedParameters
intentionally lacks unsigned long (since variable-width
interaction between mixed 32- vs. 64-bit client/server setups is
nasty), but we have to deal with the fact that we are interacting
with existing older code that mistakenly chose unsigned long
bandwidth at a point before we decided to prohibit it in all new
API. The typed parameter is therefore unsigned long long, but
the implementation (in a later patch) will have to do overflow
detection on 32-bit platforms, as well as capping the value to
match the LLONG_MAX>>20 cap of the existing MiB/s interfaces.
* include/libvirt/libvirt.h.in (virDomainBlockCopy): New API.
(virDomainBlockJobType, virConnectDomainEventBlockJobStatus):
Update related documentation.
* src/libvirt.c (virDomainBlockCopy): Implement it.
* src/libvirt_public.syms (LIBVIRT_1.2.8): Export it.
* src/driver.h (_virDriver): New driver callback.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-26 16:16:48 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_COPY_BUF_SIZE "buf-size"
|
|
|
|
|
|
|
|
int virDomainBlockCopy(virDomainPtr dom, const char *disk,
|
|
|
|
const char *destxml,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
blockjob: add virDomainBlockCommit
A block commit moves data in the opposite direction of block pull.
Block pull reduces the chain length by dropping backing files after
data has been pulled into the top overlay, and is always safe; block
commit reduces the chain length by dropping overlays after data has
been committed into the backing file, and any files that depended
on base but not on top are invalidated at any point where they have
unallocated data that is now pointing to changed contents in base.
Both directions are useful, however: a qcow2 layer that is more than
50% allocated will typically be faster with a pull operation, while
a qcow2 layer with less than 50% allocation will be faster as a
commit operation. Committing across multiple layers can be more
efficient than repeatedly committing one layer at a time, but
requires extra support from the hypervisor.
This API matches Jeff Cody's proposed qemu command 'block-commit':
https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html
Jeff's command is still in the works for qemu 1.3, and may gain
further enhancements, such as the ability to control on-error
handling (it will be comparable to the error handling Paolo is
adding to 'drive-mirror', so a similar solution will be needed
when I finally propose virDomainBlockCopy with more functionality
than the basics supported by virDomainBlockRebase). However, even
without qemu support, this API will be useful for _offline_ block
commits, by wrapping qemu-img calls and turning them into a block
job, so this API is worth committing now.
For some examples of how this will be implemented, all starting
with the chain: base <- snap1 <- snap2 <- active
+ These are equivalent:
virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0)
virDomainBlockCommit(dom, disk, NULL, "active", 0, 0)
virDomainBlockCommit(dom, disk, "base", NULL, 0, 0)
virDomainBlockCommit(dom, disk, "base", "active", 0, 0)
but cannot be implemented for online qemu with round 1 of
Jeff's patches; and for offline images, it would require
three back-to-back qemu-img invocations unless qemu-img
is patched to allow more efficient multi-layer commits;
the end result would be 'base' as the active disk with
contents from all three other files, where 'snap1' and
'snap2' are invalid right away, and 'active' is invalid
once any further changes to 'base' are made.
+ These are equivalent:
virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0)
virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW)
they cannot be implemented for online qemu, but for offline,
it is a matter of 'qemu-img commit active', so that 'snap2'
is now the active disk with contents formerly in 'active'.
+ Similarly:
virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE)
for an offline domain will merge 'active' into 'snap2', then
delete 'active' to avoid leaving a potentially invalid file
around.
+ This version:
virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW)
can be implemented online with 'block-commit' passing a base of
snap1 and a top of snap2; and can be implemented offline by
'qemu-img commit snap2' followed by 'qemu-img rebase -u
-b snap1 active'
* include/libvirt/libvirt.h.in (virDomainBlockCommit): New API.
* src/libvirt.c (virDomainBlockCommit): Implement it.
* src/libvirt_public.syms (LIBVIRT_0.10.2): Export it.
* src/driver.h (virDrvDomainBlockCommit): New driver callback.
* docs/apibuild.py (CParser.parseSignature): Add exception.
2012-09-17 12:56:27 -05:00
|
|
|
/**
|
|
|
|
* virDomainBlockCommitFlags:
|
|
|
|
*
|
|
|
|
* Flags available for virDomainBlockCommit().
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_COMMIT_SHALLOW = 1 << 0, /* NULL base means next backing
|
|
|
|
file, not whole chain */
|
|
|
|
VIR_DOMAIN_BLOCK_COMMIT_DELETE = 1 << 1, /* Delete any files that are now
|
|
|
|
invalid after their contents
|
|
|
|
have been committed */
|
blockcommit: document semantics of committing active layer
Now that qemu 2.0 allows commit of the active layer, people are
attempting to use virsh blockcommit and getting into a stuck
state, because libvirt is unprepared to handle the two-phase
commit required by qemu.
Stepping back a bit, there are two valid semantics for a
commit operation:
1. Maintain a 'golden' base, and a transient overlay. Make
changes in the overlay, and if everything appears to work,
commit those changes into the base, but still keep the overlay
for the next round of changes; repeat the cycle as desired.
2. Create an external snapshot, then back up the stable state
in the backing file. Once the backup is complete, commit the
overlay back into the base, and delete the temporary snapshot.
Since qemu doesn't know up front which of the two styles is
preferred, a block commit of the active layer merely gets
the job into a synchronized state, and sends an event; then
the user must either cancel (case 1) or complete (case 2),
where qemu then sends a second event that actually ends the
job. However, until commit e6bcbcd, libvirt was blindly
assuming the semantics that apply to a commit of an
intermediate image, where there is only one sane conclusion
(the job automatically ends with fewer elements in the chain);
and getting stuck because it wasn't prepared for qemu to enter
a second phase of the job.
This patch adds a flag to the libvirt API that a user MUST
supply in order to acknowledge that they will be using two-phase
semantics. It might be possible to have a mode where if the
flag is omitted, we automatically do the case 2 semantics on
the user's behalf; but before that happens, I must do additional
patches to track the fact that we are doing an active commit
in the domain XML. Later patches will add support of the flag,
and once 2-phase semantics are working, we can then decide
whether to relax things to allow an omitted flag to cause an
automatic pivot.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)
(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT): New enums.
* src/libvirt.c (virDomainBlockCommit): Document two-phase job
when committing active layer, through new flag.
(virDomainBlockJobAbort): Document that pivot also occurs after
active commit.
* tools/virsh-domain.c (vshDomainBlockJob): Cover new job.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Explicitly
reject active copy; later patches will add it in.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-05-16 14:48:43 -05:00
|
|
|
VIR_DOMAIN_BLOCK_COMMIT_ACTIVE = 1 << 2, /* Allow a two-phase commit when
|
|
|
|
top is the active layer */
|
2014-05-13 10:59:32 -05:00
|
|
|
VIR_DOMAIN_BLOCK_COMMIT_RELATIVE = 1 << 3, /* keep the backing chain
|
|
|
|
referenced using relative
|
|
|
|
names */
|
blockjob: allow finer bandwidth tuning for set speed
We stupidly modeled block job bandwidth after migration
bandwidth, which in turn was an 'unsigned long' and therefore
subject to 32-bit vs. 64-bit interpretations. To work around
the fact that 10-gigabit interfaces are possible but don't fit
within 32 bits, the original interface took the number scaled
as MiB/sec. But this scaling is rather coarse, and it might
be nice to tune bandwidth finer than in megabyte chunks.
Several of the block job calls that can set speed are fed
through a common interface, so it was easier to adjust them all
at once. Note that there is intentionally no flag for the new
virDomainBlockCopy; there, since the API already uses a 64-bit
type always, instead of a possible 32-bit type, and is brand
new, it was easier to just avoid scaling issues. As with the
previous patch that adjusted the query side (commit db33cc24),
omitting the new flag preserves old behavior, and the
documentation now mentions limits of what happens when a 32-bit
machine is on either client or server side.
* include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
(virDomainBlockPullFlags)
(VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
* src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
(virDomainBlockRebase, virDomainBlockCommit): Document them.
* src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
(qemuDomainBlockPull, qemuDomainBlockRebase)
(qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-30 22:56:19 -05:00
|
|
|
VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES = 1 << 4, /* bandwidth in bytes/s
|
|
|
|
instead of MiB/s */
|
blockjob: add virDomainBlockCommit
A block commit moves data in the opposite direction of block pull.
Block pull reduces the chain length by dropping backing files after
data has been pulled into the top overlay, and is always safe; block
commit reduces the chain length by dropping overlays after data has
been committed into the backing file, and any files that depended
on base but not on top are invalidated at any point where they have
unallocated data that is now pointing to changed contents in base.
Both directions are useful, however: a qcow2 layer that is more than
50% allocated will typically be faster with a pull operation, while
a qcow2 layer with less than 50% allocation will be faster as a
commit operation. Committing across multiple layers can be more
efficient than repeatedly committing one layer at a time, but
requires extra support from the hypervisor.
This API matches Jeff Cody's proposed qemu command 'block-commit':
https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html
Jeff's command is still in the works for qemu 1.3, and may gain
further enhancements, such as the ability to control on-error
handling (it will be comparable to the error handling Paolo is
adding to 'drive-mirror', so a similar solution will be needed
when I finally propose virDomainBlockCopy with more functionality
than the basics supported by virDomainBlockRebase). However, even
without qemu support, this API will be useful for _offline_ block
commits, by wrapping qemu-img calls and turning them into a block
job, so this API is worth committing now.
For some examples of how this will be implemented, all starting
with the chain: base <- snap1 <- snap2 <- active
+ These are equivalent:
virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0)
virDomainBlockCommit(dom, disk, NULL, "active", 0, 0)
virDomainBlockCommit(dom, disk, "base", NULL, 0, 0)
virDomainBlockCommit(dom, disk, "base", "active", 0, 0)
but cannot be implemented for online qemu with round 1 of
Jeff's patches; and for offline images, it would require
three back-to-back qemu-img invocations unless qemu-img
is patched to allow more efficient multi-layer commits;
the end result would be 'base' as the active disk with
contents from all three other files, where 'snap1' and
'snap2' are invalid right away, and 'active' is invalid
once any further changes to 'base' are made.
+ These are equivalent:
virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0)
virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW)
they cannot be implemented for online qemu, but for offline,
it is a matter of 'qemu-img commit active', so that 'snap2'
is now the active disk with contents formerly in 'active'.
+ Similarly:
virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE)
for an offline domain will merge 'active' into 'snap2', then
delete 'active' to avoid leaving a potentially invalid file
around.
+ This version:
virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW)
can be implemented online with 'block-commit' passing a base of
snap1 and a top of snap2; and can be implemented offline by
'qemu-img commit snap2' followed by 'qemu-img rebase -u
-b snap1 active'
* include/libvirt/libvirt.h.in (virDomainBlockCommit): New API.
* src/libvirt.c (virDomainBlockCommit): Implement it.
* src/libvirt_public.syms (LIBVIRT_0.10.2): Export it.
* src/driver.h (virDrvDomainBlockCommit): New driver callback.
* docs/apibuild.py (CParser.parseSignature): Add exception.
2012-09-17 12:56:27 -05:00
|
|
|
} virDomainBlockCommitFlags;
|
|
|
|
|
|
|
|
int virDomainBlockCommit(virDomainPtr dom, const char *disk, const char *base,
|
|
|
|
const char *top, unsigned long bandwidth,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-11-15 03:02:43 -06:00
|
|
|
|
|
|
|
/* Block I/O throttling support */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC:
|
|
|
|
*
|
|
|
|
* Macro for the BlockIoTune tunable weight: it represents the total
|
|
|
|
* bytes per second permitted through a block device, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC "total_bytes_sec"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC:
|
|
|
|
*
|
2013-11-11 03:53:17 -06:00
|
|
|
* Macro for the BlockIoTune tunable weight: it represents the read
|
2011-11-15 03:02:43 -06:00
|
|
|
* bytes per second permitted through a block device, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC "read_bytes_sec"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC:
|
|
|
|
*
|
2013-11-11 03:53:17 -06:00
|
|
|
* Macro for the BlockIoTune tunable weight: it represents the write
|
2011-11-15 03:02:43 -06:00
|
|
|
* bytes per second permitted through a block device, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC "write_bytes_sec"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC:
|
|
|
|
*
|
2013-11-11 03:53:17 -06:00
|
|
|
* Macro for the BlockIoTune tunable weight: it represents the total
|
2011-11-15 03:02:43 -06:00
|
|
|
* I/O operations per second permitted through a block device, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC "total_iops_sec"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC:
|
|
|
|
*
|
2013-11-11 03:53:17 -06:00
|
|
|
* Macro for the BlockIoTune tunable weight: it represents the read
|
2011-11-15 03:02:43 -06:00
|
|
|
* I/O operations per second permitted through a block device, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC "read_iops_sec"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC:
|
2013-11-11 03:53:17 -06:00
|
|
|
* Macro for the BlockIoTune tunable weight: it represents the write
|
2011-11-15 03:02:43 -06:00
|
|
|
* I/O operations per second permitted through a block device, as a ullong.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC "write_iops_sec"
|
|
|
|
|
|
|
|
int
|
|
|
|
virDomainSetBlockIoTune(virDomainPtr dom,
|
|
|
|
const char *disk,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
int
|
|
|
|
virDomainGetBlockIoTune(virDomainPtr dom,
|
|
|
|
const char *disk,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
2012-01-31 00:41:53 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainDiskErrorCode:
|
|
|
|
*
|
|
|
|
* Disk I/O error.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DISK_ERROR_NONE = 0, /* no error */
|
|
|
|
VIR_DOMAIN_DISK_ERROR_UNSPEC = 1, /* unspecified I/O error */
|
|
|
|
VIR_DOMAIN_DISK_ERROR_NO_SPACE = 2, /* no space left on the device */
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_DISK_ERROR_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainDiskErrorCode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainDiskError:
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct _virDomainDiskError virDomainDiskError;
|
|
|
|
typedef virDomainDiskError *virDomainDiskErrorPtr;
|
|
|
|
|
|
|
|
struct _virDomainDiskError {
|
|
|
|
char *disk; /* disk target */
|
|
|
|
int error; /* virDomainDiskErrorCode */
|
|
|
|
};
|
|
|
|
|
|
|
|
int virDomainGetDiskErrors(virDomainPtr dom,
|
|
|
|
virDomainDiskErrorPtr errors,
|
|
|
|
unsigned int maxerrors,
|
|
|
|
unsigned int flags);
|
2011-07-22 00:18:06 -05:00
|
|
|
|
|
|
|
|
2007-09-28 09:28:12 -05:00
|
|
|
/*
|
|
|
|
* NUMA support
|
|
|
|
*/
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virNodeGetCellsFreeMemory(virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned long long *freeMems,
|
|
|
|
int startCell,
|
|
|
|
int maxCells);
|
2007-09-28 09:28:12 -05:00
|
|
|
|
2007-02-23 02:51:30 -06:00
|
|
|
|
2011-05-05 04:21:41 -05:00
|
|
|
|
2008-02-20 08:57:39 -06:00
|
|
|
/**
|
|
|
|
* virStoragePool:
|
|
|
|
*
|
|
|
|
* a virStoragePool is a private structure representing a storage pool
|
|
|
|
*/
|
|
|
|
typedef struct _virStoragePool virStoragePool;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStoragePoolPtr:
|
|
|
|
*
|
|
|
|
* a virStoragePoolPtr is pointer to a virStoragePool private structure, this is the
|
|
|
|
* type used to reference a storage pool in the API.
|
|
|
|
*/
|
|
|
|
typedef virStoragePool *virStoragePoolPtr;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2012-01-20 12:43:28 -06:00
|
|
|
VIR_STORAGE_POOL_INACTIVE = 0, /* Not running */
|
|
|
|
VIR_STORAGE_POOL_BUILDING = 1, /* Initializing pool, not available */
|
|
|
|
VIR_STORAGE_POOL_RUNNING = 2, /* Running normally */
|
|
|
|
VIR_STORAGE_POOL_DEGRADED = 3, /* Running degraded */
|
|
|
|
VIR_STORAGE_POOL_INACCESSIBLE = 4, /* Running, but not accessible */
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_STORAGE_POOL_STATE_LAST
|
|
|
|
#endif
|
2008-02-20 08:57:39 -06:00
|
|
|
} virStoragePoolState;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2012-01-20 12:43:28 -06:00
|
|
|
VIR_STORAGE_POOL_BUILD_NEW = 0, /* Regular build from scratch */
|
|
|
|
VIR_STORAGE_POOL_BUILD_REPAIR = (1 << 0), /* Repair / reinitialize */
|
|
|
|
VIR_STORAGE_POOL_BUILD_RESIZE = (1 << 1), /* Extend existing pool */
|
|
|
|
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE = (1 << 2), /* Do not overwrite existing pool */
|
|
|
|
VIR_STORAGE_POOL_BUILD_OVERWRITE = (1 << 3), /* Overwrite data */
|
2008-02-20 08:57:39 -06:00
|
|
|
} virStoragePoolBuildFlags;
|
|
|
|
|
|
|
|
typedef enum {
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_POOL_DELETE_NORMAL = 0, /* Delete metadata only (fast) */
|
|
|
|
VIR_STORAGE_POOL_DELETE_ZEROED = 1 << 0, /* Clear all data to zeros (slow) */
|
2008-02-20 08:57:39 -06:00
|
|
|
} virStoragePoolDeleteFlags;
|
|
|
|
|
|
|
|
typedef struct _virStoragePoolInfo virStoragePoolInfo;
|
|
|
|
|
|
|
|
struct _virStoragePoolInfo {
|
2012-07-11 09:27:38 -05:00
|
|
|
int state; /* virStoragePoolState flags */
|
|
|
|
unsigned long long capacity; /* Logical size bytes */
|
|
|
|
unsigned long long allocation; /* Current allocation bytes */
|
|
|
|
unsigned long long available; /* Remaining free space bytes */
|
2008-02-20 08:57:39 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef virStoragePoolInfo *virStoragePoolInfoPtr;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStorageVol:
|
|
|
|
*
|
|
|
|
* a virStorageVol is a private structure representing a storage volume
|
|
|
|
*/
|
|
|
|
typedef struct _virStorageVol virStorageVol;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStorageVolPtr:
|
|
|
|
*
|
|
|
|
* a virStorageVolPtr is pointer to a virStorageVol private structure, this is the
|
|
|
|
* type used to reference a storage volume in the API.
|
|
|
|
*/
|
|
|
|
typedef virStorageVol *virStorageVolPtr;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_FILE = 0, /* Regular file based volumes */
|
|
|
|
VIR_STORAGE_VOL_BLOCK = 1, /* Block based volumes */
|
|
|
|
VIR_STORAGE_VOL_DIR = 2, /* Directory-passthrough based volume */
|
|
|
|
VIR_STORAGE_VOL_NETWORK = 3, /* Network volumes like RBD (RADOS Block Device) */
|
2013-11-18 17:43:06 -06:00
|
|
|
VIR_STORAGE_VOL_NETDIR = 4, /* Network accessible directory that can
|
|
|
|
* contain other network volumes */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_STORAGE_VOL_LAST
|
|
|
|
#endif
|
2008-02-20 08:57:39 -06:00
|
|
|
} virStorageVolType;
|
|
|
|
|
|
|
|
typedef enum {
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_DELETE_NORMAL = 0, /* Delete metadata only (fast) */
|
|
|
|
VIR_STORAGE_VOL_DELETE_ZEROED = 1 << 0, /* Clear all data to zeros (slow) */
|
2008-02-20 08:57:39 -06:00
|
|
|
} virStorageVolDeleteFlags;
|
|
|
|
|
2012-01-09 10:05:03 -06:00
|
|
|
typedef enum {
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_ZERO = 0, /* 1-pass, all zeroes */
|
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_NNSA = 1, /* 4-pass NNSA Policy Letter
|
2013-01-10 06:49:09 -06:00
|
|
|
NAP-14.1-C (XVI-8) */
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_DOD = 2, /* 4-pass DoD 5220.22-M section
|
2013-01-10 06:49:09 -06:00
|
|
|
8-306 procedure */
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_BSI = 3, /* 9-pass method recommended by the
|
2013-01-10 06:49:09 -06:00
|
|
|
German Center of Security in
|
|
|
|
Information Technologies */
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_GUTMANN = 4, /* The canonical 35-pass sequence */
|
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER = 5, /* 7-pass method described by
|
2013-01-10 06:49:09 -06:00
|
|
|
Bruce Schneier in "Applied
|
|
|
|
Cryptography" (1996) */
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7 = 6, /* 7-pass random */
|
2012-01-09 10:05:03 -06:00
|
|
|
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33 = 7, /* 33-pass random */
|
2012-01-09 10:05:03 -06:00
|
|
|
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_RANDOM = 8, /* 1-pass random */
|
2012-01-09 10:05:03 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_STORAGE_VOL_WIPE_ALG_LAST
|
2012-07-11 09:27:38 -05:00
|
|
|
/*
|
|
|
|
* NB: this enum value will increase over time as new algorithms are
|
|
|
|
* added to the libvirt API. It reflects the last algorithm supported
|
|
|
|
* by this version of the libvirt API.
|
|
|
|
*/
|
2012-01-09 10:05:03 -06:00
|
|
|
#endif
|
|
|
|
} virStorageVolWipeAlgorithm;
|
|
|
|
|
2008-02-20 08:57:39 -06:00
|
|
|
typedef struct _virStorageVolInfo virStorageVolInfo;
|
|
|
|
|
|
|
|
struct _virStorageVolInfo {
|
2012-07-11 09:27:38 -05:00
|
|
|
int type; /* virStorageVolType flags */
|
|
|
|
unsigned long long capacity; /* Logical size bytes */
|
|
|
|
unsigned long long allocation; /* Current allocation bytes */
|
2008-02-20 08:57:39 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef virStorageVolInfo *virStorageVolInfoPtr;
|
|
|
|
|
2012-06-25 05:24:45 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_STORAGE_XML_INACTIVE = (1 << 0), /* dump inactive pool/volume information */
|
|
|
|
} virStorageXMLFlags;
|
|
|
|
|
2008-02-20 08:57:39 -06:00
|
|
|
/*
|
|
|
|
* Get connection from pool.
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* List active storage pools
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virConnectNumOfStoragePools (virConnectPtr conn);
|
|
|
|
int virConnectListStoragePools (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* List inactive storage pools
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virConnectNumOfDefinedStoragePools(virConnectPtr conn);
|
|
|
|
int virConnectListDefinedStoragePools(virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
2012-09-04 10:16:24 -05:00
|
|
|
/*
|
|
|
|
* virConnectListAllStoragePoolsFlags:
|
|
|
|
*
|
|
|
|
* Flags used to tune pools returned by virConnectListAllStoragePools().
|
|
|
|
* Note that these flags come in groups; if all bits from a group are 0,
|
|
|
|
* then that group is not used to filter results.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE = 1 << 0,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE = 1 << 1,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT = 1 << 2,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT = 1 << 3,
|
|
|
|
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART = 1 << 4,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART = 1 << 5,
|
|
|
|
|
|
|
|
/* List pools by type */
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_DIR = 1 << 6,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_FS = 1 << 7,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_NETFS = 1 << 8,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_LOGICAL = 1 << 9,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_DISK = 1 << 10,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI = 1 << 11,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_SCSI = 1 << 12,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_MPATH = 1 << 13,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_RBD = 1 << 14,
|
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG = 1 << 15,
|
2013-12-13 03:31:50 -06:00
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER = 1 << 16,
|
2014-07-21 09:38:42 -05:00
|
|
|
VIR_CONNECT_LIST_STORAGE_POOLS_ZFS = 1 << 17,
|
2012-09-04 10:16:24 -05:00
|
|
|
} virConnectListAllStoragePoolsFlags;
|
|
|
|
|
|
|
|
int virConnectListAllStoragePools(virConnectPtr conn,
|
|
|
|
virStoragePoolPtr **pools,
|
|
|
|
unsigned int flags);
|
2008-08-27 15:05:58 -05:00
|
|
|
/*
|
|
|
|
* Query a host for storage pools of a particular type
|
|
|
|
*/
|
|
|
|
char * virConnectFindStoragePoolSources(virConnectPtr conn,
|
|
|
|
const char *type,
|
|
|
|
const char *srcSpec,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2008-02-20 08:57:39 -06:00
|
|
|
/*
|
|
|
|
* Lookup pool by name or uuid
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *name);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const unsigned char *uuid);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStoragePoolPtr virStoragePoolLookupByUUIDString(virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *uuid);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Creating/destroying pools
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolBuild (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolUndefine (virStoragePoolPtr pool);
|
|
|
|
int virStoragePoolCreate (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolDestroy (virStoragePoolPtr pool);
|
|
|
|
int virStoragePoolDelete (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
2009-01-20 06:14:03 -06:00
|
|
|
int virStoragePoolRef (virStoragePoolPtr pool);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolFree (virStoragePoolPtr pool);
|
|
|
|
int virStoragePoolRefresh (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* StoragePool information
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
const char* virStoragePoolGetName (virStoragePoolPtr pool);
|
|
|
|
int virStoragePoolGetUUID (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned char *uuid);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolGetUUIDString (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
char *buf);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolGetInfo (virStoragePoolPtr vol,
|
2008-04-10 11:54:54 -05:00
|
|
|
virStoragePoolInfoPtr info);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
char * virStoragePoolGetXMLDesc (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolGetAutostart (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
int *autostart);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolSetAutostart (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
int autostart);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* List/lookup storage volumes within a pool
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStoragePoolNumOfVolumes (virStoragePoolPtr pool);
|
|
|
|
int virStoragePoolListVolumes (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
2012-09-04 10:32:53 -05:00
|
|
|
int virStoragePoolListAllVolumes (virStoragePoolPtr pool,
|
|
|
|
virStorageVolPtr **vols,
|
|
|
|
unsigned int flags);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Lookup volumes based on various attributes
|
|
|
|
*/
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *name);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *key);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *path);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
const char* virStorageVolGetName (virStorageVolPtr vol);
|
|
|
|
const char* virStorageVolGetKey (virStorageVolPtr vol);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
2012-12-05 04:48:07 -06:00
|
|
|
typedef enum {
|
|
|
|
VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA = 1 << 0,
|
|
|
|
} virStorageVolCreateFlags;
|
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
const char *xmldesc,
|
|
|
|
unsigned int flags);
|
2009-05-12 15:10:50 -05:00
|
|
|
virStorageVolPtr virStorageVolCreateXMLFrom (virStoragePoolPtr pool,
|
|
|
|
const char *xmldesc,
|
|
|
|
virStorageVolPtr clonevol,
|
|
|
|
unsigned int flags);
|
2009-07-14 08:24:27 -05:00
|
|
|
int virStorageVolDownload (virStorageVolPtr vol,
|
|
|
|
virStreamPtr stream,
|
|
|
|
unsigned long long offset,
|
|
|
|
unsigned long long length,
|
|
|
|
unsigned int flags);
|
|
|
|
int virStorageVolUpload (virStorageVolPtr vol,
|
|
|
|
virStreamPtr stream,
|
|
|
|
unsigned long long offset,
|
|
|
|
unsigned long long length,
|
|
|
|
unsigned int flags);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStorageVolDelete (virStorageVolPtr vol,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
2010-03-01 13:56:46 -06:00
|
|
|
int virStorageVolWipe (virStorageVolPtr vol,
|
|
|
|
unsigned int flags);
|
2012-01-09 10:05:03 -06:00
|
|
|
int virStorageVolWipePattern (virStorageVolPtr vol,
|
|
|
|
unsigned int algorithm,
|
|
|
|
unsigned int flags);
|
2009-01-20 06:14:03 -06:00
|
|
|
int virStorageVolRef (virStorageVolPtr vol);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStorageVolFree (virStorageVolPtr vol);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
int virStorageVolGetInfo (virStorageVolPtr vol,
|
2008-04-10 11:54:54 -05:00
|
|
|
virStorageVolInfoPtr info);
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
char * virStorageVolGetXMLDesc (virStorageVolPtr pool,
|
2008-04-10 11:54:54 -05:00
|
|
|
unsigned int flags);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 08:17:45 -05:00
|
|
|
char * virStorageVolGetPath (virStorageVolPtr vol);
|
2008-02-20 08:57:39 -06:00
|
|
|
|
2012-01-26 23:29:56 -06:00
|
|
|
typedef enum {
|
2012-07-11 09:27:38 -05:00
|
|
|
VIR_STORAGE_VOL_RESIZE_ALLOCATE = 1 << 0, /* force allocation of new size */
|
|
|
|
VIR_STORAGE_VOL_RESIZE_DELTA = 1 << 1, /* size is relative to current */
|
|
|
|
VIR_STORAGE_VOL_RESIZE_SHRINK = 1 << 2, /* allow decrease in capacity */
|
2012-01-26 23:29:56 -06:00
|
|
|
} virStorageVolResizeFlags;
|
|
|
|
|
|
|
|
int virStorageVolResize (virStorageVolPtr vol,
|
2012-01-30 13:04:20 -06:00
|
|
|
unsigned long long capacity,
|
2012-01-26 23:29:56 -06:00
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
|
2011-06-07 04:11:12 -05:00
|
|
|
/**
|
|
|
|
* virKeycodeSet:
|
|
|
|
*
|
|
|
|
* Enum to specify which keycode mapping is in use for virDomainSendKey().
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_KEYCODE_SET_LINUX = 0,
|
|
|
|
VIR_KEYCODE_SET_XT = 1,
|
|
|
|
VIR_KEYCODE_SET_ATSET1 = 2,
|
|
|
|
VIR_KEYCODE_SET_ATSET2 = 3,
|
|
|
|
VIR_KEYCODE_SET_ATSET3 = 4,
|
2011-07-21 02:32:34 -05:00
|
|
|
VIR_KEYCODE_SET_OSX = 5,
|
|
|
|
VIR_KEYCODE_SET_XT_KBD = 6,
|
|
|
|
VIR_KEYCODE_SET_USB = 7,
|
|
|
|
VIR_KEYCODE_SET_WIN32 = 8,
|
2011-08-25 11:45:49 -05:00
|
|
|
VIR_KEYCODE_SET_RFB = 9,
|
2011-07-21 02:32:34 -05:00
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_KEYCODE_SET_LAST
|
2011-08-18 19:14:40 -05:00
|
|
|
/*
|
|
|
|
* NB: this enum value will increase over time as new events are
|
|
|
|
* added to the libvirt API. It reflects the last keycode set supported
|
|
|
|
* by this version of the libvirt API.
|
|
|
|
*/
|
2012-01-20 12:43:28 -06:00
|
|
|
#endif
|
2011-06-07 04:11:12 -05:00
|
|
|
} virKeycodeSet;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SEND_KEY_MAX_KEYS:
|
|
|
|
*
|
|
|
|
* Maximum number of keycodes that can be sent in one virDomainSendKey() call.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SEND_KEY_MAX_KEYS 16
|
|
|
|
|
|
|
|
int virDomainSendKey(virDomainPtr domain,
|
|
|
|
unsigned int codeset,
|
|
|
|
unsigned int holdtime,
|
|
|
|
unsigned int *keycodes,
|
2011-06-15 11:33:59 -05:00
|
|
|
int nkeycodes,
|
2011-06-07 04:11:12 -05:00
|
|
|
unsigned int flags);
|
|
|
|
|
2011-11-15 09:13:05 -06:00
|
|
|
/*
|
|
|
|
* These just happen to match Linux signal numbers. The numbers
|
|
|
|
* will be mapped to whatever the SIGNUM is in the guest OS in
|
|
|
|
* question by the agent delivering the signal. The names are
|
|
|
|
* based on the POSIX / XSI signal standard though.
|
|
|
|
*
|
|
|
|
* Do not rely on all values matching Linux though. It is possible
|
|
|
|
* this enum might be extended with new signals which have no
|
|
|
|
* mapping in Linux.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_NOP = 0, /* No constant in POSIX/Linux */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_HUP = 1, /* SIGHUP */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_INT = 2, /* SIGINT */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_QUIT = 3, /* SIGQUIT */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_ILL = 4, /* SIGILL */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_TRAP = 5, /* SIGTRAP */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_ABRT = 6, /* SIGABRT */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_BUS = 7, /* SIGBUS */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_FPE = 8, /* SIGFPE */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_KILL = 9, /* SIGKILL */
|
|
|
|
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_USR1 = 10, /* SIGUSR1 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_SEGV = 11, /* SIGSEGV */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_USR2 = 12, /* SIGUSR2 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_PIPE = 13, /* SIGPIPE */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_ALRM = 14, /* SIGALRM */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_TERM = 15, /* SIGTERM */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_STKFLT = 16, /* Not in POSIX (SIGSTKFLT on Linux )*/
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_CHLD = 17, /* SIGCHLD */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_CONT = 18, /* SIGCONT */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_STOP = 19, /* SIGSTOP */
|
|
|
|
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_TSTP = 20, /* SIGTSTP */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_TTIN = 21, /* SIGTTIN */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_TTOU = 22, /* SIGTTOU */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_URG = 23, /* SIGURG */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_XCPU = 24, /* SIGXCPU */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_XFSZ = 25, /* SIGXFSZ */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_VTALRM = 26, /* SIGVTALRM */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_PROF = 27, /* SIGPROF */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_WINCH = 28, /* Not in POSIX (SIGWINCH on Linux) */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_POLL = 29, /* SIGPOLL (also known as SIGIO on Linux) */
|
|
|
|
|
2013-01-22 09:55:35 -06:00
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_PWR = 30, /* Not in POSIX (SIGPWR on Linux) */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_SYS = 31, /* SIGSYS (also known as SIGUNUSED on Linux) */
|
2011-11-15 09:13:05 -06:00
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT0 = 32, /* SIGRTMIN */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT1 = 33, /* SIGRTMIN + 1 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT2 = 34, /* SIGRTMIN + 2 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT3 = 35, /* SIGRTMIN + 3 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT4 = 36, /* SIGRTMIN + 4 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT5 = 37, /* SIGRTMIN + 5 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT6 = 38, /* SIGRTMIN + 6 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT7 = 39, /* SIGRTMIN + 7 */
|
|
|
|
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT8 = 40, /* SIGRTMIN + 8 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT9 = 41, /* SIGRTMIN + 9 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT10 = 42, /* SIGRTMIN + 10 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT11 = 43, /* SIGRTMIN + 11 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT12 = 44, /* SIGRTMIN + 12 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT13 = 45, /* SIGRTMIN + 13 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT14 = 46, /* SIGRTMIN + 14 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT15 = 47, /* SIGRTMIN + 15 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT16 = 48, /* SIGRTMIN + 16 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT17 = 49, /* SIGRTMIN + 17 */
|
|
|
|
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT18 = 50, /* SIGRTMIN + 18 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT19 = 51, /* SIGRTMIN + 19 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT20 = 52, /* SIGRTMIN + 20 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT21 = 53, /* SIGRTMIN + 21 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT22 = 54, /* SIGRTMIN + 22 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT23 = 55, /* SIGRTMIN + 23 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT24 = 56, /* SIGRTMIN + 24 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT25 = 57, /* SIGRTMIN + 25 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT26 = 58, /* SIGRTMIN + 26 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT27 = 59, /* SIGRTMIN + 27 */
|
|
|
|
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT28 = 60, /* SIGRTMIN + 28 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT29 = 61, /* SIGRTMIN + 29 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT30 = 62, /* SIGRTMIN + 30 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT31 = 63, /* SIGRTMIN + 31 */
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_RT32 = 64, /* SIGRTMIN + 32 / SIGRTMAX */
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_PROCESS_SIGNAL_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainProcessSignal;
|
|
|
|
|
|
|
|
int virDomainSendProcessSignal(virDomainPtr domain,
|
|
|
|
long long pid_value,
|
|
|
|
unsigned int signum,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2008-10-10 04:32:27 -05:00
|
|
|
/*
|
|
|
|
* Deprecated calls
|
|
|
|
*/
|
|
|
|
virDomainPtr virDomainCreateLinux (virConnectPtr conn,
|
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int flags);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
2009-04-24 08:11:23 -05:00
|
|
|
|
2008-10-23 08:18:18 -05:00
|
|
|
/*
|
|
|
|
* Domain Event Notification
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventType:
|
|
|
|
*
|
|
|
|
* a virDomainEventType is emitted during domain lifecycle events
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2012-01-20 12:43:28 -06:00
|
|
|
VIR_DOMAIN_EVENT_DEFINED = 0,
|
|
|
|
VIR_DOMAIN_EVENT_UNDEFINED = 1,
|
|
|
|
VIR_DOMAIN_EVENT_STARTED = 2,
|
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED = 3,
|
|
|
|
VIR_DOMAIN_EVENT_RESUMED = 4,
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED = 5,
|
|
|
|
VIR_DOMAIN_EVENT_SHUTDOWN = 6,
|
2012-09-06 10:00:43 -05:00
|
|
|
VIR_DOMAIN_EVENT_PMSUSPENDED = 7,
|
2013-06-07 05:23:31 -05:00
|
|
|
VIR_DOMAIN_EVENT_CRASHED = 8,
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_LAST
|
|
|
|
#endif
|
2008-10-23 08:18:18 -05:00
|
|
|
} virDomainEventType;
|
|
|
|
|
2008-11-17 10:43:00 -06:00
|
|
|
/**
|
|
|
|
* virDomainEventDefinedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'defined' lifecycle event
|
2008-11-17 10:43:00 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_DEFINED_ADDED = 0, /* Newly created config file */
|
|
|
|
VIR_DOMAIN_EVENT_DEFINED_UPDATED = 1, /* Changed config file */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_DEFINED_LAST
|
|
|
|
#endif
|
2008-11-17 10:43:00 -06:00
|
|
|
} virDomainEventDefinedDetailType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventUndefinedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of an 'undefined' lifecycle event
|
2008-11-17 10:43:00 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED = 0, /* Deleted the config file */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_UNDEFINED_LAST
|
|
|
|
#endif
|
2008-11-17 10:43:00 -06:00
|
|
|
} virDomainEventUndefinedDetailType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventStartedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'started' lifecycle event
|
2008-11-17 10:43:00 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_STARTED_BOOTED = 0, /* Normal startup from boot */
|
|
|
|
VIR_DOMAIN_EVENT_STARTED_MIGRATED = 1, /* Incoming migration from another host */
|
|
|
|
VIR_DOMAIN_EVENT_STARTED_RESTORED = 2, /* Restored from a state file */
|
2010-03-31 15:33:13 -05:00
|
|
|
VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT = 3, /* Restored from snapshot */
|
2012-03-14 10:26:55 -05:00
|
|
|
VIR_DOMAIN_EVENT_STARTED_WAKEUP = 4, /* Started due to wakeup event */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_STARTED_LAST
|
|
|
|
#endif
|
2008-11-17 10:43:00 -06:00
|
|
|
} virDomainEventStartedDetailType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventSuspendedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'suspended' lifecycle event
|
2008-11-17 10:43:00 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED = 0, /* Normal suspend due to admin pause */
|
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED = 1, /* Suspended for offline migration */
|
2010-02-16 06:07:49 -06:00
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_IOERROR = 2, /* Suspended due to a disk I/O error */
|
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG = 3, /* Suspended due to a watchdog firing */
|
2011-08-05 17:05:50 -05:00
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED = 4, /* Restored from paused state file */
|
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT = 5, /* Restored from paused snapshot */
|
2012-11-06 11:39:18 -06:00
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR = 6, /* suspended after failure during libvirt API call */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_SUSPENDED_LAST
|
|
|
|
#endif
|
2008-11-17 10:43:00 -06:00
|
|
|
} virDomainEventSuspendedDetailType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventResumedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'resumed' lifecycle event
|
2008-11-17 10:43:00 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED = 0, /* Normal resume due to admin unpause */
|
|
|
|
VIR_DOMAIN_EVENT_RESUMED_MIGRATED = 1, /* Resumed for completion of migration */
|
2011-08-05 17:05:50 -05:00
|
|
|
VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT = 2, /* Resumed from snapshot */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_RESUMED_LAST
|
|
|
|
#endif
|
2008-11-17 10:43:00 -06:00
|
|
|
} virDomainEventResumedDetailType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventStoppedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'stopped' lifecycle event
|
2008-11-17 10:43:00 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN = 0, /* Normal shutdown */
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_DESTROYED = 1, /* Forced poweroff from host */
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_CRASHED = 2, /* Guest crashed */
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_MIGRATED = 3, /* Migrated off to another host */
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_SAVED = 4, /* Saved to a state file */
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_FAILED = 5, /* Host emulator/mgmt failed */
|
2010-03-31 15:33:13 -05:00
|
|
|
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT = 6, /* offline snapshot loaded */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_STOPPED_LAST
|
|
|
|
#endif
|
2008-11-17 10:43:00 -06:00
|
|
|
} virDomainEventStoppedDetailType;
|
|
|
|
|
|
|
|
|
2011-11-30 08:31:45 -06:00
|
|
|
/**
|
|
|
|
* virDomainEventShutdownDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'shutdown' lifecycle event
|
2011-11-30 08:31:45 -06:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED = 0, /* Guest finished shutdown sequence */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_SHUTDOWN_LAST
|
|
|
|
#endif
|
2011-11-30 08:31:45 -06:00
|
|
|
} virDomainEventShutdownDetailType;
|
|
|
|
|
2012-09-06 10:00:43 -05:00
|
|
|
/**
|
|
|
|
* virDomainEventPMSuspendedDetailType:
|
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'pmsuspended' lifecycle event
|
2012-09-06 10:00:43 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY = 0, /* Guest was PM suspended to memory */
|
2012-10-12 14:13:39 -05:00
|
|
|
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK = 1, /* Guest was PM suspended to disk */
|
2012-09-06 10:00:43 -05:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_PMSUSPENDED_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainEventPMSuspendedDetailType;
|
|
|
|
|
2013-11-28 06:01:55 -06:00
|
|
|
/**
|
|
|
|
* virDomainEventCrashedDetailType:
|
2013-12-02 12:25:41 -06:00
|
|
|
*
|
2013-11-28 06:01:55 -06:00
|
|
|
* Details on the cause of a 'crashed' lifecycle event
|
2013-06-07 05:23:31 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_CRASHED_PANICKED = 0, /* Guest was panicked */
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_CRASHED_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainEventCrashedDetailType;
|
|
|
|
|
2008-10-23 08:18:18 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventCallback:
|
|
|
|
* @conn: virConnect connection
|
2011-10-10 15:02:06 -05:00
|
|
|
* @dom: The domain on which the event occurred
|
2012-10-11 11:31:20 -05:00
|
|
|
* @event: The specific virDomainEventType which occurred
|
2008-11-17 10:43:00 -06:00
|
|
|
* @detail: event specific detail information
|
2008-10-23 08:18:18 -05:00
|
|
|
* @opaque: opaque user data
|
|
|
|
*
|
2008-10-24 07:05:39 -05:00
|
|
|
* A callback function to be registered, and called when a domain event occurs
|
2013-01-30 07:47:53 -06:00
|
|
|
*
|
|
|
|
* Returns 0 (the return value is currently ignored)
|
2008-10-23 08:18:18 -05:00
|
|
|
*/
|
|
|
|
typedef int (*virConnectDomainEventCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
int event,
|
2008-11-17 10:43:00 -06:00
|
|
|
int detail,
|
2008-10-23 08:18:18 -05:00
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virConnectDomainEventRegister(virConnectPtr conn,
|
|
|
|
virConnectDomainEventCallback cb,
|
2008-11-19 09:25:24 -06:00
|
|
|
void *opaque,
|
|
|
|
virFreeCallback freecb);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
|
|
|
int virConnectDomainEventDeregister(virConnectPtr conn,
|
|
|
|
virConnectDomainEventCallback cb);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Events Implementation
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventHandleType:
|
|
|
|
*
|
|
|
|
* a virEventHandleType is used similar to POLLxxx FD events, but is specific
|
|
|
|
* to libvirt. A client app must translate to, and from POLL events when using
|
|
|
|
* this construct.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_EVENT_HANDLE_READABLE = (1 << 0),
|
|
|
|
VIR_EVENT_HANDLE_WRITABLE = (1 << 1),
|
|
|
|
VIR_EVENT_HANDLE_ERROR = (1 << 2),
|
|
|
|
VIR_EVENT_HANDLE_HANGUP = (1 << 3),
|
|
|
|
} virEventHandleType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventHandleCallback:
|
|
|
|
*
|
2008-11-19 10:19:36 -06:00
|
|
|
* @watch: watch on which the event occurred
|
2008-10-23 08:18:18 -05:00
|
|
|
* @fd: file handle on which the event occurred
|
|
|
|
* @events: bitset of events from virEventHandleType constants
|
|
|
|
* @opaque: user data registered with handle
|
|
|
|
*
|
2008-11-19 10:19:36 -06:00
|
|
|
* Callback for receiving file handle events. The callback will
|
|
|
|
* be invoked once for each event which is pending.
|
2008-10-23 08:18:18 -05:00
|
|
|
*/
|
2008-11-19 10:19:36 -06:00
|
|
|
typedef void (*virEventHandleCallback)(int watch, int fd, int events, void *opaque);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventAddHandleFunc:
|
|
|
|
* @fd: file descriptor to listen on
|
|
|
|
* @event: bitset of events on which to fire the callback
|
2008-11-19 10:24:01 -06:00
|
|
|
* @cb: the callback to be called when an event occurrs
|
2008-10-23 08:18:18 -05:00
|
|
|
* @opaque: user data to pass to the callback
|
2008-11-19 10:24:01 -06:00
|
|
|
* @ff: the callback invoked to free opaque data blob
|
2008-10-23 08:18:18 -05:00
|
|
|
*
|
2011-10-03 15:24:13 -05:00
|
|
|
* Part of the EventImpl, this callback adds a file handle callback to
|
2008-11-19 10:19:36 -06:00
|
|
|
* listen for specific events. The same file handle can be registered
|
|
|
|
* multiple times provided the requested event sets are non-overlapping
|
|
|
|
*
|
2008-11-19 10:24:01 -06:00
|
|
|
* If the opaque user data requires free'ing when the handle
|
|
|
|
* is unregistered, then a 2nd callback can be supplied for
|
2011-10-03 15:24:13 -05:00
|
|
|
* this purpose. This callback needs to be invoked from a clean stack.
|
|
|
|
* If 'ff' callbacks are invoked directly from the virEventRemoveHandleFunc
|
|
|
|
* they will likely deadlock in libvirt.
|
2008-11-19 10:24:01 -06:00
|
|
|
*
|
2013-09-18 13:56:01 -05:00
|
|
|
* Returns -1 if the file handle cannot be registered, otherwise a handle
|
|
|
|
* watch number to be used for updating and unregistering for events
|
2008-10-23 08:18:18 -05:00
|
|
|
*/
|
|
|
|
typedef int (*virEventAddHandleFunc)(int fd, int event,
|
2008-11-19 10:24:01 -06:00
|
|
|
virEventHandleCallback cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback ff);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventUpdateHandleFunc:
|
2008-11-19 10:19:36 -06:00
|
|
|
* @watch: file descriptor watch to modify
|
2008-10-23 08:18:18 -05:00
|
|
|
* @event: new events to listen on
|
|
|
|
*
|
|
|
|
* Part of the EventImpl, this user-provided callback is notified when
|
|
|
|
* events to listen on change
|
|
|
|
*/
|
2008-11-19 10:19:36 -06:00
|
|
|
typedef void (*virEventUpdateHandleFunc)(int watch, int event);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventRemoveHandleFunc:
|
2008-11-19 10:19:36 -06:00
|
|
|
* @watch: file descriptor watch to stop listening on
|
2008-10-23 08:18:18 -05:00
|
|
|
*
|
|
|
|
* Part of the EventImpl, this user-provided callback is notified when
|
2008-11-19 10:24:01 -06:00
|
|
|
* an fd is no longer being listened on.
|
|
|
|
*
|
|
|
|
* If a virEventHandleFreeFunc was supplied when the handle was
|
|
|
|
* registered, it will be invoked some time during, or after this
|
|
|
|
* function call, when it is safe to release the user data.
|
2013-01-30 02:25:16 -06:00
|
|
|
*
|
|
|
|
* Returns -1 if the file handle was not registered, 0 upon success
|
2008-10-23 08:18:18 -05:00
|
|
|
*/
|
2008-11-19 10:19:36 -06:00
|
|
|
typedef int (*virEventRemoveHandleFunc)(int watch);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventTimeoutCallback:
|
|
|
|
*
|
|
|
|
* @timer: timer id emitting the event
|
|
|
|
* @opaque: user data registered with handle
|
|
|
|
*
|
|
|
|
* callback for receiving timer events
|
|
|
|
*/
|
|
|
|
typedef void (*virEventTimeoutCallback)(int timer, void *opaque);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventAddTimeoutFunc:
|
|
|
|
* @timeout: The timeout to monitor
|
|
|
|
* @cb: the callback to call when timeout has expired
|
|
|
|
* @opaque: user data to pass to the callback
|
2008-11-19 10:24:01 -06:00
|
|
|
* @ff: the callback invoked to free opaque data blob
|
2008-10-23 08:18:18 -05:00
|
|
|
*
|
|
|
|
* Part of the EventImpl, this user-defined callback handles adding an
|
|
|
|
* event timeout.
|
|
|
|
*
|
2008-11-19 10:24:01 -06:00
|
|
|
* If the opaque user data requires free'ing when the handle
|
|
|
|
* is unregistered, then a 2nd callback can be supplied for
|
|
|
|
* this purpose.
|
|
|
|
*
|
2008-10-23 08:18:18 -05:00
|
|
|
* Returns a timer value
|
|
|
|
*/
|
2008-11-19 10:24:01 -06:00
|
|
|
typedef int (*virEventAddTimeoutFunc)(int timeout,
|
|
|
|
virEventTimeoutCallback cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback ff);
|
2008-10-23 08:18:18 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventUpdateTimeoutFunc:
|
|
|
|
* @timer: the timer to modify
|
|
|
|
* @timeout: the new timeout value
|
|
|
|
*
|
|
|
|
* Part of the EventImpl, this user-defined callback updates an
|
|
|
|
* event timeout.
|
|
|
|
*/
|
|
|
|
typedef void (*virEventUpdateTimeoutFunc)(int timer, int timeout);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virEventRemoveTimeoutFunc:
|
|
|
|
* @timer: the timer to remove
|
|
|
|
*
|
|
|
|
* Part of the EventImpl, this user-defined callback removes a timer
|
|
|
|
*
|
2008-11-19 10:24:01 -06:00
|
|
|
* If a virEventTimeoutFreeFunc was supplied when the handle was
|
|
|
|
* registered, it will be invoked some time during, or after this
|
|
|
|
* function call, when it is safe to release the user data.
|
|
|
|
*
|
2008-10-23 08:18:18 -05:00
|
|
|
* Returns 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
typedef int (*virEventRemoveTimeoutFunc)(int timer);
|
|
|
|
|
|
|
|
void virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
|
|
|
virEventUpdateHandleFunc updateHandle,
|
|
|
|
virEventRemoveHandleFunc removeHandle,
|
|
|
|
virEventAddTimeoutFunc addTimeout,
|
|
|
|
virEventUpdateTimeoutFunc updateTimeout,
|
|
|
|
virEventRemoveTimeoutFunc removeTimeout);
|
2009-07-27 19:39:48 -05:00
|
|
|
|
2011-03-02 10:59:54 -06:00
|
|
|
int virEventRegisterDefaultImpl(void);
|
|
|
|
int virEventRunDefaultImpl(void);
|
|
|
|
|
2011-06-15 16:54:30 -05:00
|
|
|
int virEventAddHandle(int fd, int events,
|
|
|
|
virEventHandleCallback cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback ff);
|
|
|
|
void virEventUpdateHandle(int watch, int events);
|
|
|
|
int virEventRemoveHandle(int watch);
|
|
|
|
|
|
|
|
int virEventAddTimeout(int frequency,
|
|
|
|
virEventTimeoutCallback cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback ff);
|
|
|
|
void virEventUpdateTimeout(int timer, int frequency);
|
|
|
|
int virEventRemoveTimeout(int timer);
|
|
|
|
|
2009-07-10 06:18:12 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_STREAM_NONBLOCK = (1 << 0),
|
|
|
|
} virStreamFlags;
|
|
|
|
|
|
|
|
virStreamPtr virStreamNew(virConnectPtr conn,
|
|
|
|
unsigned int flags);
|
|
|
|
int virStreamRef(virStreamPtr st);
|
|
|
|
|
|
|
|
int virStreamSend(virStreamPtr st,
|
|
|
|
const char *data,
|
|
|
|
size_t nbytes);
|
|
|
|
|
|
|
|
int virStreamRecv(virStreamPtr st,
|
|
|
|
char *data,
|
|
|
|
size_t nbytes);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStreamSourceFunc:
|
|
|
|
*
|
|
|
|
* @st: the stream object
|
|
|
|
* @data: preallocated array to be filled with data
|
|
|
|
* @nbytes: size of the data array
|
|
|
|
* @opaque: optional application provided data
|
|
|
|
*
|
|
|
|
* The virStreamSourceFunc callback is used together
|
|
|
|
* with the virStreamSendAll function for libvirt to
|
|
|
|
* obtain the data that is to be sent.
|
|
|
|
*
|
|
|
|
* The callback will be invoked multiple times,
|
|
|
|
* fetching data in small chunks. The application
|
2012-10-11 11:31:20 -05:00
|
|
|
* should fill the 'data' array with up to 'nbytes'
|
2009-07-10 06:18:12 -05:00
|
|
|
* of data and then return the number actual number
|
|
|
|
* of bytes. The callback will continue to be
|
|
|
|
* invoked until it indicates the end of the source
|
|
|
|
* has been reached by returning 0. A return value
|
|
|
|
* of -1 at any time will abort the send operation
|
|
|
|
*
|
|
|
|
* Returns the number of bytes filled, 0 upon end
|
|
|
|
* of file, or -1 upon error
|
|
|
|
*/
|
|
|
|
typedef int (*virStreamSourceFunc)(virStreamPtr st,
|
|
|
|
char *data,
|
|
|
|
size_t nbytes,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virStreamSendAll(virStreamPtr st,
|
|
|
|
virStreamSourceFunc handler,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStreamSinkFunc:
|
|
|
|
*
|
|
|
|
* @st: the stream object
|
|
|
|
* @data: preallocated array to be filled with data
|
|
|
|
* @nbytes: size of the data array
|
|
|
|
* @opaque: optional application provided data
|
|
|
|
*
|
|
|
|
* The virStreamSinkFunc callback is used together
|
|
|
|
* with the virStreamRecvAll function for libvirt to
|
|
|
|
* provide the data that has been received.
|
|
|
|
*
|
|
|
|
* The callback will be invoked multiple times,
|
|
|
|
* providing data in small chunks. The application
|
|
|
|
* should consume up 'nbytes' from the 'data' array
|
|
|
|
* of data and then return the number actual number
|
|
|
|
* of bytes consumed. The callback will continue to be
|
|
|
|
* invoked until it indicates the end of the stream
|
|
|
|
* has been reached. A return value of -1 at any time
|
|
|
|
* will abort the receive operation
|
|
|
|
*
|
|
|
|
* Returns the number of bytes consumed or -1 upon
|
|
|
|
* error
|
|
|
|
*/
|
|
|
|
typedef int (*virStreamSinkFunc)(virStreamPtr st,
|
|
|
|
const char *data,
|
|
|
|
size_t nbytes,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virStreamRecvAll(virStreamPtr st,
|
|
|
|
virStreamSinkFunc handler,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_STREAM_EVENT_READABLE = (1 << 0),
|
|
|
|
VIR_STREAM_EVENT_WRITABLE = (1 << 1),
|
|
|
|
VIR_STREAM_EVENT_ERROR = (1 << 2),
|
|
|
|
VIR_STREAM_EVENT_HANGUP = (1 << 3),
|
|
|
|
} virStreamEventType;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virStreamEventCallback:
|
|
|
|
*
|
|
|
|
* @stream: stream on which the event occurred
|
|
|
|
* @events: bitset of events from virEventHandleType constants
|
|
|
|
* @opaque: user data registered with handle
|
|
|
|
*
|
|
|
|
* Callback for receiving stream events. The callback will
|
|
|
|
* be invoked once for each event which is pending.
|
|
|
|
*/
|
|
|
|
typedef void (*virStreamEventCallback)(virStreamPtr stream, int events, void *opaque);
|
|
|
|
|
|
|
|
int virStreamEventAddCallback(virStreamPtr stream,
|
|
|
|
int events,
|
|
|
|
virStreamEventCallback cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback ff);
|
|
|
|
|
|
|
|
int virStreamEventUpdateCallback(virStreamPtr stream,
|
|
|
|
int events);
|
|
|
|
|
|
|
|
int virStreamEventRemoveCallback(virStreamPtr stream);
|
|
|
|
|
|
|
|
|
|
|
|
int virStreamFinish(virStreamPtr st);
|
|
|
|
int virStreamAbort(virStreamPtr st);
|
|
|
|
|
|
|
|
int virStreamFree(virStreamPtr st);
|
|
|
|
|
|
|
|
|
New APIs for checking some object properties
Introduce a number of new APIs to expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.
* virDomainIsActive: Checking virDomainGetID is not reliable
since it is not possible to distinguish between error condition
and inactive domain for ID of -1.
* virDomainIsPersistent: Check whether a persistent config exists
for the domain
* virNetworkIsActive: Check whether the network is active
* virNetworkIsPersistent: Check whether a persistent config exists
for the network
* virStoragePoolIsActive: Check whether the storage pool is active
* virStoragePoolIsPersistent: Check whether a persistent config exists
for the storage pool
* virInterfaceIsActive: Check whether the host interface is active
* virConnectIsSecure: whether the communication channel to the
hypervisor is secure
* virConnectIsEncrypted: whether any network based commnunication
channels are encrypted
NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.
* include/libvirt/libvirt.h.in: Define public API
* src/driver.h: Define internal driver API
* src/libvirt.c: Implement public API entry point
* src/libvirt_public.syms: Export API symbols
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/interface/netcf_driver.c, src/network/bridge_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c: Stub out driver tables
2009-10-21 05:49:05 -05:00
|
|
|
int virDomainIsActive(virDomainPtr dom);
|
|
|
|
int virDomainIsPersistent(virDomainPtr dom);
|
2010-11-14 21:23:32 -06:00
|
|
|
int virDomainIsUpdated(virDomainPtr dom);
|
New APIs for checking some object properties
Introduce a number of new APIs to expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.
* virDomainIsActive: Checking virDomainGetID is not reliable
since it is not possible to distinguish between error condition
and inactive domain for ID of -1.
* virDomainIsPersistent: Check whether a persistent config exists
for the domain
* virNetworkIsActive: Check whether the network is active
* virNetworkIsPersistent: Check whether a persistent config exists
for the network
* virStoragePoolIsActive: Check whether the storage pool is active
* virStoragePoolIsPersistent: Check whether a persistent config exists
for the storage pool
* virInterfaceIsActive: Check whether the host interface is active
* virConnectIsSecure: whether the communication channel to the
hypervisor is secure
* virConnectIsEncrypted: whether any network based commnunication
channels are encrypted
NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.
* include/libvirt/libvirt.h.in: Define public API
* src/driver.h: Define internal driver API
* src/libvirt.c: Implement public API entry point
* src/libvirt_public.syms: Export API symbols
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/interface/netcf_driver.c, src/network/bridge_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c: Stub out driver tables
2009-10-21 05:49:05 -05:00
|
|
|
|
|
|
|
int virStoragePoolIsActive(virStoragePoolPtr pool);
|
|
|
|
int virStoragePoolIsPersistent(virStoragePoolPtr pool);
|
|
|
|
|
|
|
|
|
|
|
|
int virConnectIsEncrypted(virConnectPtr conn);
|
|
|
|
int virConnectIsSecure(virConnectPtr conn);
|
2011-09-23 01:47:59 -05:00
|
|
|
int virConnectIsAlive(virConnectPtr conn);
|
New APIs for checking some object properties
Introduce a number of new APIs to expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.
* virDomainIsActive: Checking virDomainGetID is not reliable
since it is not possible to distinguish between error condition
and inactive domain for ID of -1.
* virDomainIsPersistent: Check whether a persistent config exists
for the domain
* virNetworkIsActive: Check whether the network is active
* virNetworkIsPersistent: Check whether a persistent config exists
for the network
* virStoragePoolIsActive: Check whether the storage pool is active
* virStoragePoolIsPersistent: Check whether a persistent config exists
for the storage pool
* virInterfaceIsActive: Check whether the host interface is active
* virConnectIsSecure: whether the communication channel to the
hypervisor is secure
* virConnectIsEncrypted: whether any network based commnunication
channels are encrypted
NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.
* include/libvirt/libvirt.h.in: Define public API
* src/driver.h: Define internal driver API
* src/libvirt.c: Implement public API entry point
* src/libvirt_public.syms: Export API symbols
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/interface/netcf_driver.c, src/network/bridge_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c: Stub out driver tables
2009-10-21 05:49:05 -05:00
|
|
|
|
2009-12-18 07:51:39 -06:00
|
|
|
/*
|
|
|
|
* CPU specification API
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_CPU_COMPARE_ERROR = -1,
|
|
|
|
VIR_CPU_COMPARE_INCOMPATIBLE = 0,
|
|
|
|
VIR_CPU_COMPARE_IDENTICAL = 1,
|
2012-01-20 12:43:28 -06:00
|
|
|
VIR_CPU_COMPARE_SUPERSET = 2,
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_CPU_COMPARE_LAST
|
|
|
|
#endif
|
2009-12-18 07:51:39 -06:00
|
|
|
} virCPUCompareResult;
|
|
|
|
|
2014-05-28 08:12:59 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE = (1 << 0), /* treat incompatible
|
|
|
|
CPUs as failure */
|
|
|
|
} virConnectCompareCPUFlags;
|
|
|
|
|
2009-12-18 07:51:39 -06:00
|
|
|
int virConnectCompareCPU(virConnectPtr conn,
|
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int flags);
|
New APIs for checking some object properties
Introduce a number of new APIs to expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.
* virDomainIsActive: Checking virDomainGetID is not reliable
since it is not possible to distinguish between error condition
and inactive domain for ID of -1.
* virDomainIsPersistent: Check whether a persistent config exists
for the domain
* virNetworkIsActive: Check whether the network is active
* virNetworkIsPersistent: Check whether a persistent config exists
for the network
* virStoragePoolIsActive: Check whether the storage pool is active
* virStoragePoolIsPersistent: Check whether a persistent config exists
for the storage pool
* virInterfaceIsActive: Check whether the host interface is active
* virConnectIsSecure: whether the communication channel to the
hypervisor is secure
* virConnectIsEncrypted: whether any network based commnunication
channels are encrypted
NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.
* include/libvirt/libvirt.h.in: Define public API
* src/driver.h: Define internal driver API
* src/libvirt.c: Implement public API entry point
* src/libvirt_public.syms: Export API symbols
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/interface/netcf_driver.c, src/network/bridge_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c: Stub out driver tables
2009-10-21 05:49:05 -05:00
|
|
|
|
2013-09-23 04:45:58 -05:00
|
|
|
int virConnectGetCPUModelNames(virConnectPtr conn,
|
|
|
|
const char *arch,
|
|
|
|
char ***models,
|
|
|
|
unsigned int flags);
|
New APIs for checking some object properties
Introduce a number of new APIs to expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.
* virDomainIsActive: Checking virDomainGetID is not reliable
since it is not possible to distinguish between error condition
and inactive domain for ID of -1.
* virDomainIsPersistent: Check whether a persistent config exists
for the domain
* virNetworkIsActive: Check whether the network is active
* virNetworkIsPersistent: Check whether a persistent config exists
for the network
* virStoragePoolIsActive: Check whether the storage pool is active
* virStoragePoolIsPersistent: Check whether a persistent config exists
for the storage pool
* virInterfaceIsActive: Check whether the host interface is active
* virConnectIsSecure: whether the communication channel to the
hypervisor is secure
* virConnectIsEncrypted: whether any network based commnunication
channels are encrypted
NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.
* include/libvirt/libvirt.h.in: Define public API
* src/driver.h: Define internal driver API
* src/libvirt.c: Implement public API entry point
* src/libvirt_public.syms: Export API symbols
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/interface/netcf_driver.c, src/network/bridge_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c: Stub out driver tables
2009-10-21 05:49:05 -05:00
|
|
|
|
2013-08-02 14:08:19 -05:00
|
|
|
/**
|
|
|
|
* virConnectBaselineCPUFlags
|
|
|
|
*
|
|
|
|
* Flags when getting XML description of a computed CPU
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES = (1 << 0), /* show all features */
|
|
|
|
} virConnectBaselineCPUFlags;
|
|
|
|
|
2010-01-22 07:52:41 -06:00
|
|
|
char *virConnectBaselineCPU(virConnectPtr conn,
|
|
|
|
const char **xmlCPUs,
|
|
|
|
unsigned int ncpus,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2010-02-03 05:31:45 -06:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_JOB_NONE = 0, /* No job is active */
|
|
|
|
VIR_DOMAIN_JOB_BOUNDED = 1, /* Job with a finite completion time */
|
|
|
|
VIR_DOMAIN_JOB_UNBOUNDED = 2, /* Job without a finite completion time */
|
|
|
|
VIR_DOMAIN_JOB_COMPLETED = 3, /* Job has finished, but isn't cleaned up */
|
|
|
|
VIR_DOMAIN_JOB_FAILED = 4, /* Job hit error, but isn't cleaned up */
|
|
|
|
VIR_DOMAIN_JOB_CANCELLED = 5, /* Job was aborted, but isn't cleaned up */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_JOB_LAST
|
|
|
|
#endif
|
2010-02-03 05:31:45 -06:00
|
|
|
} virDomainJobType;
|
|
|
|
|
|
|
|
typedef struct _virDomainJobInfo virDomainJobInfo;
|
|
|
|
typedef virDomainJobInfo *virDomainJobInfoPtr;
|
|
|
|
struct _virDomainJobInfo {
|
|
|
|
/* One of virDomainJobType */
|
|
|
|
int type;
|
|
|
|
|
2013-11-15 06:54:33 -06:00
|
|
|
/* Time is measured in milliseconds */
|
2010-02-03 05:31:45 -06:00
|
|
|
unsigned long long timeElapsed; /* Always set */
|
|
|
|
unsigned long long timeRemaining; /* Only for VIR_DOMAIN_JOB_BOUNDED */
|
|
|
|
|
|
|
|
/* Data is measured in bytes unless otherwise specified
|
2013-11-15 06:54:33 -06:00
|
|
|
* and is measuring the job as a whole.
|
2010-02-03 05:31:45 -06:00
|
|
|
*
|
|
|
|
* For VIR_DOMAIN_JOB_UNBOUNDED, dataTotal may be less
|
|
|
|
* than the final sum of dataProcessed + dataRemaining
|
|
|
|
* in the event that the hypervisor has to repeat some
|
2013-11-15 06:54:33 -06:00
|
|
|
* data, such as due to dirtied pages during migration.
|
2010-02-03 05:31:45 -06:00
|
|
|
*
|
|
|
|
* For VIR_DOMAIN_JOB_BOUNDED, dataTotal shall always
|
2013-11-15 06:54:33 -06:00
|
|
|
* equal the sum of dataProcessed + dataRemaining.
|
2010-02-03 05:31:45 -06:00
|
|
|
*/
|
|
|
|
unsigned long long dataTotal;
|
|
|
|
unsigned long long dataProcessed;
|
|
|
|
unsigned long long dataRemaining;
|
|
|
|
|
|
|
|
/* As above, but only tracking guest memory progress */
|
|
|
|
unsigned long long memTotal;
|
|
|
|
unsigned long long memProcessed;
|
|
|
|
unsigned long long memRemaining;
|
|
|
|
|
|
|
|
/* As above, but only tracking guest disk file progress */
|
|
|
|
unsigned long long fileTotal;
|
|
|
|
unsigned long long fileProcessed;
|
|
|
|
unsigned long long fileRemaining;
|
|
|
|
};
|
|
|
|
|
2014-08-28 06:52:58 -05:00
|
|
|
/**
|
|
|
|
* virDomainGetJobStatsFlags:
|
|
|
|
*
|
|
|
|
* Flags OR'ed together to provide specific behavior when querying domain
|
|
|
|
* job statistics.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_JOB_STATS_COMPLETED = 1 << 0, /* return stats of a recently
|
|
|
|
* completed job */
|
|
|
|
} virDomainGetJobStatsFlags;
|
|
|
|
|
2010-02-03 05:31:45 -06:00
|
|
|
int virDomainGetJobInfo(virDomainPtr dom,
|
|
|
|
virDomainJobInfoPtr info);
|
2013-01-25 17:30:49 -06:00
|
|
|
int virDomainGetJobStats(virDomainPtr domain,
|
|
|
|
int *type,
|
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
2010-02-04 10:12:01 -06:00
|
|
|
int virDomainAbortJob(virDomainPtr dom);
|
2010-02-03 05:31:45 -06:00
|
|
|
|
2013-01-25 17:30:49 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_TIME_ELAPSED:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: time (ms) since the beginning of the
|
|
|
|
* job, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to timeElapsed field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_TIME_ELAPSED "time_elapsed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_TIME_REMAINING:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: remaining time (ms) for VIR_DOMAIN_JOB_BOUNDED
|
|
|
|
* jobs, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to timeRemaining field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_TIME_REMAINING "time_remaining"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DOWNTIME:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: downtime (ms) that is expected to happen
|
|
|
|
* during migration, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DOWNTIME "downtime"
|
|
|
|
|
2014-01-13 00:28:10 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_SETUP_TIME:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: total time in milliseconds spent preparing
|
|
|
|
* the migration in the 'setup' phase before the iterations begin, as
|
|
|
|
* VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_SETUP_TIME "setup_time"
|
|
|
|
|
2013-01-25 17:30:49 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DATA_TOTAL:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: total number of bytes supposed to be
|
|
|
|
* transferred, as VIR_TYPED_PARAM_ULLONG. For VIR_DOMAIN_JOB_UNBOUNDED
|
|
|
|
* jobs, this may be less than the sum of VIR_DOMAIN_JOB_DATA_PROCESSED and
|
|
|
|
* VIR_DOMAIN_JOB_DATA_REMAINING in the event that the hypervisor has to
|
|
|
|
* repeat some data, e.g., due to dirtied pages during migration. For
|
|
|
|
* VIR_DOMAIN_JOB_BOUNDED jobs, VIR_DOMAIN_JOB_DATA_TOTAL shall always equal
|
|
|
|
* VIR_DOMAIN_JOB_DATA_PROCESSED + VIR_DOMAIN_JOB_DATA_REMAINING.
|
|
|
|
*
|
|
|
|
* This field corresponds to dataTotal field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DATA_TOTAL "data_total"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DATA_PROCESSED:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of bytes transferred from the
|
|
|
|
* beginning of the job, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to dataProcessed field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DATA_PROCESSED "data_processed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DATA_REMAINING:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of bytes that still need to be
|
|
|
|
* transferred, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to dataRemaining field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DATA_REMAINING "data_remaining"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_TOTAL:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only
|
|
|
|
* tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to memTotal field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_TOTAL "memory_total"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_PROCESSED:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_PROCESSED but only
|
|
|
|
* tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to memProcessed field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_PROCESSED "memory_processed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_REMAINING:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_REMAINING but only
|
|
|
|
* tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to memRemaining field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_REMAINING "memory_remaining"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_CONSTANT:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of pages filled with a constant
|
|
|
|
* byte (all bytes in a single page are identical) transferred since the
|
|
|
|
* beginning of the migration job, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* The most common example of such pages are zero pages, i.e., pages filled
|
|
|
|
* with zero bytes.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_CONSTANT "memory_constant"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_NORMAL:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of pages that were transferred without
|
|
|
|
* any kind of compression (i.e., pages which were not filled with a constant
|
|
|
|
* byte and which could not be compressed) transferred since the beginning
|
|
|
|
* of the migration job, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_NORMAL "memory_normal"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of bytes transferred as normal pages,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* See VIR_DOMAIN_JOB_MEMORY_NORMAL for more details.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES "memory_normal_bytes"
|
|
|
|
|
2014-01-13 00:28:10 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_MEMORY_BPS:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: network throughput used while migrating
|
|
|
|
* memory in Bytes per second, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_MEMORY_BPS "memory_bps"
|
|
|
|
|
2013-01-25 17:30:49 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DISK_TOTAL:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only
|
|
|
|
* tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to fileTotal field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DISK_TOTAL "disk_total"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DISK_PROCESSED:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_PROCESSED but only
|
|
|
|
* tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to fileProcessed field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DISK_PROCESSED "disk_processed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DISK_REMAINING:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_REMAINING but only
|
|
|
|
* tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*
|
|
|
|
* This field corresponds to fileRemaining field in virDomainJobInfo.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DISK_REMAINING "disk_remaining"
|
|
|
|
|
2014-01-13 00:28:10 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_DISK_BPS:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: network throughput used while migrating
|
|
|
|
* disks in Bytes per second, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_DISK_BPS "disk_bps"
|
|
|
|
|
2013-01-25 17:30:49 -06:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_COMPRESSION_CACHE:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: size of the cache (in bytes) used for
|
|
|
|
* compressing repeatedly transferred memory pages during live migration,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_COMPRESSION_CACHE "compression_cache"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_COMPRESSION_BYTES:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of compressed bytes transferred
|
|
|
|
* since the beginning of migration, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_COMPRESSION_BYTES "compression_bytes"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_COMPRESSION_PAGES:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of compressed pages transferred
|
|
|
|
* since the beginning of migration, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_COMPRESSION_PAGES "compression_pages"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of repeatedly changing pages that
|
|
|
|
* were not found in compression cache and thus could not be compressed,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES "compression_cache_misses"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW:
|
|
|
|
*
|
|
|
|
* virDomainGetJobStats field: number of repeatedly changing pages that
|
|
|
|
* were found in compression cache but were sent uncompressed because
|
|
|
|
* the result of compression was larger than the original page as a whole,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "compression_overflow"
|
|
|
|
|
|
|
|
|
2010-02-03 05:31:45 -06:00
|
|
|
|
2013-12-19 06:49:35 -06:00
|
|
|
/**
|
2010-10-13 05:19:02 -05:00
|
|
|
* virConnectDomainEventGenericCallback:
|
|
|
|
* @conn: the connection pointer
|
|
|
|
* @dom: the domain pointer
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
2013-12-19 06:49:35 -06:00
|
|
|
* A generic domain event callback handler, for use with
|
|
|
|
* virConnectDomainEventRegisterAny(). Specific events usually
|
|
|
|
* have a customization with extra parameters, often with @opaque being
|
|
|
|
* passed in a different parameter position; use VIR_DOMAIN_EVENT_CALLBACK()
|
|
|
|
* when registering an appropriate handler.
|
2010-10-13 05:19:02 -05:00
|
|
|
*/
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
void *opaque);
|
|
|
|
|
2010-03-18 13:28:15 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventRTCChangeCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @utcoffset: the new RTC offset from UTC, measured in seconds
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_RTC_CHANGE with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
long long utcoffset,
|
|
|
|
void *opaque);
|
|
|
|
|
Add support for an explicit watchdog event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_WATCHDOG
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
VIR_DOMAIN_EVENT_WATCHDOG_RESET,
VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
} virDomainEventWatchdogAction;
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
virDomainPtr dom,
int action,
void *opaque);
* daemon/remote.c: Dispatch watchdog events to client
* examples/domain-events/events-c/event-test.c: Watch for
watchdog events
* include/libvirt/libvirt.h.in: Define new watchdg event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle watchdog events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for watchdogs and emit a libvirt watchdog event
* src/remote/remote_driver.c: Receive and dispatch watchdog
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
watchdog events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
from QEMU monitor
2010-03-18 14:07:48 -05:00
|
|
|
/**
|
|
|
|
* virDomainEventWatchdogAction:
|
|
|
|
*
|
|
|
|
* The action that is to be taken due to the watchdog device firing
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0, /* No action, watchdog ignored */
|
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_PAUSE, /* Guest CPUs are paused */
|
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_RESET, /* Guest CPUs are reset */
|
2014-03-27 00:49:48 -05:00
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF, /* Guest is forcibly powered off */
|
Add support for an explicit watchdog event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_WATCHDOG
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
VIR_DOMAIN_EVENT_WATCHDOG_RESET,
VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
} virDomainEventWatchdogAction;
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
virDomainPtr dom,
int action,
void *opaque);
* daemon/remote.c: Dispatch watchdog events to client
* examples/domain-events/events-c/event-test.c: Watch for
watchdog events
* include/libvirt/libvirt.h.in: Define new watchdg event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle watchdog events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for watchdogs and emit a libvirt watchdog event
* src/remote/remote_driver.c: Receive and dispatch watchdog
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
watchdog events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
from QEMU monitor
2010-03-18 14:07:48 -05:00
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN, /* Guest is requested to gracefully shutdown */
|
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_DEBUG, /* No action, a debug message logged */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_WATCHDOG_LAST
|
|
|
|
#endif
|
Add support for an explicit watchdog event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_WATCHDOG
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
VIR_DOMAIN_EVENT_WATCHDOG_RESET,
VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
} virDomainEventWatchdogAction;
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
virDomainPtr dom,
int action,
void *opaque);
* daemon/remote.c: Dispatch watchdog events to client
* examples/domain-events/events-c/event-test.c: Watch for
watchdog events
* include/libvirt/libvirt.h.in: Define new watchdg event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle watchdog events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for watchdogs and emit a libvirt watchdog event
* src/remote/remote_driver.c: Receive and dispatch watchdog
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
watchdog events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
from QEMU monitor
2010-03-18 14:07:48 -05:00
|
|
|
} virDomainEventWatchdogAction;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectDomainEventWatchdogCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @action: action that is to be taken due to watchdog firing
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_WATCHDOG with virConnectDomainEventRegisterAny()
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
int action,
|
|
|
|
void *opaque);
|
|
|
|
|
Add support for an explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
} virDomainEventIOErrorAction;
In addition it has the source path of the disk that had the
error and its unique device alias. It does not include the
target device name (/dev/sda), since this would preclude
triggering IO errors from other file backed devices (eg
serial ports connected to a file)
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
/**
|
|
|
|
* virDomainEventIOErrorAction:
|
|
|
|
*
|
2012-10-11 11:31:20 -05:00
|
|
|
* The action that is to be taken due to an IO error occurring
|
Add support for an explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
} virDomainEventIOErrorAction;
In addition it has the source path of the disk that had the
error and its unique device alias. It does not include the
target device name (/dev/sda), since this would preclude
triggering IO errors from other file backed devices (eg
serial ports connected to a file)
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0, /* No action, IO error ignored */
|
2013-12-11 06:30:53 -06:00
|
|
|
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE, /* Guest CPUs are paused */
|
Add support for an explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
} virDomainEventIOErrorAction;
In addition it has the source path of the disk that had the
error and its unique device alias. It does not include the
target device name (/dev/sda), since this would preclude
triggering IO errors from other file backed devices (eg
serial ports connected to a file)
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
VIR_DOMAIN_EVENT_IO_ERROR_REPORT, /* IO error reported to guest OS */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_IO_ERROR_LAST
|
|
|
|
#endif
|
Add support for an explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
} virDomainEventIOErrorAction;
In addition it has the source path of the disk that had the
error and its unique device alias. It does not include the
target device name (/dev/sda), since this would preclude
triggering IO errors from other file backed devices (eg
serial ports connected to a file)
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
} virDomainEventIOErrorAction;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2010-10-13 05:19:02 -05:00
|
|
|
* virConnectDomainEventIOErrorCallback:
|
Add support for an explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
} virDomainEventIOErrorAction;
In addition it has the source path of the disk that had the
error and its unique device alias. It does not include the
target device name (/dev/sda), since this would preclude
triggering IO errors from other file backed devices (eg
serial ports connected to a file)
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @srcPath: The host file on which the IO error occurred
|
|
|
|
* @devAlias: The guest device alias associated with the path
|
|
|
|
* @action: action that is to be taken due to the IO error
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_IO_ERROR with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
const char *srcPath,
|
|
|
|
const char *devAlias,
|
|
|
|
int action,
|
|
|
|
void *opaque);
|
|
|
|
|
Add support for another explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
event, but also includes a string describing the cause of
the event.
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
const char *reason,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
/**
|
2010-10-13 05:19:02 -05:00
|
|
|
* virConnectDomainEventIOErrorReasonCallback:
|
Add support for another explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
event, but also includes a string describing the cause of
the event.
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
const char *reason,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @srcPath: The host file on which the IO error occurred
|
|
|
|
* @devAlias: The guest device alias associated with the path
|
|
|
|
* @action: action that is to be taken due to the IO error
|
|
|
|
* @reason: the cause of the IO error
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
2014-01-22 01:51:17 -06:00
|
|
|
* VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON with virConnectDomainEventRegisterAny()
|
Add support for another explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
event, but also includes a string describing the cause of
the event.
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
const char *reason,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
*
|
qemu: support nospace reason in io error event
Aeons ago (commit 34dcbbb4, v0.8.2), we added a new libvirt event
(VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON) in order to tell the user WHY
the guest halted. This is because at least VDSM wants to react
differently to ENOSPC events (resize the lvm partition to be larger,
and resume the guest as if nothing had happened) from all other events
(I/O is hosed, throw up our hands and flag things as broken). At the
time this was done, downstream RHEL qemu added a vendor extension
'__com.redhat_reason', which would be exactly one of these strings:
"enospc", "eperm", "eio", and "eother". In our stupidity, we exposed
those exact strings to clients, rather than an enum, and we also
return "" if we did not have access to a reason (which was the case
for upstream qemu).
Fast forward to now: upstream qemu commit c7c2ff0c (will be qemu 2.2)
FINALLY adds a 'nospace' boolean, after discussion with multiple
projects determined that VDSM really doesn't care about distinction
between any other error types. So this patch converts 'nospace' into
the string "enospc" for compatibility with RHEL clients that were
already used to the downstream extension, while leaving the reason
blank for all other cases (no change from the status quo).
See also https://bugzilla.redhat.com/show_bug.cgi?id=1119784
* src/qemu/qemu_monitor_json.c (qewmuMonitorJSONHandleIOError):
Parse reason field from modern qemu.
* include/libvirt/libvirt.h.in
(virConnectDomainEventIOErrorReasonCallback): Document it.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-10-03 09:46:25 -05:00
|
|
|
* If the I/O error is known to be caused by an ENOSPC condition in
|
|
|
|
* the host (where resizing the disk to be larger will allow the guest
|
|
|
|
* to be resumed as if nothing happened), @reason will be "enospc".
|
|
|
|
* Otherwise, @reason will be "", although future strings may be added
|
|
|
|
* if determination of other error types becomes possible.
|
|
|
|
*
|
Add support for another explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
event, but also includes a string describing the cause of
the event.
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
const char *reason,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
const char *srcPath,
|
|
|
|
const char *devAlias,
|
|
|
|
int action,
|
|
|
|
const char *reason,
|
|
|
|
void *opaque);
|
|
|
|
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
/**
|
|
|
|
* virDomainEventGraphicsPhase:
|
|
|
|
*
|
|
|
|
* The phase of the graphics client connection
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0, /* Initial socket connection established */
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE, /* Authentication & setup completed */
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT, /* Final socket disconnection */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_LAST
|
|
|
|
#endif
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
} virDomainEventGraphicsPhase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventGraphicsAddressType:
|
|
|
|
*
|
|
|
|
* The type of address for the connection
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4, /* IPv4 address */
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6, /* IPv6 address */
|
2011-10-21 03:14:02 -05:00
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX, /* UNIX socket path */
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST
|
|
|
|
#endif
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
} virDomainEventGraphicsAddressType;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventGraphicsAddress:
|
|
|
|
*
|
|
|
|
* The data structure containing connection address details
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
struct _virDomainEventGraphicsAddress {
|
|
|
|
int family; /* Address family, virDomainEventGraphicsAddressType */
|
2013-05-19 05:48:11 -05:00
|
|
|
char *node; /* Address of node (eg IP address, or UNIX path) */
|
|
|
|
char *service; /* Service name/number (eg TCP port, or NULL) */
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
};
|
|
|
|
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
|
|
|
|
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventGraphicsSubjectIdentity:
|
|
|
|
*
|
|
|
|
* The data structure representing a single identity
|
|
|
|
*
|
|
|
|
* The types of identity differ according to the authentication scheme,
|
|
|
|
* some examples are 'x509dname' and 'saslUsername'.
|
|
|
|
*/
|
|
|
|
struct _virDomainEventGraphicsSubjectIdentity {
|
2013-05-19 05:48:11 -05:00
|
|
|
char *type; /* Type of identity */
|
|
|
|
char *name; /* Identity value */
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
};
|
|
|
|
typedef struct _virDomainEventGraphicsSubjectIdentity virDomainEventGraphicsSubjectIdentity;
|
|
|
|
typedef virDomainEventGraphicsSubjectIdentity *virDomainEventGraphicsSubjectIdentityPtr;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virDomainEventGraphicsSubject:
|
|
|
|
*
|
|
|
|
* The data structure representing an authenticated subject
|
|
|
|
*
|
|
|
|
* A subject will have zero or more identities. The types of
|
|
|
|
* identity differ according to the authentication scheme
|
|
|
|
*/
|
|
|
|
struct _virDomainEventGraphicsSubject {
|
|
|
|
int nidentity; /* Number of identities in array*/
|
|
|
|
virDomainEventGraphicsSubjectIdentityPtr identities; /* Array of identities for subject */
|
|
|
|
};
|
|
|
|
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
|
|
|
|
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectDomainEventGraphicsCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @phase: the phase of the connection
|
|
|
|
* @local: the local server address
|
|
|
|
* @remote: the remote client address
|
|
|
|
* @authScheme: the authentication scheme activated
|
|
|
|
* @subject: the authenticated subject (user)
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_GRAPHICS with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
int phase,
|
2013-10-07 13:36:00 -05:00
|
|
|
const virDomainEventGraphicsAddress *local,
|
|
|
|
const virDomainEventGraphicsAddress *remote,
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
const char *authScheme,
|
2013-10-07 13:36:00 -05:00
|
|
|
const virDomainEventGraphicsSubject *subject,
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
void *opaque);
|
|
|
|
|
2011-07-22 00:57:42 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventBlockJobStatus:
|
|
|
|
*
|
blockcommit: document semantics of committing active layer
Now that qemu 2.0 allows commit of the active layer, people are
attempting to use virsh blockcommit and getting into a stuck
state, because libvirt is unprepared to handle the two-phase
commit required by qemu.
Stepping back a bit, there are two valid semantics for a
commit operation:
1. Maintain a 'golden' base, and a transient overlay. Make
changes in the overlay, and if everything appears to work,
commit those changes into the base, but still keep the overlay
for the next round of changes; repeat the cycle as desired.
2. Create an external snapshot, then back up the stable state
in the backing file. Once the backup is complete, commit the
overlay back into the base, and delete the temporary snapshot.
Since qemu doesn't know up front which of the two styles is
preferred, a block commit of the active layer merely gets
the job into a synchronized state, and sends an event; then
the user must either cancel (case 1) or complete (case 2),
where qemu then sends a second event that actually ends the
job. However, until commit e6bcbcd, libvirt was blindly
assuming the semantics that apply to a commit of an
intermediate image, where there is only one sane conclusion
(the job automatically ends with fewer elements in the chain);
and getting stuck because it wasn't prepared for qemu to enter
a second phase of the job.
This patch adds a flag to the libvirt API that a user MUST
supply in order to acknowledge that they will be using two-phase
semantics. It might be possible to have a mode where if the
flag is omitted, we automatically do the case 2 semantics on
the user's behalf; but before that happens, I must do additional
patches to track the fact that we are doing an active commit
in the domain XML. Later patches will add support of the flag,
and once 2-phase semantics are working, we can then decide
whether to relax things to allow an omitted flag to cause an
automatic pivot.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)
(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT): New enums.
* src/libvirt.c (virDomainBlockCommit): Document two-phase job
when committing active layer, through new flag.
(virDomainBlockJobAbort): Document that pivot also occurs after
active commit.
* tools/virsh-domain.c (vshDomainBlockJob): Cover new job.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Explicitly
reject active copy; later patches will add it in.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-05-16 14:48:43 -05:00
|
|
|
* Tracks status of a virDomainBlockPull(), virDomainBlockRebase(),
|
blockcopy: virDomainBlockCopy with XML destination, typed params
This commit (finally) adds the virDomainBlockCopy API, with the
intent that it will provide more power to the existing 'virsh
blockcopy' command.
'virsh blockcopy' was first added in Apr 2012 (v0.9.12), which
corresponds to the upstream qemu 1.2 timeframe. It was done as
a hack on top of the existing virDomainBlockRebase() API call,
for two reasons: 1) it was targetting a feature that landed first
in downstream RHEL qemu, but had not stabilized in upstream qemu
at the time (and indeed, 'drive-mirror' only landed upstream in
qemu 1.3 with slight differences to the first RHEL attempt,
and later gained further parameters like granularity and buf-size
that are also worth exposing), and 2) extending an existing API
allowed it to be backported without worrying about bumping .so
versions. A virDomainBlockCopy() API was proposed at that time
[1], but we decided not to accept it into libvirt until after
upstream qemu stabilized, and it ended up getting scrapped.
Whether or not RHEL should have attempted adding a new feature
without getting it upstream first is a debate that can be held
another day; but enough time has now elapsed that we are ready to
do the interface cleanly.
[1] https://www.redhat.com/archives/libvir-list/2012-April/msg00768.html
Delaying the creation of a clean API until now has also had a
benefit: we've only recently learned of a few shortcomings in the
original design: 1) it is unable to target a network destination
(such as a gluster volume) because it hard-coded the assumption
that the destination is a local file name. Because of all the
refactoring we've done to add virStorageSourcePtr, we are in a
better position to declare an API that parses XML describing a
host storage source as the copy destination, which was not
possible had we implemented virDomainBlockCopy as it had been
originally envisioned (although a network target will have to wait
until a later libvirt release compared to the API addition to
actually be implemented). 2) the design of using MiB/sec as the
bandwidth throttle is rather coarse; qemu is actually tuned to
bytes/second, and libvirt is preventing access to that level of
detail. A later patch will add flags to existing block job API
that can request bytes/second instead of back-compat MiB/s, but as
this is a new API, we can get it right to begin with.
At least I had the foresight to create 'virsh blockcopy' as a
separate command at the UI level (commit 1f06c00) rather than
leaking the underlying API overload of virDomainBlockRebase onto
shell users.
A further note on the bandwidth option: virTypedParameters
intentionally lacks unsigned long (since variable-width
interaction between mixed 32- vs. 64-bit client/server setups is
nasty), but we have to deal with the fact that we are interacting
with existing older code that mistakenly chose unsigned long
bandwidth at a point before we decided to prohibit it in all new
API. The typed parameter is therefore unsigned long long, but
the implementation (in a later patch) will have to do overflow
detection on 32-bit platforms, as well as capping the value to
match the LLONG_MAX>>20 cap of the existing MiB/s interfaces.
* include/libvirt/libvirt.h.in (virDomainBlockCopy): New API.
(virDomainBlockJobType, virConnectDomainEventBlockJobStatus):
Update related documentation.
* src/libvirt.c (virDomainBlockCopy): Implement it.
* src/libvirt_public.syms (LIBVIRT_1.2.8): Export it.
* src/driver.h (_virDriver): New driver callback.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-08-26 16:16:48 -05:00
|
|
|
* virDomainBlockCopy(), or virDomainBlockCommit() operation
|
2011-07-22 00:57:42 -05:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_COMPLETED = 0,
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_FAILED = 1,
|
blockjob: add API for async virDomainBlockJobAbort
Block job cancellation can take a while. Now that upstream qemu 1.1
has asynchronous block cancellation, we want to expose that to the user.
Therefore, the following updates are made to the virDomainBlockJob API:
A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
libvirt. Regardless of the flags used with virDomainBlockJobAbort, this
event will be raised: 1. when using synchronous block_job_cancel (the
event will be synthesized by libvirt), and 2. whenever it is received
from qemu (via asynchronous block-job-cancel). Note that the event
may be detected by libvirt even before the virDomainBlockJobAbort
completes (always true when it is synthesized, but also possible if
cancellation was fast).
A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
virDomainBlockJobAbort API. When enabled, this function will allow
(but not require) asynchronous operation (ie, it returns as soon as
possible, which might be before the job has actually been canceled).
When the API is used in this mode, it is the responsibility of the
caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
the virDomainGetBlockJobInfo API to check the cancellation status.
This patch also exposes the new flag through virsh, and makes virsh
slightly easier to use (--async implies --abort, and lack of any options
implies --info), although it leaves the qemu implementation for later
patches.
Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-01-13 14:51:23 -06:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_CANCELED = 2,
|
2012-10-12 15:06:10 -05:00
|
|
|
VIR_DOMAIN_BLOCK_JOB_READY = 3,
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_BLOCK_JOB_LAST
|
|
|
|
#endif
|
2011-07-22 00:57:42 -05:00
|
|
|
} virConnectDomainEventBlockJobStatus;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectDomainEventBlockJobCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
blockjob: use stable disk string in job event
When the block job event was first added, it was for block pull,
where the active layer of the disk remains the same name. It was
also in a day where we only cared about local files, and so we
always had a canonical absolute file name. But two things have
changed since then: we now have network disks, where determining
a single absolute string does not really make sense; and we have
two-phase jobs (copy and active commit) where the name of the
active layer changes between the first event (ready, on the old
name) and second (complete, on the pivoted name).
Adam Litke reported that having an unstable string between events
makes life harder for clients. Furthermore, all of our API that
operate on a particular disk of a domain accept multiple strings:
not only the absolute name of the active layer, but also the
destination device name (such as 'vda'). As this latter name is
stable, even for network sources, it serves as a better string
to supply in block job events.
But backwards-compatibility demands that we should not change the
name handed to users unless they explicitly request it. Therefore,
this patch adds a new event, BLOCK_JOB_2 (alas, I couldn't think of
any nicer name - but at least Migrate2 and Migrate3 are precedent
for a number suffix). We must double up on emitting both old-style
and new-style events according to what clients have registered for
(see also how IOError and IOErrorReason emits double events, but
there the difference was a larger struct rather than changed
meaning of one of the struct members).
Unfortunately, adding a new event isn't something that can easily
be broken into pieces, so the commit is rather large.
* include/libvirt/libvirt.h.in (virDomainEventID): Add a new id
for VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2.
(virConnectDomainEventBlockJobCallback): Document new semantics.
* src/conf/domain_event.c (_virDomainEventBlockJob): Rename field,
to ensure we catch all clients.
(virDomainEventBlockJobNew): Add parameter.
(virDomainEventBlockJobDispose)
(virDomainEventBlockJobNewFromObj)
(virDomainEventBlockJobNewFromDom)
(virDomainEventDispatchDefaultFunc): Adjust clients.
(virDomainEventBlockJob2NewFromObj)
(virDomainEventBlockJob2NewFromDom): New functions.
* src/conf/domain_event.h: Add new prototypes.
* src/libvirt_private.syms (domain_event.h): Export new functions.
* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Generate two
different events.
* src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Likewise.
* src/remote/remote_protocol.x
(remote_domain_event_block_job_2_msg): New struct.
(REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2): New RPC.
* src/remote/remote_driver.c
(remoteDomainBuildEventBlockJob2): New handler.
(remoteEvents): Register new event.
* daemon/remote.c (remoteRelayDomainEventBlockJob2): New handler.
(domainEventCallbacks): Register new event.
* tools/virsh-domain.c (vshEventCallbacks): Likewise.
(vshEventBlockJobPrint): Adjust client.
* src/remote_protocol-structs: Regenerate.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-06-14 08:18:04 -05:00
|
|
|
* @disk: name associated with the affected disk (filename or target
|
|
|
|
* device, depending on how the callback was registered)
|
2011-07-22 00:57:42 -05:00
|
|
|
* @type: type of block job (virDomainBlockJobType)
|
blockcommit: document semantics of committing active layer
Now that qemu 2.0 allows commit of the active layer, people are
attempting to use virsh blockcommit and getting into a stuck
state, because libvirt is unprepared to handle the two-phase
commit required by qemu.
Stepping back a bit, there are two valid semantics for a
commit operation:
1. Maintain a 'golden' base, and a transient overlay. Make
changes in the overlay, and if everything appears to work,
commit those changes into the base, but still keep the overlay
for the next round of changes; repeat the cycle as desired.
2. Create an external snapshot, then back up the stable state
in the backing file. Once the backup is complete, commit the
overlay back into the base, and delete the temporary snapshot.
Since qemu doesn't know up front which of the two styles is
preferred, a block commit of the active layer merely gets
the job into a synchronized state, and sends an event; then
the user must either cancel (case 1) or complete (case 2),
where qemu then sends a second event that actually ends the
job. However, until commit e6bcbcd, libvirt was blindly
assuming the semantics that apply to a commit of an
intermediate image, where there is only one sane conclusion
(the job automatically ends with fewer elements in the chain);
and getting stuck because it wasn't prepared for qemu to enter
a second phase of the job.
This patch adds a flag to the libvirt API that a user MUST
supply in order to acknowledge that they will be using two-phase
semantics. It might be possible to have a mode where if the
flag is omitted, we automatically do the case 2 semantics on
the user's behalf; but before that happens, I must do additional
patches to track the fact that we are doing an active commit
in the domain XML. Later patches will add support of the flag,
and once 2-phase semantics are working, we can then decide
whether to relax things to allow an omitted flag to cause an
automatic pivot.
* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)
(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT): New enums.
* src/libvirt.c (virDomainBlockCommit): Document two-phase job
when committing active layer, through new flag.
(virDomainBlockJobAbort): Document that pivot also occurs after
active commit.
* tools/virsh-domain.c (vshDomainBlockJob): Cover new job.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Explicitly
reject active copy; later patches will add it in.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-05-16 14:48:43 -05:00
|
|
|
* @status: status of the operation (virConnectDomainEventBlockJobStatus)
|
2013-01-30 01:38:25 -06:00
|
|
|
* @opaque: application specified data
|
2011-07-22 00:57:42 -05:00
|
|
|
*
|
blockjob: use stable disk string in job event
When the block job event was first added, it was for block pull,
where the active layer of the disk remains the same name. It was
also in a day where we only cared about local files, and so we
always had a canonical absolute file name. But two things have
changed since then: we now have network disks, where determining
a single absolute string does not really make sense; and we have
two-phase jobs (copy and active commit) where the name of the
active layer changes between the first event (ready, on the old
name) and second (complete, on the pivoted name).
Adam Litke reported that having an unstable string between events
makes life harder for clients. Furthermore, all of our API that
operate on a particular disk of a domain accept multiple strings:
not only the absolute name of the active layer, but also the
destination device name (such as 'vda'). As this latter name is
stable, even for network sources, it serves as a better string
to supply in block job events.
But backwards-compatibility demands that we should not change the
name handed to users unless they explicitly request it. Therefore,
this patch adds a new event, BLOCK_JOB_2 (alas, I couldn't think of
any nicer name - but at least Migrate2 and Migrate3 are precedent
for a number suffix). We must double up on emitting both old-style
and new-style events according to what clients have registered for
(see also how IOError and IOErrorReason emits double events, but
there the difference was a larger struct rather than changed
meaning of one of the struct members).
Unfortunately, adding a new event isn't something that can easily
be broken into pieces, so the commit is rather large.
* include/libvirt/libvirt.h.in (virDomainEventID): Add a new id
for VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2.
(virConnectDomainEventBlockJobCallback): Document new semantics.
* src/conf/domain_event.c (_virDomainEventBlockJob): Rename field,
to ensure we catch all clients.
(virDomainEventBlockJobNew): Add parameter.
(virDomainEventBlockJobDispose)
(virDomainEventBlockJobNewFromObj)
(virDomainEventBlockJobNewFromDom)
(virDomainEventDispatchDefaultFunc): Adjust clients.
(virDomainEventBlockJob2NewFromObj)
(virDomainEventBlockJob2NewFromDom): New functions.
* src/conf/domain_event.h: Add new prototypes.
* src/libvirt_private.syms (domain_event.h): Export new functions.
* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Generate two
different events.
* src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Likewise.
* src/remote/remote_protocol.x
(remote_domain_event_block_job_2_msg): New struct.
(REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2): New RPC.
* src/remote/remote_driver.c
(remoteDomainBuildEventBlockJob2): New handler.
(remoteEvents): Register new event.
* daemon/remote.c (remoteRelayDomainEventBlockJob2): New handler.
(domainEventCallbacks): Register new event.
* tools/virsh-domain.c (vshEventCallbacks): Likewise.
(vshEventBlockJobPrint): Adjust client.
* src/remote_protocol-structs: Regenerate.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-06-14 08:18:04 -05:00
|
|
|
* The string returned for @disk can be used in any of the libvirt API
|
|
|
|
* that operate on a particular disk of the domain, and depends on what
|
|
|
|
* event type was registered with virConnectDomainEventRegisterAny().
|
|
|
|
* If the callback was registered using the older type of
|
|
|
|
* VIR_DOMAIN_EVENT_ID_BLOCK_JOB, then @disk contains the absolute file
|
|
|
|
* name of the host resource for the active layer of the disk; however,
|
|
|
|
* this name is unstable (pivoting via block copy or active block commit
|
|
|
|
* will change which file is active, giving a different name for the two
|
|
|
|
* events associated with the same job) and cannot be relied on if the
|
|
|
|
* active layer is associated with a network resource. If the callback
|
|
|
|
* was registered using the newer type of VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2,
|
|
|
|
* then @disk will contain the device target shorthand (the <target
|
|
|
|
* dev='...'/> sub-element, such as "vda").
|
2011-07-22 00:57:42 -05:00
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventBlockJobCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
2011-11-22 18:15:43 -06:00
|
|
|
const char *disk,
|
2011-07-22 00:57:42 -05:00
|
|
|
int type,
|
|
|
|
int status,
|
|
|
|
void *opaque);
|
|
|
|
|
2011-10-18 09:15:42 -05:00
|
|
|
/**
|
2011-11-04 07:16:19 -05:00
|
|
|
* virConnectDomainEventDiskChangeReason:
|
2011-10-18 09:15:42 -05:00
|
|
|
*
|
|
|
|
* The reason describing why this callback is called
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2011-11-04 07:16:19 -05:00
|
|
|
VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START = 0, /* oldSrcPath is set */
|
2013-08-07 02:11:15 -05:00
|
|
|
VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START = 1,
|
2012-01-20 12:43:28 -06:00
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_DISK_CHANGE_LAST
|
|
|
|
#endif
|
2011-10-18 09:15:42 -05:00
|
|
|
} virConnectDomainEventDiskChangeReason;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectDomainEventDiskChangeCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @oldSrcPath: old source path
|
|
|
|
* @newSrcPath: new source path
|
2012-03-05 04:41:20 -06:00
|
|
|
* @devAlias: device alias name
|
2011-10-18 09:15:42 -05:00
|
|
|
* @reason: reason why this callback was called; any of
|
|
|
|
* virConnectDomainEventDiskChangeReason
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* This callback occurs when disk gets changed. However,
|
|
|
|
* not all @reason will cause both @oldSrcPath and @newSrcPath
|
|
|
|
* to be non-NULL. Please see virConnectDomainEventDiskChangeReason
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
2012-03-05 04:41:20 -06:00
|
|
|
* VIR_DOMAIN_EVENT_ID_DISK_CHANGE with virConnectDomainEventRegisterAny()
|
2011-10-18 09:15:42 -05:00
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventDiskChangeCallback)(virConnectPtr conn,
|
2013-01-10 06:49:09 -06:00
|
|
|
virDomainPtr dom,
|
|
|
|
const char *oldSrcPath,
|
|
|
|
const char *newSrcPath,
|
|
|
|
const char *devAlias,
|
|
|
|
int reason,
|
|
|
|
void *opaque);
|
2011-10-18 09:15:42 -05:00
|
|
|
|
2012-03-23 08:44:50 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventTrayChangeReason:
|
|
|
|
*
|
|
|
|
* The reason describing why the callback was called
|
|
|
|
*/
|
2012-03-23 15:23:43 -05:00
|
|
|
typedef enum {
|
2012-03-23 08:44:50 -05:00
|
|
|
VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0,
|
|
|
|
VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE,
|
|
|
|
|
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
|
|
|
VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST
|
|
|
|
#endif
|
|
|
|
} virDomainEventTrayChangeReason;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectDomainEventTrayChangeCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @devAlias: device alias
|
|
|
|
* @reason: why the tray status was changed?
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* This callback occurs when the tray of a removable device is moved.
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_TRAY_CHANGE with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
const char *devAlias,
|
|
|
|
int reason,
|
|
|
|
void *opaque);
|
|
|
|
|
2012-03-23 09:43:14 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventPMWakeupCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @reason: reason why the callback was called, unused currently,
|
|
|
|
* always passes 0
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
2014-01-15 01:19:37 -06:00
|
|
|
* This callback occurs when the guest is woken up.
|
2012-03-23 09:43:14 -05:00
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_PMWAKEUP with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventPMWakeupCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
int reason,
|
|
|
|
void *opaque);
|
2012-03-23 08:44:50 -05:00
|
|
|
|
2012-03-23 09:50:36 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventPMSuspendCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @reason: reason why the callback was called, unused currently,
|
|
|
|
* always passes 0
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
2014-01-15 01:19:37 -06:00
|
|
|
* This callback occurs when the guest is suspended.
|
2012-03-23 09:50:36 -05:00
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
2013-04-25 14:56:08 -05:00
|
|
|
* VIR_DOMAIN_EVENT_ID_PMSUSPEND with virConnectDomainEventRegisterAny()
|
2012-03-23 09:50:36 -05:00
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventPMSuspendCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
int reason,
|
|
|
|
void *opaque);
|
|
|
|
|
2012-07-13 04:05:17 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* virConnectDomainEventBalloonChangeCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @actual: the new balloon level measured in kibibytes(blocks of 1024 bytes)
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventBalloonChangeCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
unsigned long long actual,
|
|
|
|
void *opaque);
|
|
|
|
|
2012-10-12 14:13:39 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventPMSuspendDiskCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @reason: reason why the callback was called, unused currently,
|
|
|
|
* always passes 0
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* This callback occurs when the guest is suspended to disk.
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventPMSuspendDiskCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
int reason,
|
|
|
|
void *opaque);
|
|
|
|
|
2013-06-19 08:27:29 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventDeviceRemovedCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @devAlias: device alias
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* This callback occurs when a device is removed from the domain.
|
|
|
|
*
|
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
const char *devAlias,
|
|
|
|
void *opaque);
|
|
|
|
|
2014-09-09 09:34:12 -05:00
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_VCPUPIN:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents formatted pinning for one vcpu specified by id which is
|
|
|
|
* appended to the parameter name, for example "cputune.vcpupin1",
|
|
|
|
* as VIR_TYPED_PARAM_STRING.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_VCPUPIN "cputune.vcpupin%u"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-26 05:20:56 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents formatted pinning for emulator process,
|
|
|
|
* as VIR_TYPED_PARAM_STRING.
|
|
|
|
*/
|
2014-09-26 05:20:56 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN "cputune.emulatorpin"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents proportional weight of the scheduler used on the
|
|
|
|
* host cpu, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES "cputune.cpu_shares"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents the enforcement period for a quota, in microseconds,
|
|
|
|
* for vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD "cputune.vcpu_period"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents the maximum bandwidth to be used within a period for
|
|
|
|
* vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_LLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA "cputune.vcpu_quota"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents the enforcement period for a quota in microseconds,
|
|
|
|
* when using the posix scheduler, for all emulator activity not tied to
|
|
|
|
* vcpus, as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD "cputune.emulator_period"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA:
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
|
|
|
* Macro represents the maximum bandwidth to be used within a period for
|
|
|
|
* all emulator activity not tied to vcpus, when using the posix scheduler,
|
|
|
|
* as an VIR_TYPED_PARAM_LLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA "cputune.emulator_quota"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
2014-09-25 04:30:57 -05:00
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_DISK:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Macro represents the name of guest disk for which the values are updated,
|
|
|
|
* as VIR_TYPED_PARAM_STRING.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_DISK "blkdeviotune.disk"
|
2014-09-25 04:30:57 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Marco represents the total throughput limit in bytes per second,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec"
|
2014-09-25 04:30:57 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Marco represents the read throughput limit in bytes per second,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC "blkdeviotune.read_bytes_sec"
|
2014-09-25 04:30:57 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Macro represents the write throughput limit in bytes per second,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec"
|
2014-09-25 04:30:57 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Macro represents the total I/O operations per second,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec"
|
2014-09-25 04:30:57 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Macro represents the read I/O operations per second,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC "blkdeviotune.read_iops_sec"
|
2014-09-25 04:30:57 -05:00
|
|
|
|
|
|
|
/**
|
2014-09-25 11:48:01 -05:00
|
|
|
* VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC:
|
2014-09-25 04:30:57 -05:00
|
|
|
*
|
|
|
|
* Macro represents the write I/O operations per second,
|
|
|
|
* as VIR_TYPED_PARAM_ULLONG.
|
|
|
|
*/
|
2014-09-25 11:48:01 -05:00
|
|
|
#define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec"
|
2014-09-09 09:34:12 -05:00
|
|
|
|
2014-09-10 06:28:24 -05:00
|
|
|
/**
|
|
|
|
* virConnectDomainEventTunableCallback:
|
|
|
|
* @conn: connection object
|
|
|
|
* @dom: domain on which the event occurred
|
|
|
|
* @params: changed tunable values stored as array of virTypedParameter
|
|
|
|
* @nparams: size of the array
|
|
|
|
* @opaque: application specified data
|
|
|
|
*
|
|
|
|
* This callback occurs when tunable values are updated. The params must not
|
|
|
|
* be freed in the callback handler as it's done internally after the callback
|
|
|
|
* handler is executed.
|
|
|
|
*
|
2014-09-09 09:34:12 -05:00
|
|
|
* Currently supported name spaces:
|
|
|
|
* "cputune.*"
|
2014-09-25 04:30:57 -05:00
|
|
|
* "blkdeviotune.*"
|
2014-09-09 09:34:12 -05:00
|
|
|
*
|
2014-09-10 06:28:24 -05:00
|
|
|
* The callback signature to use when registering for an event of type
|
|
|
|
* VIR_DOMAIN_EVENT_ID_TUNABLE with virConnectDomainEventRegisterAny()
|
|
|
|
*/
|
|
|
|
typedef void (*virConnectDomainEventTunableCallback)(virConnectPtr conn,
|
|
|
|
virDomainPtr dom,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
void *opaque);
|
|
|
|
|
2012-10-12 14:13:39 -05:00
|
|
|
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_EVENT_CALLBACK:
|
|
|
|
*
|
|
|
|
* Used to cast the event specific callback into the generic one
|
2013-12-19 06:49:35 -06:00
|
|
|
* for use for virConnectDomainEventRegisterAny()
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_EVENT_CALLBACK(cb) ((virConnectDomainEventGenericCallback)(cb))
|
|
|
|
|
|
|
|
|
2013-12-19 06:49:35 -06:00
|
|
|
/**
|
|
|
|
* virDomainEventID:
|
|
|
|
*
|
|
|
|
* An enumeration of supported eventId parameters for
|
|
|
|
* virConnectDomainEventRegisterAny(). Each event id determines which
|
|
|
|
* signature of callback function will be used.
|
|
|
|
*/
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
|
2010-03-18 10:25:38 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_REBOOT = 1, /* virConnectDomainEventGenericCallback */
|
2010-03-18 13:28:15 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_RTC_CHANGE = 2, /* virConnectDomainEventRTCChangeCallback */
|
Add support for an explicit watchdog event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_WATCHDOG
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
VIR_DOMAIN_EVENT_WATCHDOG_RESET,
VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
} virDomainEventWatchdogAction;
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
virDomainPtr dom,
int action,
void *opaque);
* daemon/remote.c: Dispatch watchdog events to client
* examples/domain-events/events-c/event-test.c: Watch for
watchdog events
* include/libvirt/libvirt.h.in: Define new watchdg event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle watchdog events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for watchdogs and emit a libvirt watchdog event
* src/remote/remote_driver.c: Receive and dispatch watchdog
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
watchdog events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
from QEMU monitor
2010-03-18 14:07:48 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_WATCHDOG = 3, /* virConnectDomainEventWatchdogCallback */
|
Add support for an explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR
This event includes the action that is about to be taken
as a result of the watchdog triggering
typedef enum {
VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
} virDomainEventIOErrorAction;
In addition it has the source path of the disk that had the
error and its unique device alias. It does not include the
target device name (/dev/sda), since this would preclude
triggering IO errors from other file backed devices (eg
serial ports connected to a file)
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_IO_ERROR = 4, /* virConnectDomainEventIOErrorCallback */
|
Add domain events for graphics network clients
This introduces a new event type
VIR_DOMAIN_EVENT_ID_GRAPHICS
The same event can be emitted in 3 scenarios
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
} virDomainEventGraphicsPhase;
Connect/disconnect are triggered at socket accept/close.
The initialize phase is immediately after the protocol
setup and authentication has completed. ie when the
client is authorized and about to start interacting with
the graphical desktop
This event comes with *a lot* of potential information
- IP address, port & address family of client
- IP address, port & address family of server
- Authentication scheme (arbitrary string)
- Authenticated subject identity. A subject may have
multiple identities with some authentication schemes.
For example, vencrypt+sasl results in a x509dname
and saslUsername identities.
This results in a very complicated callback :-(
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
} virDomainEventGraphicsAddressType;
struct _virDomainEventGraphicsAddress {
int family;
const char *node;
const char *service;
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
struct _virDomainEventGraphicsSubject {
int nidentity;
struct {
const char *type;
const char *name;
} *identities;
};
typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject,
void *opaque);
The wire protocol is similarly complex
struct remote_domain_event_graphics_address {
int family;
remote_nonnull_string node;
remote_nonnull_string service;
};
const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
struct remote_domain_event_graphics_identity {
remote_nonnull_string type;
remote_nonnull_string name;
};
struct remote_domain_event_graphics_msg {
remote_nonnull_domain dom;
int phase;
remote_domain_event_graphics_address local;
remote_domain_event_graphics_address remote;
remote_nonnull_string authScheme;
remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
};
This is currently implemented in QEMU for the VNC graphics
protocol, but designed to be usable with SPICE graphics in
the future too.
* daemon/remote.c: Dispatch graphics events to client
* examples/domain-events/events-c/event-test.c: Watch for
graphics events
* include/libvirt/libvirt.h.in: Define new graphics event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle graphics events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for VNC events and emit a libvirt graphics event
* src/remote/remote_driver.c: Receive and dispatch graphics
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
graphics events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
2010-03-19 08:27:45 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_GRAPHICS = 5, /* virConnectDomainEventGraphicsCallback */
|
Add support for another explicit IO error event
This introduces a new event type
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
event, but also includes a string describing the cause of
the event.
Thus there is a new callback definition for this event type
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
const char *reason,
void *opaque);
This is currently wired up to the QEMU block IO error events
* daemon/remote.c: Dispatch IO error events to client
* examples/domain-events/events-c/event-test.c: Watch for
IO error events
* include/libvirt/libvirt.h.in: Define new IO error event ID
and callback signature
* src/conf/domain_event.c, src/conf/domain_event.h,
src/libvirt_private.syms: Extend API to handle IO error events
* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
for block IO errors and emit a libvirt IO error event
* src/remote/remote_driver.c: Receive and dispatch IO error
events to application
* src/remote/remote_protocol.x: Wire protocol definition for
IO error events
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
from QEMU monitor
2010-03-18 14:37:44 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON = 6, /* virConnectDomainEventIOErrorReasonCallback */
|
2011-05-29 07:21:53 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_CONTROL_ERROR = 7, /* virConnectDomainEventGenericCallback */
|
2011-07-22 00:57:42 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_BLOCK_JOB = 8, /* virConnectDomainEventBlockJobCallback */
|
2011-10-18 09:15:42 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_DISK_CHANGE = 9, /* virConnectDomainEventDiskChangeCallback */
|
2012-03-23 08:44:50 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_TRAY_CHANGE = 10, /* virConnectDomainEventTrayChangeCallback */
|
2012-03-23 09:43:14 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_PMWAKEUP = 11, /* virConnectDomainEventPMWakeupCallback */
|
2012-03-23 09:50:36 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_PMSUSPEND = 12, /* virConnectDomainEventPMSuspendCallback */
|
2012-07-13 04:05:17 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE = 13, /* virConnectDomainEventBalloonChangeCallback */
|
2012-10-12 14:13:39 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK = 14, /* virConnectDomainEventPMSuspendDiskCallback */
|
2013-06-19 08:27:29 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED = 15, /* virConnectDomainEventDeviceRemovedCallback */
|
blockjob: use stable disk string in job event
When the block job event was first added, it was for block pull,
where the active layer of the disk remains the same name. It was
also in a day where we only cared about local files, and so we
always had a canonical absolute file name. But two things have
changed since then: we now have network disks, where determining
a single absolute string does not really make sense; and we have
two-phase jobs (copy and active commit) where the name of the
active layer changes between the first event (ready, on the old
name) and second (complete, on the pivoted name).
Adam Litke reported that having an unstable string between events
makes life harder for clients. Furthermore, all of our API that
operate on a particular disk of a domain accept multiple strings:
not only the absolute name of the active layer, but also the
destination device name (such as 'vda'). As this latter name is
stable, even for network sources, it serves as a better string
to supply in block job events.
But backwards-compatibility demands that we should not change the
name handed to users unless they explicitly request it. Therefore,
this patch adds a new event, BLOCK_JOB_2 (alas, I couldn't think of
any nicer name - but at least Migrate2 and Migrate3 are precedent
for a number suffix). We must double up on emitting both old-style
and new-style events according to what clients have registered for
(see also how IOError and IOErrorReason emits double events, but
there the difference was a larger struct rather than changed
meaning of one of the struct members).
Unfortunately, adding a new event isn't something that can easily
be broken into pieces, so the commit is rather large.
* include/libvirt/libvirt.h.in (virDomainEventID): Add a new id
for VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2.
(virConnectDomainEventBlockJobCallback): Document new semantics.
* src/conf/domain_event.c (_virDomainEventBlockJob): Rename field,
to ensure we catch all clients.
(virDomainEventBlockJobNew): Add parameter.
(virDomainEventBlockJobDispose)
(virDomainEventBlockJobNewFromObj)
(virDomainEventBlockJobNewFromDom)
(virDomainEventDispatchDefaultFunc): Adjust clients.
(virDomainEventBlockJob2NewFromObj)
(virDomainEventBlockJob2NewFromDom): New functions.
* src/conf/domain_event.h: Add new prototypes.
* src/libvirt_private.syms (domain_event.h): Export new functions.
* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Generate two
different events.
* src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Likewise.
* src/remote/remote_protocol.x
(remote_domain_event_block_job_2_msg): New struct.
(REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2): New RPC.
* src/remote/remote_driver.c
(remoteDomainBuildEventBlockJob2): New handler.
(remoteEvents): Register new event.
* daemon/remote.c (remoteRelayDomainEventBlockJob2): New handler.
(domainEventCallbacks): Register new event.
* tools/virsh-domain.c (vshEventCallbacks): Likewise.
(vshEventBlockJobPrint): Adjust client.
* src/remote_protocol-structs: Regenerate.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-06-14 08:18:04 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 = 16, /* virConnectDomainEventBlockJobCallback */
|
2014-09-10 06:28:24 -05:00
|
|
|
VIR_DOMAIN_EVENT_ID_TUNABLE = 17, /* virConnectDomainEventTunableCallback */
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
|
2012-01-20 12:43:28 -06:00
|
|
|
#ifdef VIR_ENUM_SENTINELS
|
2013-01-09 07:03:50 -06:00
|
|
|
VIR_DOMAIN_EVENT_ID_LAST
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
/*
|
|
|
|
* NB: this enum value will increase over time as new events are
|
|
|
|
* added to the libvirt API. It reflects the last event ID supported
|
|
|
|
* by this version of the libvirt API.
|
|
|
|
*/
|
2012-01-20 12:43:28 -06:00
|
|
|
#endif
|
Introduce a new public API for domain events
The current API for domain events has a number of problems
- Only allows for domain lifecycle change events
- Does not allow the same callback to be registered multiple times
- Does not allow filtering of events to a specific domain
This introduces a new more general purpose domain events API
typedef enum {
VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */
...more events later..
}
int virConnectDomainEventRegisterAny(virConnectPtr conn,
virDomainPtr dom, /* Optional, to filter */
int eventID,
virConnectDomainEventGenericCallback cb,
void *opaque,
virFreeCallback freecb);
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID);
Since different event types can received different data in the callback,
the API is defined with a generic callback. Specific events will each
have a custom signature for their callback. Thus when registering an
event it is neccessary to cast the callback to the generic signature
eg
int myDomainEventCallback(virConnectPtr conn,
virDomainPtr dom,
int event,
int detail,
void *opaque)
{
...
}
virConnectDomainEventRegisterAny(conn, NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
NULL, NULL);
The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
to the generic signature
* include/libvirt/libvirt.h.in: Define new APIs for registering
domain events
* src/driver.h: Internal driver entry points for new events APIs
* src/libvirt.c: Wire up public API to driver API for events APIs
* src/libvirt_public.syms: Export new APIs
* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
src/qemu/qemu_driver.c, src/remote/remote_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
src/xenapi/xenapi_driver.c: Stub out new API entries
2010-03-18 08:01:48 -05:00
|
|
|
} virDomainEventID;
|
|
|
|
|
|
|
|
|
|
|
|
/* Use VIR_DOMAIN_EVENT_CALLBACK() to cast the 'cb' parameter */
|
|
|
|
int virConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
|
virDomainPtr dom, /* Optional, to filter */
|
|
|
|
int eventID,
|
|
|
|
virConnectDomainEventGenericCallback cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback freecb);
|
|
|
|
|
|
|
|
int virConnectDomainEventDeregisterAny(virConnectPtr conn,
|
|
|
|
int callbackID);
|
|
|
|
|
2010-03-25 12:46:00 -05:00
|
|
|
|
2011-10-12 06:19:48 -05:00
|
|
|
/**
|
|
|
|
* virDomainConsoleFlags
|
|
|
|
*
|
|
|
|
* Since 0.9.10
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2010-03-25 12:46:00 -05:00
|
|
|
|
2011-10-12 06:19:48 -05:00
|
|
|
VIR_DOMAIN_CONSOLE_FORCE = (1 << 0), /* abort a (possibly) active console
|
|
|
|
connection to force a new
|
|
|
|
connection */
|
|
|
|
VIR_DOMAIN_CONSOLE_SAFE = (1 << 1), /* check if the console driver supports
|
|
|
|
safe console operations */
|
|
|
|
} virDomainConsoleFlags;
|
Introduce a virDomainOpenConsole API
To enable virsh console (or equivalent) to be used remotely
it is necessary to provide remote access to the /dev/pts/XXX
pseudo-TTY associated with the console/serial/parallel device
in the guest. The virStream API provide a bi-directional I/O
stream capability that can be used for this purpose. This
patch thus introduces a virDomainOpenConsole API that uses
the stream APIs.
* src/libvirt.c, src/libvirt_public.syms,
include/libvirt/libvirt.h.in, src/driver.h: Define the
new virDomainOpenConsole API
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub
API entry point
2010-07-23 07:34:31 -05:00
|
|
|
|
|
|
|
int virDomainOpenConsole(virDomainPtr dom,
|
2014-10-01 09:07:46 -05:00
|
|
|
const char *dev_name,
|
Introduce a virDomainOpenConsole API
To enable virsh console (or equivalent) to be used remotely
it is necessary to provide remote access to the /dev/pts/XXX
pseudo-TTY associated with the console/serial/parallel device
in the guest. The virStream API provide a bi-directional I/O
stream capability that can be used for this purpose. This
patch thus introduces a virDomainOpenConsole API that uses
the stream APIs.
* src/libvirt.c, src/libvirt_public.syms,
include/libvirt/libvirt.h.in, src/driver.h: Define the
new virDomainOpenConsole API
* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
src/remote/remote_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub
API entry point
2010-07-23 07:34:31 -05:00
|
|
|
virStreamPtr st,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2012-12-13 10:24:16 -06:00
|
|
|
/**
|
|
|
|
* virDomainChannelFlags
|
|
|
|
*
|
|
|
|
* Since 1.0.2
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CHANNEL_FORCE = (1 << 0), /* abort a (possibly) active channel
|
|
|
|
connection to force a new
|
|
|
|
connection */
|
|
|
|
} virDomainChannelFlags;
|
|
|
|
|
|
|
|
int virDomainOpenChannel(virDomainPtr dom,
|
|
|
|
const char *name,
|
|
|
|
virStreamPtr st,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-10-21 03:00:37 -05:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH = (1 << 0),
|
|
|
|
} virDomainOpenGraphicsFlags;
|
|
|
|
|
|
|
|
int virDomainOpenGraphics(virDomainPtr dom,
|
|
|
|
unsigned int idx,
|
|
|
|
int fd,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2014-08-25 10:28:14 -05:00
|
|
|
int virDomainOpenGraphicsFD(virDomainPtr dom,
|
|
|
|
unsigned int idx,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2011-05-10 03:26:01 -05:00
|
|
|
int virDomainInjectNMI(virDomainPtr domain, unsigned int flags);
|
|
|
|
|
2012-11-20 09:43:56 -06:00
|
|
|
int virDomainFSTrim(virDomainPtr dom,
|
|
|
|
const char *mountPoint,
|
|
|
|
unsigned long long minimum,
|
|
|
|
unsigned int flags);
|
2011-05-29 05:24:20 -05:00
|
|
|
|
2014-05-01 19:05:48 -05:00
|
|
|
int virDomainFSFreeze(virDomainPtr dom,
|
|
|
|
const char **mountpoints,
|
|
|
|
unsigned int nmountpoints,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virDomainFSThaw(virDomainPtr dom,
|
|
|
|
const char **mountpoints,
|
|
|
|
unsigned int nmountpoints,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2014-04-02 11:25:07 -05:00
|
|
|
int virDomainGetTime(virDomainPtr dom,
|
|
|
|
long long *seconds,
|
|
|
|
unsigned int *nseconds,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_TIME_SYNC = (1 << 0), /* Re-sync domain time from domain's RTC */
|
|
|
|
} virDomainSetTimeFlags;
|
|
|
|
|
|
|
|
int virDomainSetTime(virDomainPtr dom,
|
|
|
|
long long seconds,
|
|
|
|
unsigned int nseconds,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2014-06-09 10:14:47 -05:00
|
|
|
int virNodeGetFreePages(virConnectPtr conn,
|
|
|
|
unsigned int npages,
|
|
|
|
unsigned int *pages,
|
|
|
|
int startcell,
|
|
|
|
unsigned int cellcount,
|
|
|
|
unsigned long long *counts,
|
|
|
|
unsigned int flags);
|
2014-09-16 11:17:22 -05:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_NODE_ALLOC_PAGES_ADD = 0, /* Add @pageCounts to the pages pool. This
|
|
|
|
can be used only to size up the pool. */
|
|
|
|
VIR_NODE_ALLOC_PAGES_SET = (1 << 0), /* Don't add @pageCounts, instead set
|
|
|
|
passed number of pages. This can be
|
|
|
|
used to free allocated pages. */
|
|
|
|
} virNodeAllocPagesFlags;
|
|
|
|
|
|
|
|
int virNodeAllocPages(virConnectPtr conn,
|
|
|
|
unsigned int npages,
|
|
|
|
unsigned int *pageSizes,
|
|
|
|
unsigned long long *pageCounts,
|
|
|
|
int startCell,
|
|
|
|
unsigned int cellCount,
|
|
|
|
unsigned int flags);
|
2011-05-29 05:24:20 -05:00
|
|
|
/**
|
2011-05-29 10:02:33 -05:00
|
|
|
* virSchedParameterType:
|
2011-05-29 05:24:20 -05:00
|
|
|
*
|
|
|
|
* A scheduler parameter field type. Provided for backwards
|
|
|
|
* compatibility; virTypedParameterType is the preferred enum since
|
|
|
|
* 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SCHED_FIELD_INT = VIR_TYPED_PARAM_INT,
|
|
|
|
VIR_DOMAIN_SCHED_FIELD_UINT = VIR_TYPED_PARAM_UINT,
|
|
|
|
VIR_DOMAIN_SCHED_FIELD_LLONG = VIR_TYPED_PARAM_LLONG,
|
|
|
|
VIR_DOMAIN_SCHED_FIELD_ULLONG = VIR_TYPED_PARAM_ULLONG,
|
|
|
|
VIR_DOMAIN_SCHED_FIELD_DOUBLE = VIR_TYPED_PARAM_DOUBLE,
|
|
|
|
VIR_DOMAIN_SCHED_FIELD_BOOLEAN = VIR_TYPED_PARAM_BOOLEAN,
|
|
|
|
} virSchedParameterType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_SCHED_FIELD_LENGTH:
|
|
|
|
*
|
|
|
|
* Macro providing the field length of virSchedParameter. Provided
|
|
|
|
* for backwards compatibility; VIR_TYPED_PARAM_FIELD_LENGTH is the
|
|
|
|
* preferred value since 0.9.2.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_SCHED_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH
|
|
|
|
|
|
|
|
/**
|
2011-05-29 10:02:33 -05:00
|
|
|
* virSchedParameter:
|
2011-05-29 05:24:20 -05:00
|
|
|
*
|
2011-05-29 10:02:33 -05:00
|
|
|
* a virSchedParameter is the set of scheduler parameters.
|
2011-05-29 05:24:20 -05:00
|
|
|
* Provided for backwards compatibility; virTypedParameter is the
|
|
|
|
* preferred alias since 0.9.2.
|
|
|
|
*/
|
|
|
|
#define _virSchedParameter _virTypedParameter
|
|
|
|
typedef struct _virTypedParameter virSchedParameter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virSchedParameterPtr:
|
|
|
|
*
|
|
|
|
* a virSchedParameterPtr is a pointer to a virSchedParameter structure.
|
|
|
|
* Provided for backwards compatibility; virTypedParameterPtr is the
|
|
|
|
* preferred alias since 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef virSchedParameter *virSchedParameterPtr;
|
|
|
|
|
|
|
|
/**
|
2011-05-29 10:02:33 -05:00
|
|
|
* virBlkioParameterType:
|
2011-05-29 05:24:20 -05:00
|
|
|
*
|
|
|
|
* A blkio parameter field type. Provided for backwards
|
|
|
|
* compatibility; virTypedParameterType is the preferred enum since
|
|
|
|
* 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_BLKIO_PARAM_INT = VIR_TYPED_PARAM_INT,
|
|
|
|
VIR_DOMAIN_BLKIO_PARAM_UINT = VIR_TYPED_PARAM_UINT,
|
|
|
|
VIR_DOMAIN_BLKIO_PARAM_LLONG = VIR_TYPED_PARAM_LLONG,
|
|
|
|
VIR_DOMAIN_BLKIO_PARAM_ULLONG = VIR_TYPED_PARAM_ULLONG,
|
|
|
|
VIR_DOMAIN_BLKIO_PARAM_DOUBLE = VIR_TYPED_PARAM_DOUBLE,
|
|
|
|
VIR_DOMAIN_BLKIO_PARAM_BOOLEAN = VIR_TYPED_PARAM_BOOLEAN,
|
|
|
|
} virBlkioParameterType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_BLKIO_FIELD_LENGTH:
|
|
|
|
*
|
|
|
|
* Macro providing the field length of virBlkioParameter. Provided
|
|
|
|
* for backwards compatibility; VIR_TYPED_PARAM_FIELD_LENGTH is the
|
|
|
|
* preferred value since 0.9.2.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_BLKIO_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH
|
|
|
|
|
|
|
|
/**
|
2011-05-29 10:02:33 -05:00
|
|
|
* virBlkioParameter:
|
2011-05-29 05:24:20 -05:00
|
|
|
*
|
2011-05-29 10:02:33 -05:00
|
|
|
* a virBlkioParameter is the set of blkio parameters.
|
2011-05-29 05:24:20 -05:00
|
|
|
* Provided for backwards compatibility; virTypedParameter is the
|
|
|
|
* preferred alias since 0.9.2.
|
|
|
|
*/
|
|
|
|
#define _virBlkioParameter _virTypedParameter
|
|
|
|
typedef struct _virTypedParameter virBlkioParameter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virBlkioParameterPtr:
|
|
|
|
*
|
|
|
|
* a virBlkioParameterPtr is a pointer to a virBlkioParameter structure.
|
|
|
|
* Provided for backwards compatibility; virTypedParameterPtr is the
|
|
|
|
* preferred alias since 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef virBlkioParameter *virBlkioParameterPtr;
|
|
|
|
|
|
|
|
/**
|
2011-05-29 10:02:33 -05:00
|
|
|
* virMemoryParameterType:
|
2011-05-29 05:24:20 -05:00
|
|
|
*
|
|
|
|
* A memory parameter field type. Provided for backwards
|
|
|
|
* compatibility; virTypedParameterType is the preferred enum since
|
|
|
|
* 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_MEMORY_PARAM_INT = VIR_TYPED_PARAM_INT,
|
|
|
|
VIR_DOMAIN_MEMORY_PARAM_UINT = VIR_TYPED_PARAM_UINT,
|
|
|
|
VIR_DOMAIN_MEMORY_PARAM_LLONG = VIR_TYPED_PARAM_LLONG,
|
|
|
|
VIR_DOMAIN_MEMORY_PARAM_ULLONG = VIR_TYPED_PARAM_ULLONG,
|
|
|
|
VIR_DOMAIN_MEMORY_PARAM_DOUBLE = VIR_TYPED_PARAM_DOUBLE,
|
|
|
|
VIR_DOMAIN_MEMORY_PARAM_BOOLEAN = VIR_TYPED_PARAM_BOOLEAN,
|
|
|
|
} virMemoryParameterType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_MEMORY_FIELD_LENGTH:
|
|
|
|
*
|
|
|
|
* Macro providing the field length of virMemoryParameter. Provided
|
|
|
|
* for backwards compatibility; VIR_TYPED_PARAM_FIELD_LENGTH is the
|
|
|
|
* preferred value since 0.9.2.
|
|
|
|
*/
|
|
|
|
#define VIR_DOMAIN_MEMORY_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH
|
|
|
|
|
|
|
|
/**
|
2011-05-29 10:02:33 -05:00
|
|
|
* virMemoryParameter:
|
2011-05-29 05:24:20 -05:00
|
|
|
*
|
2011-05-29 10:02:33 -05:00
|
|
|
* a virMemoryParameter is the set of scheduler parameters.
|
2011-05-29 05:24:20 -05:00
|
|
|
* Provided for backwards compatibility; virTypedParameter is the
|
|
|
|
* preferred alias since 0.9.2.
|
|
|
|
*/
|
|
|
|
#define _virMemoryParameter _virTypedParameter
|
|
|
|
typedef struct _virTypedParameter virMemoryParameter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* virMemoryParameterPtr:
|
|
|
|
*
|
|
|
|
* a virMemoryParameterPtr is a pointer to a virMemoryParameter structure.
|
|
|
|
* Provided for backwards compatibility; virTypedParameterPtr is the
|
|
|
|
* preferred alias since 0.9.2.
|
|
|
|
*/
|
|
|
|
typedef virMemoryParameter *virMemoryParameterPtr;
|
|
|
|
|
2012-10-23 12:47:46 -05:00
|
|
|
/* Add new interfaces to the appropriate sections earlier in this
|
|
|
|
* file; the end of the file is reserved for deprecated names. */
|
2012-09-14 09:42:14 -05:00
|
|
|
|
2014-10-23 05:28:16 -05:00
|
|
|
#define __VIR_LIBVIRT_H_INCLUDES__
|
|
|
|
#include <libvirt/libvirt-domain-snapshot.h>
|
2014-10-23 05:28:16 -05:00
|
|
|
#include <libvirt/libvirt-interface.h>
|
2014-10-23 05:28:16 -05:00
|
|
|
#include <libvirt/libvirt-network.h>
|
2014-10-23 05:28:16 -05:00
|
|
|
#include <libvirt/libvirt-nodedev.h>
|
2014-10-23 05:28:16 -05:00
|
|
|
#include <libvirt/libvirt-nwfilter.h>
|
2014-10-23 05:28:16 -05:00
|
|
|
#include <libvirt/libvirt-secret.h>
|
2014-10-23 05:28:16 -05:00
|
|
|
#undef __VIR_LIBVIRT_H_INCLUDES__
|
|
|
|
|
2010-05-24 10:55:55 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-12-08 09:08:46 -06:00
|
|
|
#endif /* __VIR_VIRLIB_H__ */
|