[PATCH] vbox: Make host CPU cache init non-fatal

Charlie Sharpsteen posted 1 patch 3 years ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210408181528.69944-1-source@sharpsteen.net
src/vbox/vbox_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] vbox: Make host CPU cache init non-fatal
Posted by Charlie Sharpsteen 3 years ago
This commit updates the vbox driver to log a warning if the
virCapabilitiesInitCaches function fails instead of treating failure
as a fatal error. CPU cache initialization requires the sysfs filesystem
in order to complete successfully and thus fails on platforms such as macOS.

This commit is similar to ace6528ae19, which made the same change to the
VMware driver.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
---
 src/vbox/vbox_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 5a5de85eab..933851346b 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -98,7 +98,7 @@ vboxCapsInit(void)
         return NULL;
 
     if (virCapabilitiesInitCaches(caps) < 0)
-        return NULL;
+        VIR_WARN("Failed to get host CPU cache info");
 
     if ((guest = virCapabilitiesAddGuest(caps,
                                          VIR_DOMAIN_OSTYPE_HVM,
-- 
2.31.1

Re: [PATCH] vbox: Make host CPU cache init non-fatal
Posted by Daniel Henrique Barboza 3 years ago

On 4/8/21 3:15 PM, Charlie Sharpsteen wrote:
> This commit updates the vbox driver to log a warning if the
> virCapabilitiesInitCaches function fails instead of treating failure
> as a fatal error. CPU cache initialization requires the sysfs filesystem
> in order to complete successfully and thus fails on platforms such as macOS.
> 
> This commit is similar to ace6528ae19, which made the same change to the
> VMware driver.
> 
> Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
> ---

Looks reasonable to me.


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>


>   src/vbox/vbox_common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
> index 5a5de85eab..933851346b 100644
> --- a/src/vbox/vbox_common.c
> +++ b/src/vbox/vbox_common.c
> @@ -98,7 +98,7 @@ vboxCapsInit(void)
>           return NULL;
>   
>       if (virCapabilitiesInitCaches(caps) < 0)
> -        return NULL;
> +        VIR_WARN("Failed to get host CPU cache info");
>   
>       if ((guest = virCapabilitiesAddGuest(caps,
>                                            VIR_DOMAIN_OSTYPE_HVM,
>