[libvirt] [PATCH v7 4/7] qemu: Add bps_max and friends qemu driver

2014-11-10 Thread Matthias Gatto
Add support for bps_max and friends in the driver part.
In the part checking if a qemu is running, check if the running binary
support bps_max, if not print an error message, if yes add it to
info variable

This patch follow therse patchs: 
http://www.redhat.com/archives/libvir-list/2014-November/msg00271.html
I've fix the syntax error and the nparams detection problem

Signed-off-by: Matthias Gatto matthias.ga...@outscale.com
---
 include/libvirt/libvirt-domain.h |  56 +++
 src/qemu/qemu_driver.c   | 197 ---
 src/qemu/qemu_monitor.c  |  10 +-
 src/qemu/qemu_monitor.h  |   6 +-
 src/qemu/qemu_monitor_json.c |  11 ++-
 src/qemu/qemu_monitor_json.h |   6 +-
 tests/qemumonitorjsontest.c  |   4 +-
 7 files changed, 264 insertions(+), 26 deletions(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 966a9ae..1fac2a3 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -3251,6 +3251,62 @@ typedef void 
(*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn,
 # define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC blkdeviotune.write_iops_sec
 
 /**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX:
+ *
+ * Marco represents the total throughput limit in maximum bytes per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX 
blkdeviotune.total_bytes_sec_max
+
+/**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX:
+ *
+ * Marco represents the read throughput limit in maximum bytes per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX 
blkdeviotune.read_bytes_sec_max
+
+/**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX:
+ *
+ * Macro represents the write throughput limit in maximum bytes per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX 
blkdeviotune.write_bytes_sec_max
+
+/**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX:
+ *
+ * Macro represents the total maximum I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX 
blkdeviotune.total_iops_sec_max
+
+/**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX:
+ *
+ * Macro represents the read maximum I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX 
blkdeviotune.read_iops_sec_max
+
+/**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX:
+ *
+ * Macro represents the write maximum I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX 
blkdeviotune.write_iops_sec_max
+
+/**
+ * VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC:
+ *
+ * Macro represents the size maximum I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC blkdeviotune.size_iops_sec
+
+/**
  * virConnectDomainEventTunableCallback:
  * @conn: connection object
  * @dom: domain on which the event occurred
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5eccacc..242b30e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -105,6 +105,7 @@ VIR_LOG_INIT(qemu.qemu_driver);
 #define QEMU_NB_MEM_PARAM  3
 
 #define QEMU_NB_BLOCK_IO_TUNE_PARAM  6
+#define QEMU_NB_BLOCK_IO_TUNE_PARAM_MAX  13
 
 #define QEMU_NB_NUMA_PARAM 2
 
@@ -16520,6 +16521,10 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
 int conf_idx = -1;
 bool set_bytes = false;
 bool set_iops = false;
+bool set_bytes_max = false;
+bool set_iops_max = false;
+bool set_size_iops = false;
+bool supportMaxOptions = true;
 virQEMUDriverConfigPtr cfg = NULL;
 virCapsPtr caps = NULL;
 virObjectEventPtr event = NULL;
@@ -16542,6 +16547,20 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
VIR_TYPED_PARAM_ULLONG,
VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC,
VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX,
+   VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX,
+   VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX,
+   VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX,
+   VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX,
+   VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX,
+   VIR_TYPED_PARAM_ULLONG,
+   VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC,
+   

Re: [libvirt] [PATCH v7 4/7] qemu: Add bps_max and friends qemu driver

2014-11-10 Thread Michal Privoznik

On 10.11.2014 16:19, Matthias Gatto wrote:

Add support for bps_max and friends in the driver part.
In the part checking if a qemu is running, check if the running binary
support bps_max, if not print an error message, if yes add it to
info variable

This patch follow therse patchs: 
http://www.redhat.com/archives/libvir-list/2014-November/msg00271.html
I've fix the syntax error and the nparams detection problem

Signed-off-by: Matthias Gatto matthias.ga...@outscale.com
---
  include/libvirt/libvirt-domain.h |  56 +++
  src/qemu/qemu_driver.c   | 197 ---
  src/qemu/qemu_monitor.c  |  10 +-
  src/qemu/qemu_monitor.h  |   6 +-
  src/qemu/qemu_monitor_json.c |  11 ++-
  src/qemu/qemu_monitor_json.h |   6 +-
  tests/qemumonitorjsontest.c  |   4 +-
  7 files changed, 264 insertions(+), 26 deletions(-)


I've capped the long lines and

ACK.

Moreover, I've merged the patches. Congratulations on your first libvirt 
contribution!


Michal

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


Re: [libvirt] [PATCH v7 4/7] qemu: Add bps_max and friends qemu driver

2014-11-10 Thread Matthias Gatto
On Mon, Nov 10, 2014 at 5:25 PM, Michal Privoznik mpriv...@redhat.com wrote:
 On 10.11.2014 16:19, Matthias Gatto wrote:

 Add support for bps_max and friends in the driver part.
 In the part checking if a qemu is running, check if the running binary
 support bps_max, if not print an error message, if yes add it to
 info variable

 This patch follow therse patchs:
 http://www.redhat.com/archives/libvir-list/2014-November/msg00271.html
 I've fix the syntax error and the nparams detection problem

 Signed-off-by: Matthias Gatto matthias.ga...@outscale.com
 ---
   include/libvirt/libvirt-domain.h |  56 +++
   src/qemu/qemu_driver.c   | 197
 ---
   src/qemu/qemu_monitor.c  |  10 +-
   src/qemu/qemu_monitor.h  |   6 +-
   src/qemu/qemu_monitor_json.c |  11 ++-
   src/qemu/qemu_monitor_json.h |   6 +-
   tests/qemumonitorjsontest.c  |   4 +-
   7 files changed, 264 insertions(+), 26 deletions(-)


 I've capped the long lines and

 ACK.

 Moreover, I've merged the patches. Congratulations on your first libvirt
 contribution!

 Michal

Thank you very much.

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