]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virQEMUCapsAddCPUDefinitions: Fill in cpu type in data and node it's used only in...
authorPeter Krempa <pkrempa@redhat.com>
Thu, 31 Aug 2023 12:07:05 +0000 (14:07 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 6 Sep 2023 12:09:44 +0000 (14:09 +0200)
'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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c

index 630be618bf31dbcb9737255c39c68195e788d685..bd6a32b815573bf3ef6cbfe2d76dbfdabd207111 100644 (file)
@@ -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;