From 22e7997d0cb4dd52c023ea4a40873b8274281e25 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 9 Dec 2019 11:13:04 -0500 Subject: [PATCH] lxc: Refresh capabilities if they have never been initalized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/lxc/lxc_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) 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);