diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index e244eacd9c433f97fb069d26d54b11cd6163b4ca..ca8e6fad10f69bc274ea824aa93e1e0903614f08 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -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" /** diff --git a/python/libvirt-override.c b/python/libvirt-override.c index c43ab15f8b88fae943df575bbcf62bb33f8635f4..4a03d72dc0a8bb63d5136506d64d12b22bca8308 100644 --- a/python/libvirt-override.c +++ b/python/libvirt-override.c @@ -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}, diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index a5fc6aaa3190979395294301ce1ac0008c691bc3..838423ebf7bba306a5eb7948191fb0b47f2628ad 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -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; diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 65bfd9e854f13a7484ba3b36b89c70645c81a0c4..7e7d8e47796c70b3dc8cf895b2ecac6b1c244058 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -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) = { diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index ad5b5d8e9edcc46e70a81f2ca745a1c9e247f80a..e62a1394d278791818933a90af9dc717aa794c38 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -1821,6 +1821,8 @@ static virDriver xenapiDriver = { NULL, /* domainRevertToSnapshot */ NULL, /* domainSnapshotDelete */ NULL, /* qemuDomainMonitorCommand */ + NULL, /* domainSetMemoryParameters */ + NULL, /* domainGetMemoryParameters */ }; /**