accel/whpx/whpx-common.c | 8 ++++++++ 1 file changed, 8 insertions(+)
On windows x64 host:
$ ./build/tests/unit/test-multi-target
Type 'whpx-accel-x86_64-cpu' is missing its parent 'accel-x86_64-cpu'
(same for windows-arm64 hosts and whpx-accel-aarch64-cpu)
Parent type is conditionally registered from current target:
register_accel_target_type uses '"accel-" + target_cpu_type()' as type
name. Since whpx-common.c is shared between arm and x86_64 targets,
only register whpx accelerator cpu type when current target cpu type
matches the one it was compiled for.
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
---
accel/whpx/whpx-common.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c
index 78d2827809b..20c684638b0 100644
--- a/accel/whpx/whpx-common.c
+++ b/accel/whpx/whpx-common.c
@@ -20,6 +20,7 @@
#include "hw/core/boards.h"
#include "hw/intc/ioapic.h"
#include "qemu/error-report.h"
+#include "qemu/target-info.h"
#include "qapi/error.h"
#include "qapi/qapi-types-common.h"
#include "qapi/qapi-type-infos-common.h"
@@ -492,11 +493,18 @@ static void whpx_cpu_accel_class_init(ObjectClass *oc, const void *data)
acc->cpu_instance_init = whpx_cpu_instance_init;
}
+/* TYPE_ACCEL_CPU is only registered for current target cpu type */
+static bool whpx_cpu_accel_is_available(void)
+{
+ return !strcmp(target_cpu_type(), CPU_RESOLVING_TYPE);
+}
+
static const TypeInfo whpx_cpu_accel_type = {
.name = ACCEL_CPU_NAME("whpx"),
.parent = TYPE_ACCEL_CPU,
.class_init = whpx_cpu_accel_class_init,
+ .is_available = whpx_cpu_accel_is_available,
.abstract = true,
};
--
2.43.0
On 11/6/2026 9:53 AM, Pierrick Bouvier wrote: > On windows x64 host: > $ ./build/tests/unit/test-multi-target > Type 'whpx-accel-x86_64-cpu' is missing its parent 'accel-x86_64-cpu' > (same for windows-arm64 hosts and whpx-accel-aarch64-cpu) > > Parent type is conditionally registered from current target: > register_accel_target_type uses '"accel-" + target_cpu_type()' as type > name. Since whpx-common.c is shared between arm and x86_64 targets, > only register whpx accelerator cpu type when current target cpu type > matches the one it was compiled for. > > Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr> > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> > --- > accel/whpx/whpx-common.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > This was merged into master (71f25c75417d31c214ba2cd26b273c114fc99987). Regards, Pierrick
On Sat, Nov 7, 2026 at 1:54 AM Pierrick Bouvier
<pierrick.bouvier@oss.qualcomm.com> wrote:
>
> On windows x64 host:
> $ ./build/tests/unit/test-multi-target
> Type 'whpx-accel-x86_64-cpu' is missing its parent 'accel-x86_64-cpu'
> (same for windows-arm64 hosts and whpx-accel-aarch64-cpu)
>
> Parent type is conditionally registered from current target:
> register_accel_target_type uses '"accel-" + target_cpu_type()' as type
> name. Since whpx-common.c is shared between arm and x86_64 targets,
> only register whpx accelerator cpu type when current target cpu type
> matches the one it was compiled for.
>
> Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
> ---
> accel/whpx/whpx-common.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c
> index 78d2827809b..20c684638b0 100644
> --- a/accel/whpx/whpx-common.c
> +++ b/accel/whpx/whpx-common.c
> @@ -20,6 +20,7 @@
> #include "hw/core/boards.h"
> #include "hw/intc/ioapic.h"
> #include "qemu/error-report.h"
> +#include "qemu/target-info.h"
> #include "qapi/error.h"
> #include "qapi/qapi-types-common.h"
> #include "qapi/qapi-type-infos-common.h"
> @@ -492,11 +493,18 @@ static void whpx_cpu_accel_class_init(ObjectClass *oc, const void *data)
> acc->cpu_instance_init = whpx_cpu_instance_init;
> }
>
> +/* TYPE_ACCEL_CPU is only registered for current target cpu type */
> +static bool whpx_cpu_accel_is_available(void)
> +{
> + return !strcmp(target_cpu_type(), CPU_RESOLVING_TYPE);
> +}
> +
> static const TypeInfo whpx_cpu_accel_type = {
> .name = ACCEL_CPU_NAME("whpx"),
>
> .parent = TYPE_ACCEL_CPU,
> .class_init = whpx_cpu_accel_class_init,
> + .is_available = whpx_cpu_accel_is_available,
> .abstract = true,
> };
>
> --
> 2.43.0
>
>
Hi, I think
[PATCH v5 0/3] Register accel-$cpu_type for all targets
https://lore.kernel.org/qemu-devel/20261106023936.772-1-luoyonggang@gmail.com/
should also handled this. so this is_available do not need anymore.
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
On 11/6/2026 11:04 AM, Yonggang Luo wrote:
> On Sat, Nov 7, 2026 at 1:54 AM Pierrick Bouvier
> <pierrick.bouvier@oss.qualcomm.com> wrote:
>>
>> On windows x64 host:
>> $ ./build/tests/unit/test-multi-target
>> Type 'whpx-accel-x86_64-cpu' is missing its parent 'accel-x86_64-cpu'
>> (same for windows-arm64 hosts and whpx-accel-aarch64-cpu)
>>
>> Parent type is conditionally registered from current target:
>> register_accel_target_type uses '"accel-" + target_cpu_type()' as type
>> name. Since whpx-common.c is shared between arm and x86_64 targets,
>> only register whpx accelerator cpu type when current target cpu type
>> matches the one it was compiled for.
>>
>> Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>> ---
>> accel/whpx/whpx-common.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c
>> index 78d2827809b..20c684638b0 100644
>> --- a/accel/whpx/whpx-common.c
>> +++ b/accel/whpx/whpx-common.c
>> @@ -20,6 +20,7 @@
>> #include "hw/core/boards.h"
>> #include "hw/intc/ioapic.h"
>> #include "qemu/error-report.h"
>> +#include "qemu/target-info.h"
>> #include "qapi/error.h"
>> #include "qapi/qapi-types-common.h"
>> #include "qapi/qapi-type-infos-common.h"
>> @@ -492,11 +493,18 @@ static void whpx_cpu_accel_class_init(ObjectClass *oc, const void *data)
>> acc->cpu_instance_init = whpx_cpu_instance_init;
>> }
>>
>> +/* TYPE_ACCEL_CPU is only registered for current target cpu type */
>> +static bool whpx_cpu_accel_is_available(void)
>> +{
>> + return !strcmp(target_cpu_type(), CPU_RESOLVING_TYPE);
>> +}
>> +
>> static const TypeInfo whpx_cpu_accel_type = {
>> .name = ACCEL_CPU_NAME("whpx"),
>>
>> .parent = TYPE_ACCEL_CPU,
>> .class_init = whpx_cpu_accel_class_init,
>> + .is_available = whpx_cpu_accel_is_available,
>> .abstract = true,
>> };
>>
>> --
>> 2.43.0
>>
>>
>
> Hi, I think
>
> [PATCH v5 0/3] Register accel-$cpu_type for all targets
> https://lore.kernel.org/qemu-devel/20261106023936.772-1-luoyonggang@gmail.com/
>
> should also handled this. so this is_available do not need anymore.
>
I would prefer to send the accel series later, giving time for
additional reviews, if anyone has an objection.
the whpx fix is needed now as the test fails on windows at the moment.
the patch can be removed after, no problem.
Regards,
Pierrick
On Sat, Nov 7, 2026 at 3:07 AM Pierrick Bouvier
<pierrick.bouvier@oss.qualcomm.com> wrote:
>
> On 11/6/2026 11:04 AM, Yonggang Luo wrote:
> > On Sat, Nov 7, 2026 at 1:54 AM Pierrick Bouvier
> > <pierrick.bouvier@oss.qualcomm.com> wrote:
> >>
> >> On windows x64 host:
> >> $ ./build/tests/unit/test-multi-target
> >> Type 'whpx-accel-x86_64-cpu' is missing its parent 'accel-x86_64-cpu'
> >> (same for windows-arm64 hosts and whpx-accel-aarch64-cpu)
> >>
> >> Parent type is conditionally registered from current target:
> >> register_accel_target_type uses '"accel-" + target_cpu_type()' as type
> >> name. Since whpx-common.c is shared between arm and x86_64 targets,
> >> only register whpx accelerator cpu type when current target cpu type
> >> matches the one it was compiled for.
> >>
> >> Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> >> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
> >> ---
> >> accel/whpx/whpx-common.c | 8 ++++++++
> >> 1 file changed, 8 insertions(+)
> >>
> >> diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c
> >> index 78d2827809b..20c684638b0 100644
> >> --- a/accel/whpx/whpx-common.c
> >> +++ b/accel/whpx/whpx-common.c
> >> @@ -20,6 +20,7 @@
> >> #include "hw/core/boards.h"
> >> #include "hw/intc/ioapic.h"
> >> #include "qemu/error-report.h"
> >> +#include "qemu/target-info.h"
> >> #include "qapi/error.h"
> >> #include "qapi/qapi-types-common.h"
> >> #include "qapi/qapi-type-infos-common.h"
> >> @@ -492,11 +493,18 @@ static void whpx_cpu_accel_class_init(ObjectClass *oc, const void *data)
> >> acc->cpu_instance_init = whpx_cpu_instance_init;
> >> }
> >>
> >> +/* TYPE_ACCEL_CPU is only registered for current target cpu type */
> >> +static bool whpx_cpu_accel_is_available(void)
> >> +{
> >> + return !strcmp(target_cpu_type(), CPU_RESOLVING_TYPE);
> >> +}
> >> +
> >> static const TypeInfo whpx_cpu_accel_type = {
> >> .name = ACCEL_CPU_NAME("whpx"),
> >>
> >> .parent = TYPE_ACCEL_CPU,
> >> .class_init = whpx_cpu_accel_class_init,
> >> + .is_available = whpx_cpu_accel_is_available,
> >> .abstract = true,
> >> };
> >>
> >> --
> >> 2.43.0
> >>
> >>
> >
> > Hi, I think
> >
> > [PATCH v5 0/3] Register accel-$cpu_type for all targets
> > https://lore.kernel.org/qemu-devel/20261106023936.772-1-luoyonggang@gmail.com/
> >
> > should also handled this. so this is_available do not need anymore.
> >
>
> I would prefer to send the accel series later, giving time for
> additional reviews, if anyone has an objection.
Thanks, I got your intention now, it's fine to revert this after the
new release.
>
> the whpx fix is needed now as the test fails on windows at the moment.
> the patch can be removed after, no problem.
>
> Regards,
> Pierrick
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
© 2016 - 2026 Red Hat, Inc.