[resend v2 5/7] Qemu: Set cache banks

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

 



Set cache banks while booting a new domain.

Signed-off-by: Eli Qiao <liyong.qiao@xxxxxxxxx>
---
 src/qemu/qemu_process.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 184440d..f29630f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -76,6 +76,7 @@
 #include "configmake.h"
 #include "nwfilter_conf.h"
 #include "netdev_bandwidth_conf.h"
+#include "virresctrl.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
@@ -5714,6 +5715,12 @@ qemuProcessLaunch(virConnectPtr conn,
         qemuProcessAutoDestroyAdd(driver, vm, conn) < 0)
         goto cleanup;
 
+    VIR_DEBUG("Cache allocation");
+
+    if (virResCtrlAvailable() &&
+            virResCtrlSetCacheBanks(&(vm->def->cachetune), vm->def->uuid, vm->pid) < 0)
+        goto cleanup;
+
     ret = 0;
 
  cleanup:
@@ -6216,6 +6223,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     virPerfFree(priv->perf);
     priv->perf = NULL;
 
+    if(virResCtrlAvailable() && virResCtrlUpdate() < 0)
+        VIR_WARN("Failed to update resource control for %s",
+                 vm->def->name);
+
     qemuProcessRemoveDomainStatus(driver, vm);
 
     /* Remove VNC and Spice ports from port reservation bitmap, but only if
-- 
1.9.1

--
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]
  Powered by Linux