Re: [libvirt] [PATCH] Fix several minor problems introduced by the memtune series

2010-10-13 Thread Daniel Veillard
On Tue, Oct 12, 2010 at 09:29:38PM +0200, Matthias Bolte wrote:
 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.

  Gahh, thanks for catching those !

 diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
 index a5fc6aa..838423e 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 {
 + inttype;
 + union {
 + inti;
 + u_int  ui;
 + int64_tl;
 + uint64_t   ul;
 + double d;
 + intb;
 + } 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;
   intflags;
 @@ -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;
 + intnparams;
 + u_int  flags;
 +};
 +struct remote_domain_get_memory_parameters_ret {
 + struct {
 + u_int  params_len;
 + remote_memory_param * params_val;
 + } params;
 + intnparams;
 +};
  struct remote_domain_block_stats_args {
   remote_nonnull_domain  dom;
   remote_nonnull_string  path;

  Hum, that file I didn't know about ... aren't those already
declared in the .x so why the duplication, I'm surprized !

Daniel


-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Fix several minor problems introduced by the memtune series

2010-10-13 Thread Eric Blake

On 10/13/2010 02:25 AM, Daniel Veillard wrote:

--- 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 {




   Hum, that file I didn't know about ... aren't those already
declared in the .x so why the duplication, I'm surprized !


That file only gets modified if you have the 'dwarves' package 
installed.  It is a manual check that we are not changing the 
on-the-wire protocol inadvertently.  Yes, it would be nice if this file 
could be regenerated automatically, instead of manually updating it; but 
the point of having this file is that we are forced to review every 
protocol change to make sure it is only additions and not modifications 
of an existing struct.


See this thread for its introduction:
https://www.redhat.com/archives/libvir-list/2010-May/msg00152.html

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Fix several minor problems introduced by the memtune series

2010-10-12 Thread Matthias Bolte
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.
---
 include/libvirt/libvirt.h.in |   28 
 python/libvirt-override.c|6 --
 src/remote_protocol-structs  |   35 +++
 src/vbox/vbox_tmpl.c |6 --
 src/xenapi/xenapi_driver.c   |2 ++
 5 files changed, 73 insertions(+), 4 deletions(-)

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index e244eac..ca8e6fa 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 c43ab15..4a03d72 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 a5fc6aa..838423e 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 {
+   inttype;
+   union {
+   inti;
+   u_int  ui;
+   int64_tl;
+   uint64_t   ul;
+   double d;
+   intb;
+   } 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;
intflags;
@@ -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;
+   intnparams;
+   u_int  flags;
+};
+struct remote_domain_get_memory_parameters_ret {
+   struct {
+   u_int  params_len;
+   

Re: [libvirt] [PATCH] Fix several minor problems introduced by the memtune series

2010-10-12 Thread Matthias Bolte
2010/10/12 Eric Blake ebl...@redhat.com:
 On 10/12/2010 01:29 PM, Matthias Bolte wrote:

 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.
 ---
  include/libvirt/libvirt.h.in |   28 
  python/libvirt-override.c    |    6 --
  src/remote_protocol-structs  |   35 +++
  src/vbox/vbox_tmpl.c         |    6 --
  src/xenapi/xenapi_driver.c   |    2 ++
  5 files changed, 73 insertions(+), 4 deletions(-)

 ACK.


Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list