[libvirt] [PATCH 1/5] lxc: Refresh capabilities on virConnectGetCapabilities

Michal Privoznik posted 5 patches 7 years, 6 months ago
[libvirt] [PATCH 1/5] lxc: Refresh capabilities on virConnectGetCapabilities
Posted by Michal Privoznik 7 years, 6 months ago
While not as critical as in qemu driver, there are still some
runtime information we report in capabilities XML that might
change throughout time. For instance, onlined CPUs (which affects
reported L3 cache sizes).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/lxc/lxc_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 9b329269a9..6969dddcab 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -205,7 +205,7 @@ static char *lxcConnectGetCapabilities(virConnectPtr conn) {
     if (virConnectGetCapabilitiesEnsureACL(conn) < 0)
         return NULL;
 
-    if (!(caps = virLXCDriverGetCapabilities(driver, false)))
+    if (!(caps = virLXCDriverGetCapabilities(driver, true)))
         return NULL;
 
     xml = virCapabilitiesFormatXML(caps);
-- 
2.16.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/5] lxc: Refresh capabilities on virConnectGetCapabilities
Posted by Erik Skultety 7 years, 6 months ago
On Wed, Jul 25, 2018 at 03:02:07PM +0200, Michal Privoznik wrote:
> While not as critical as in qemu driver, there are still some
> runtime information we report in capabilities XML that might
> change throughout time. For instance, onlined CPUs (which affects
> reported L3 cache sizes).
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/lxc/lxc_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> index 9b329269a9..6969dddcab 100644
> --- a/src/lxc/lxc_driver.c
> +++ b/src/lxc/lxc_driver.c
> @@ -205,7 +205,7 @@ static char *lxcConnectGetCapabilities(virConnectPtr conn) {
>      if (virConnectGetCapabilitiesEnsureACL(conn) < 0)
>          return NULL;
>
> -    if (!(caps = virLXCDriverGetCapabilities(driver, false)))
> +    if (!(caps = virLXCDriverGetCapabilities(driver, true)))

I'm curious why we don't need to refresh the capabilities for stateReload as
well, but we don't do that for QEMU either. The patch is fine, but if someone
could educate me here, I'd be glad.

Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list