]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc: Refresh capabilities if they have never been initalized
authorCole Robinson <crobinso@redhat.com>
Mon, 9 Dec 2019 16:13:04 +0000 (11:13 -0500)
committerCole Robinson <crobinso@redhat.com>
Tue, 10 Dec 2019 15:12:48 +0000 (10:12 -0500)
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é <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/lxc/lxc_conf.c

index 2df1537b226cff0b64e272ae99a39b32964e903b..43022a3441f31fd211076f32766d45fa4e41deee 100644 (file)
@@ -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);