[PATCH 21/51] virQEMUCapsAddCPUDefinitions: Fill in cpu type in data and node it's used only in tests

Peter Krempa posted 51 patches 1 year ago
[PATCH 21/51] virQEMUCapsAddCPUDefinitions: Fill in cpu type in data and node it's used only in tests
Posted by Peter Krempa 1 year ago
'virQEMUCapsAddCPUDefinitions' is used solely to populate fake cpu
models for the fake-caps tests. Note that and also populate the 'type'
field so that default cpu type can be propagated properly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_capabilities.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 630be618bf..bd6a32b815 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2119,6 +2119,8 @@ bool virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)
 }


+/* Note that this function is invoked only by test code for faking supported cpu
+ * models */
 int
 virQEMUCapsAddCPUDefinitions(virQEMUCaps *qemuCaps,
                              virDomainVirtType type,
@@ -2149,6 +2151,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCaps *qemuCaps,

         cpu->usable = usable;
         cpu->name = g_strdup(name[i]);
+        /* while the type name doesn't correspond with reality, this is just for fake cpu models */
+        cpu->type = g_strdup(name[i]);
     }

     return 0;
-- 
2.41.0
Re: [PATCH 21/51] virQEMUCapsAddCPUDefinitions: Fill in cpu type in data and node it's used only in tests
Posted by Ján Tomko 1 year ago
s/node/note/ in the commit summary

On a Tuesday in 2023, Peter Krempa wrote:
>'virQEMUCapsAddCPUDefinitions' is used solely to populate fake cpu
>models for the fake-caps tests. Note that and also populate the 'type'
>field so that default cpu type can be propagated properly.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_capabilities.c | 4 ++++
> 1 file changed, 4 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano