2015-02-09 16:35:05 +00:00
|
|
|
/* -*- c -*-
|
|
|
|
*/
|
|
|
|
|
|
|
|
%#include "internal.h"
|
2016-01-12 15:11:11 +00:00
|
|
|
%#include "virxdrdefs.h"
|
2015-02-09 16:35:05 +00:00
|
|
|
|
|
|
|
typedef opaque virLogManagerProtocolUUID[VIR_UUID_BUFLEN];
|
|
|
|
|
|
|
|
/* Length of long, but not unbounded, strings.
|
|
|
|
* This is an arbitrary limit designed to stop the decoder from trying
|
|
|
|
* to allocate unbounded amounts of memory when fed with a bad message.
|
|
|
|
*/
|
|
|
|
const VIR_LOG_MANAGER_PROTOCOL_STRING_MAX = 4194304;
|
|
|
|
|
|
|
|
/* A long string, which may NOT be NULL. */
|
|
|
|
typedef string virLogManagerProtocolNonNullString<VIR_LOG_MANAGER_PROTOCOL_STRING_MAX>;
|
|
|
|
|
|
|
|
/* A long string, which may be NULL. */
|
|
|
|
typedef virLogManagerProtocolNonNullString *virLogManagerProtocolString;
|
|
|
|
|
2015-11-03 11:01:21 +00:00
|
|
|
struct virLogManagerProtocolDomain {
|
|
|
|
virLogManagerProtocolUUID uuid;
|
|
|
|
virLogManagerProtocolNonNullString name;
|
|
|
|
};
|
|
|
|
typedef struct virLogManagerProtocolDomain virLogManagerProtocolDomain;
|
|
|
|
|
|
|
|
struct virLogManagerProtocolLogFilePosition {
|
|
|
|
unsigned hyper inode;
|
|
|
|
unsigned hyper offset;
|
|
|
|
};
|
|
|
|
typedef struct virLogManagerProtocolLogFilePosition virLogManagerProtocolLogFilePosition;
|
|
|
|
|
2016-02-29 12:26:02 +00:00
|
|
|
enum virLogManagerProtocolDomainOpenLogFileFlags {
|
|
|
|
VIR_LOG_MANAGER_PROTOCOL_DOMAIN_OPEN_LOG_FILE_TRUNCATE = 1
|
|
|
|
};
|
|
|
|
|
2015-11-03 11:01:21 +00:00
|
|
|
/* Obtain a file handle suitable for writing to a
|
|
|
|
* log file for a domain
|
|
|
|
*/
|
|
|
|
struct virLogManagerProtocolDomainOpenLogFileArgs {
|
|
|
|
virLogManagerProtocolNonNullString driver;
|
|
|
|
virLogManagerProtocolDomain dom;
|
2015-12-03 17:20:35 +00:00
|
|
|
virLogManagerProtocolNonNullString path;
|
2015-11-03 11:01:21 +00:00
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct virLogManagerProtocolDomainOpenLogFileRet {
|
|
|
|
virLogManagerProtocolLogFilePosition pos;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct virLogManagerProtocolDomainGetLogFilePositionArgs {
|
2015-12-03 17:20:35 +00:00
|
|
|
virLogManagerProtocolNonNullString path;
|
2015-11-03 11:01:21 +00:00
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct virLogManagerProtocolDomainGetLogFilePositionRet {
|
|
|
|
virLogManagerProtocolLogFilePosition pos;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct virLogManagerProtocolDomainReadLogFileArgs {
|
2015-12-03 17:20:35 +00:00
|
|
|
virLogManagerProtocolNonNullString path;
|
2015-11-03 11:01:21 +00:00
|
|
|
virLogManagerProtocolLogFilePosition pos;
|
|
|
|
unsigned hyper maxlen;
|
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct virLogManagerProtocolDomainReadLogFileRet {
|
|
|
|
virLogManagerProtocolNonNullString data;
|
|
|
|
};
|
|
|
|
|
2016-06-07 14:15:22 +00:00
|
|
|
struct virLogManagerProtocolDomainAppendLogFileArgs {
|
|
|
|
virLogManagerProtocolNonNullString driver;
|
|
|
|
virLogManagerProtocolDomain dom;
|
|
|
|
virLogManagerProtocolNonNullString path;
|
|
|
|
virLogManagerProtocolNonNullString message;
|
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct virLogManagerProtocolDomainAppendLogFileRet {
|
|
|
|
int ret;
|
|
|
|
};
|
|
|
|
|
2015-02-09 16:35:05 +00:00
|
|
|
/* Define the program number, protocol version and procedure numbers here. */
|
|
|
|
const VIR_LOG_MANAGER_PROTOCOL_PROGRAM = 0x87539319;
|
|
|
|
const VIR_LOG_MANAGER_PROTOCOL_PROGRAM_VERSION = 1;
|
2015-11-03 11:01:21 +00:00
|
|
|
|
|
|
|
enum virLogManagerProtocolProcedure {
|
|
|
|
/* Each function must be preceded by a comment providing one or
|
|
|
|
* more annotations:
|
|
|
|
*
|
|
|
|
* - @generate: none|client|server|both
|
|
|
|
*
|
|
|
|
* Whether to generate the dispatch stubs for the server
|
|
|
|
* and/or client code.
|
|
|
|
*
|
|
|
|
* - @readstream: paramnumber
|
|
|
|
* - @writestream: paramnumber
|
|
|
|
*
|
|
|
|
* The @readstream or @writestream annotations let daemon and src/remote
|
|
|
|
* create a stream. The direction is defined from the src/remote point
|
|
|
|
* of view. A readstream transfers data from daemon to src/remote. The
|
|
|
|
* <paramnumber> specifies at which offset the stream parameter is inserted
|
|
|
|
* in the function parameter list.
|
|
|
|
*
|
|
|
|
* - @priority: low|high
|
|
|
|
*
|
|
|
|
* Each API that might eventually access hypervisor's monitor (and thus
|
|
|
|
* block) MUST fall into low priority. However, there are some exceptions
|
|
|
|
* to this rule, e.g. domainDestroy. Other APIs MAY be marked as high
|
|
|
|
* priority. If in doubt, it's safe to choose low. Low is taken as default,
|
|
|
|
* and thus can be left out.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @generate: none
|
|
|
|
* @acl: none
|
|
|
|
*/
|
|
|
|
VIR_LOG_MANAGER_PROTOCOL_PROC_DOMAIN_OPEN_LOG_FILE = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @generate: none
|
|
|
|
* @acl: none
|
|
|
|
*/
|
|
|
|
VIR_LOG_MANAGER_PROTOCOL_PROC_DOMAIN_GET_LOG_FILE_POSITION = 2,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @generate: none
|
|
|
|
* @acl: none
|
|
|
|
*/
|
2016-06-07 14:15:22 +00:00
|
|
|
VIR_LOG_MANAGER_PROTOCOL_PROC_DOMAIN_READ_LOG_FILE = 3,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @generate: none
|
|
|
|
* @acl: none
|
|
|
|
*/
|
|
|
|
VIR_LOG_MANAGER_PROTOCOL_PROC_DOMAIN_APPEND_LOG_FILE = 4
|
2015-11-03 11:01:21 +00:00
|
|
|
};
|