[libvirt] [PATCH] conf: Check CPU cache for ABI stability

Jiri Denemark posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/f4469ee75ae5e5aeabaac1ff1a4b5b6dd99e79c8.1494344654.git.jdenemar@redhat.com
src/conf/cpu_conf.c | 10 ++++++++++
1 file changed, 10 insertions(+)
[libvirt] [PATCH] conf: Check CPU cache for ABI stability
Posted by Jiri Denemark 6 years, 11 months ago
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/cpu_conf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 1b098c476..194f03faf 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -915,6 +915,16 @@ virCPUDefIsEqual(virCPUDefPtr src,
         }
     }
 
+    if ((src->cache && !dst->cache) ||
+        (!src->cache && dst->cache) ||
+        (src->cache && dst->cache &&
+         (src->cache->level != dst->cache->level ||
+          src->cache->mode != dst->cache->mode))) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       "Target CPU cache does not match source");
+        goto cleanup;
+    }
+
     identical = true;
 
  cleanup:
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] conf: Check CPU cache for ABI stability
Posted by Daniel P. Berrange 6 years, 11 months ago
On Tue, May 09, 2017 at 05:44:14PM +0200, Jiri Denemark wrote:
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/conf/cpu_conf.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
> index 1b098c476..194f03faf 100644
> --- a/src/conf/cpu_conf.c
> +++ b/src/conf/cpu_conf.c
> @@ -915,6 +915,16 @@ virCPUDefIsEqual(virCPUDefPtr src,
>          }
>      }
>  
> +    if ((src->cache && !dst->cache) ||
> +        (!src->cache && dst->cache) ||
> +        (src->cache && dst->cache &&
> +         (src->cache->level != dst->cache->level ||
> +          src->cache->mode != dst->cache->mode))) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       "Target CPU cache does not match source");
> +        goto cleanup;
> +    }
> +
>      identical = true;
>  
>   cleanup:

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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