On 11/6/2026 7:35 AM, Daniel P. Berrangé wrote:
>>
>> Thanks for posting the series.
>>
>> Would that be possible to complete it so that beyond compilation, test
>> ./build/tests/unit/test-multi-target passes also? At the moment it fails
>> with duplicated types being registered.
> 
> Oh I see, it didn't failure because I only enabled
> the two arm/aarch64 targets, once i add in more
> targets we get a clash on the virt-machine class.
> 
> FYI, it also fails without my patch series present
> in some scenarios:
> 
> # child process (/multi-targets/qom-types-are-unique/aarch64 [1950288]) 
> stderr: "Registering `vm-launch-update' which already exists\n"
> **
> ERROR:../tests/unit/test-multi-target.c:41:test_qom_types_are_unique: child 
> process (/multi-targets/qom-types-are-unique/aarch64 [1950288]) failed 
> unexpectedly
> not ok /multi-targets/qom-types-are-unique/aarch64 - 
> ERROR:../tests/unit/test-multi-target.c:41:test_qom_types_are_unique: child 
> process (/multi-targets/qom-types-are-unique/aarch64 [1950288]) failed 
> unexpectedly
> Bail out!
> Aborted                    (core dumped) tests/unit/test-multi-target
> 
> This is caused by presence of 'igvm-devel' at build time on
> one of my machines (Fedora), which enables this device type,
> if you have both arm and aarch64 targets enabled.
> 
> We need to add igvm to our Fedora dockerfile to catch this
> in CI.
> 
> Moving it from specific_ss to system_ss make the test pass,
> but I'm unclear if it is sufficient to rely on lack of
> compiler and test complaints ? Or it needs manual code
> inspection to make sure the device is safe in this
> scenario ?
>

We are guaranteed a "common" file works because config poisoning ensures
the whole compilation unit, including headers, does not use any target
specific code (#ifdef).

So if it compiles, it's a safe change.

>> That's why this is_available was introduced in the first place. It was
>> just a way to move forward and provide the multi-target test to prevent
>> regression while work on single-binary is continued by Yonggang.
> 
> Right, so with my series, we would first need the class
> renames to fix the multi-target test.
>

Correct. That's why is_available was used to do selective registration
for virt and max cpu, because I don't see how a rename can work without
breaking existing binaries.

Introducing .targets does not solve the problem by itself, since name
conflict is still there. That's why I suggested to use buckets per
target, which is what Yonggang implemented.

I have no strong attachment to any approach and would be happy to follow
any end-to-end solution you recommend. I'll let you lead on this.

> I should have labelled this posting "POC" as it was not
> tested thoroughly.
>

No worries, it would have been caught in CI anyway, so we are safe here.

> With regards,
> Daniel

Regards,
Pierrick

Reply via email to