mirror of https://github.com/proxmox/mirror_qemu
target/riscv/cpu.c: add riscv_cpu_add_kvm_unavail_prop_array()
Use a helper in riscv_cpu_add_kvm_properties() to eliminate some of its code repetition. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230912132423.268494-9-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>master
parent
370d7c8ef8
commit
b55c39b3f5
|
@ -1972,6 +1972,16 @@ static void riscv_cpu_add_kvm_unavail_prop(Object *obj, const char *prop_name)
|
|||
NULL, (void *)prop_name);
|
||||
}
|
||||
|
||||
static void riscv_cpu_add_kvm_unavail_prop_array(Object *obj,
|
||||
Property *array)
|
||||
{
|
||||
g_assert(array);
|
||||
|
||||
for (Property *prop = array; prop && prop->name; prop++) {
|
||||
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
|
||||
}
|
||||
}
|
||||
|
||||
void kvm_riscv_cpu_add_kvm_properties(Object *obj)
|
||||
{
|
||||
Property *prop;
|
||||
|
@ -1980,17 +1990,9 @@ void kvm_riscv_cpu_add_kvm_properties(Object *obj)
|
|||
kvm_riscv_init_user_properties(obj);
|
||||
riscv_cpu_add_misa_properties(obj);
|
||||
|
||||
for (prop = riscv_cpu_extensions; prop && prop->name; prop++) {
|
||||
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
|
||||
}
|
||||
|
||||
for (prop = riscv_cpu_vendor_exts; prop && prop->name; prop++) {
|
||||
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
|
||||
}
|
||||
|
||||
for (prop = riscv_cpu_experimental_exts; prop && prop->name; prop++) {
|
||||
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
|
||||
}
|
||||
riscv_cpu_add_kvm_unavail_prop_array(obj, riscv_cpu_extensions);
|
||||
riscv_cpu_add_kvm_unavail_prop_array(obj, riscv_cpu_vendor_exts);
|
||||
riscv_cpu_add_kvm_unavail_prop_array(obj, riscv_cpu_experimental_exts);
|
||||
|
||||
for (prop = riscv_cpu_options; prop && prop->name; prop++) {
|
||||
/* Check if KVM created the property already */
|
||||
|
|
Loading…
Reference in New Issue