Fix several minor problems introduced by the memtune series

Add proper documentation to the new VIR_DOMAIN_MEMORY_* macros in
libvirt.h.in to placate apibuild.py.

Mark args as unused in for libvirt_virDomain{Get,Set}MemoryParameters
in the Python bindings and add both to the libvirtMethods array.

Update remote_protocol-structs to placate make syntax-check.

Undo unintended modifications in vboxDomainGetInfo.

Update the function table of the VirtualBox and XenAPI drivers.
This commit is contained in:
Matthias Bolte 2010-10-12 21:24:11 +02:00
parent f928f43b7b
commit 43c2c61f68
5 changed files with 73 additions and 4 deletions

View File

@ -695,9 +695,37 @@ typedef enum {
*/
#define VIR_DOMAIN_MEMORY_FIELD_LENGTH 80
/**
* VIR_DOMAIN_MEMORY_HARD_LIMIT:
*
* Macro for the well-known tunable hard_limit.
*/
#define VIR_DOMAIN_MEMORY_HARD_LIMIT "hard_limit"
/**
* VIR_DOMAIN_MEMORY_SOFT_LIMIT:
*
* Macro for the well-known tunable soft_limit.
*/
#define VIR_DOMAIN_MEMORY_SOFT_LIMIT "soft_limit"
/**
* VIR_DOMAIN_MEMORY_MIN_GUARANTEE:
*
* Macro for the well-known tunable min_guarantee.
*/
#define VIR_DOMAIN_MEMORY_MIN_GUARANTEE "min_guarantee"
/**
* VIR_DOMAIN_SWAP_HARD_LIMIT:
*
* Macro for the well-known tunable swap_hard_limit.
*/
#define VIR_DOMAIN_SWAP_HARD_LIMIT "swap_hard_limit"
/**

View File

@ -374,14 +374,14 @@ libvirt_virDomainSetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
/* FIXME: This is a place holder for the implementation. */
static PyObject *
libvirt_virDomainSetMemoryParameters(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args) {
PyObject *args ATTRIBUTE_UNUSED) {
return VIR_PY_INT_FAIL;
}
/* FIXME: This is a place holder for the implementation. */
static PyObject *
libvirt_virDomainGetMemoryParameters(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args) {
PyObject *args ATTRIBUTE_UNUSED) {
return VIR_PY_INT_FAIL;
}
@ -3532,6 +3532,8 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virDomainGetSchedulerType", libvirt_virDomainGetSchedulerType, METH_VARARGS, NULL},
{(char *) "virDomainGetSchedulerParameters", libvirt_virDomainGetSchedulerParameters, METH_VARARGS, NULL},
{(char *) "virDomainSetSchedulerParameters", libvirt_virDomainSetSchedulerParameters, METH_VARARGS, NULL},
{(char *) "virDomainSetMemoryParameters", libvirt_virDomainSetMemoryParameters, METH_VARARGS, NULL},
{(char *) "virDomainGetMemoryParameters", libvirt_virDomainGetMemoryParameters, METH_VARARGS, NULL},
{(char *) "virDomainGetVcpus", libvirt_virDomainGetVcpus, METH_VARARGS, NULL},
{(char *) "virDomainPinVcpu", libvirt_virDomainPinVcpu, METH_VARARGS, NULL},
{(char *) "virConnectListStoragePools", libvirt_virConnectListStoragePools, METH_VARARGS, NULL},

View File

@ -70,6 +70,21 @@ struct remote_sched_param {
remote_nonnull_string field;
remote_sched_param_value value;
};
struct remote_memory_param_value {
int type;
union {
int i;
u_int ui;
int64_t l;
uint64_t ul;
double d;
int b;
} remote_memory_param_value_u;
};
struct remote_memory_param {
remote_nonnull_string field;
remote_memory_param_value value;
};
struct remote_open_args {
remote_string name;
int flags;
@ -151,6 +166,26 @@ struct remote_domain_set_scheduler_parameters_args {
remote_sched_param * params_val;
} params;
};
struct remote_domain_set_memory_parameters_args {
remote_nonnull_domain dom;
struct {
u_int params_len;
remote_memory_param * params_val;
} params;
u_int flags;
};
struct remote_domain_get_memory_parameters_args {
remote_nonnull_domain dom;
int nparams;
u_int flags;
};
struct remote_domain_get_memory_parameters_ret {
struct {
u_int params_len;
remote_memory_param * params_val;
} params;
int nparams;
};
struct remote_domain_block_stats_args {
remote_nonnull_domain dom;
remote_nonnull_string path;

View File

@ -1734,8 +1734,8 @@ static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) {
info->cpuTime = 0;
info->nrVirtCpu = CPUCount;
info->mem.cur_balloon = memorySize * 1024;
info->mem.max_balloon = maxMemorySize * 1024;
info->memory = memorySize * 1024;
info->maxMem = maxMemorySize * 1024;
switch(state) {
case MachineState_Running:
info->state = VIR_DOMAIN_RUNNING;
@ -8344,6 +8344,8 @@ virDriver NAME(Driver) = {
vboxDomainRevertToSnapshot, /* domainRevertToSnapshot */
vboxDomainSnapshotDelete, /* domainSnapshotDelete */
NULL, /* qemuDomainMonitorCommand */
NULL, /* domainSetMemoryParameters */
NULL, /* domainGetMemoryParameters */
};
virNetworkDriver NAME(NetworkDriver) = {

View File

@ -1821,6 +1821,8 @@ static virDriver xenapiDriver = {
NULL, /* domainRevertToSnapshot */
NULL, /* domainSnapshotDelete */
NULL, /* qemuDomainMonitorCommand */
NULL, /* domainSetMemoryParameters */
NULL, /* domainGetMemoryParameters */
};
/**