[PATCH 04/32] sync_qemu_models_i386: Do not overwrite existing models

Jiri Denemark posted 32 patches 2 weeks ago
There is a newer version of this series
[PATCH 04/32] sync_qemu_models_i386: Do not overwrite existing models
Posted by Jiri Denemark 2 weeks ago
We don't change definitions of CPU models which were already included in
a libvirt release to maintain migration compatibility. Thus the script
can just skip existing models and save us from having to drop the
changes it would do to them.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/cpu_map/sync_qemu_models_i386.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/cpu_map/sync_qemu_models_i386.py b/src/cpu_map/sync_qemu_models_i386.py
index 78c2bffab2..f7b06a7716 100755
--- a/src/cpu_map/sync_qemu_models_i386.py
+++ b/src/cpu_map/sync_qemu_models_i386.py
@@ -535,6 +535,10 @@ def main():
 
     for model in models:
         name = os.path.join(args.outdir, f"x86_{model['name']}.xml")
+        if os.path.isfile(name):
+            # Ignore existing models as CPU models in libvirt should never
+            # change once released.
+            continue
         with open(name, "wt") as f:
             output_model(f, model)
 
-- 
2.47.0
Re: [PATCH 04/32] sync_qemu_models_i386: Do not overwrite existing models
Posted by Daniel P. Berrangé 1 week, 6 days ago
On Tue, Nov 19, 2024 at 07:49:40PM +0100, Jiri Denemark wrote:
> We don't change definitions of CPU models which were already included in
> a libvirt release to maintain migration compatibility. Thus the script
> can just skip existing models and save us from having to drop the
> changes it would do to them.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/cpu_map/sync_qemu_models_i386.py | 4 ++++
>  1 file changed, 4 insertions(+)

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


With 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 :|