From: Martin Kletzander Date: Fri, 2 Feb 2018 07:35:30 +0000 (+0100) Subject: qemu: Refresh capabilities when creating resctrl allocation X-Git-Tag: v4.1.0-rc1~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cac2a6c93c424d55b865a05635d96e0b1aa9d36;p=thirdparty%2Flibvirt.git qemu: Refresh capabilities when creating resctrl allocation Since one of the things in capabilities (info from resctrl updated with data about caches) can be change on the system by remounting the /sys/fs/resctrl with different options, the capabilities need to be refreshed. There is a better fix in the works, but it's going to be way bigger than this (hence the XXX note there), so for the time being let's workaround this. And in order not to slow down the domain starting, only get the capabilities if there are any cachetunes. Relates-to: https://bugzilla.redhat.com/show_bug.cgi?id=1540780 Signed-off-by: Martin Kletzander --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 434ac23ad4..036853137e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2500,9 +2500,15 @@ qemuProcessResctrlCreate(virQEMUDriverPtr driver, { int ret = -1; size_t i = 0; - virCapsPtr caps = virQEMUDriverGetCapabilities(driver, false); + virCapsPtr caps = NULL; qemuDomainObjPrivatePtr priv = vm->privateData; + if (!vm->def->ncachetunes) + return 0; + + /* Force capability refresh since resctrl info can change + * XXX: move cache info into virresctrl so caps are not needed */ + caps = virQEMUDriverGetCapabilities(driver, true); if (!caps) return -1;