[PATCH 2/2] BlockPull: Set bandwidth limit when using text monitor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The libvirt BlockPull API supports the use of an initial bandwidth limit.  To
implement this in the text monitor we first start the operation with a
'block_stream' command and then issue a 'block_job_set_speed' command to apply
the limit.

This functionality is already present for json mode.

Signed-off-by: Adam Litke <agl@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_text.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 854ee7f..2159209 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -3096,6 +3096,11 @@ int qemuMonitorTextBlockJob(qemuMonitorPtr mon,
 
     ret = qemuMonitorTextParseBlockJob(reply, device, info);
 
+    /* If non-zero, set the bandwidth limit with a separate command */
+    if (ret == 0 && mode == BLOCK_JOB_PULL && bandwidth != 0)
+        ret = qemuMonitorTextBlockJob(mon, device, bandwidth, info,
+                                      BLOCK_JOB_SPEED);
+
 cleanup:
     VIR_FREE(cmd);
     VIR_FREE(reply);
-- 
1.7.3

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]