On Tue, Oct 20, 2026 at 00:15:03 -0400, Rorie Reyes wrote:
> Add a new helper qemuProcessCheckS390CPU() in qemu_process.c that
> wraps the QMP query-cpu-model-comparison probe for s390x and returns
> a virCPUCompareResult directly.  The helper filters out the special
> "type" responsible-property (which signals a CPU generation mismatch
> rather than a missing feature) before reporting incompatibility to
> the caller.
> 
> When reporting incompatibility, the differing properties are listed
> in the error message when available.  If no responsible-properties
> are returned (or all are filtered out), a generic incompatibility
> message is reported instead.
> 
> Wire the helper into qemuProcessUpdateGuestCPU() so that s390x CPU
> model compatibility is checked for real domain start paths (migration,
> snapshot restore) when the QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON
> capability is present.  The host CPU is passed as the first argument
> and the guest CPU as the second, matching
> qemuConnectCPUModelComparison().  The check is skipped in pretend mode
> (VIR_QEMU_PROCESS_START_PRETEND) since that path is used for
> command-line generation and does not involve a running QEMU instance.
> It is also skipped when the guest CPU definition has no model yet (for
> example host-model on a fresh start), since that model is resolved from
> the host CPU later and cannot be incompatible with it.
> 
> Simplify qemuConnectCPUModelComparison() in qemu_driver.c to delegate
> directly to qemuProcessCheckS390CPU().

I started this on Monday, but did ran out of time and Boris and Collin
already pointed out a few things in the meantime so these are just
additional comments mostly about how the structuring the changes...

Too many unnecessary details about what and how the patch is doing. In
general a commit message should mostly focus on "why", i.e. the reasons
for a patch.

Judging from the subject, I would expect this patch to be just moving
code from qemuConnectCPUModelComparison to the new helper, which would
also be much easier to review.

I would split this patch in three:
    - new helper (as a replacement for qemuConnectCPUModelComparison as
      suggested by Collin)
    - handling responsibleProps in the helper
    - calling the helper from qemuProcessUpdateGuestCPU

Jirka

Reply via email to