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

Eli Qiao liyong.qiao at intel.com
Mon Feb 6 02:23:40 UTC 2017


Set cache banks while booting a new domain.

Signed-off-by: Eli Qiao <liyong.qiao at intel.com>
---
 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




More information about the libvir-list mailing list