From: Cole Robinson Date: Mon, 9 Dec 2019 16:13:04 +0000 (-0500) Subject: lxc: Refresh capabilities if they have never been initalized X-Git-Tag: v6.0.0-rc1~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22e7997d0cb4dd52c023ea4a40873b8274281e25;p=thirdparty%2Flibvirt.git lxc: Refresh capabilities if they have never been initalized Adjust virLXCDriverGetCapabilities to fill in driver->caps if it is empty, regardless of the passed 'refresh' value. This matches the pattern used in virQEMUDriverGetCapabilities This fixes LXC XML startup parsing for me Reviewed-by: Daniel P. Berrangé Signed-off-by: Cole Robinson --- diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index 2df1537b22..43022a3441 100644 --- a/src/lxc/lxc_conf.c +++ b/src/lxc/lxc_conf.c @@ -196,6 +196,13 @@ virCapsPtr virLXCDriverGetCapabilities(virLXCDriverPtr driver, driver->caps = caps; } else { lxcDriverLock(driver); + + if (driver->caps == NULL) { + VIR_DEBUG("Capabilities didn't detect any guests. Forcing a " + "refresh."); + lxcDriverUnlock(driver); + return virLXCDriverGetCapabilities(driver, true); + } } ret = virObjectRef(driver->caps);