[libvirt] [V2 5/5] Qemu: Set cache banks
Eli Qiao
liyong.qiao at intel.com
Fri Feb 3 03:47:16 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 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 184440d..ec3d3c2 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,11 @@ qemuProcessLaunch(virConnectPtr conn,
qemuProcessAutoDestroyAdd(driver, vm, conn) < 0)
goto cleanup;
+ VIR_DEBUG("Cache allocation");
+
+ if (virResCtrlSetCacheBanks(&(vm->def->cachetune), vm->def->uuid, vm->pid) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
@@ -6216,6 +6222,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
virPerfFree(priv->perf);
priv->perf = NULL;
+ if(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