summary refs log tree commit diff stats
path: root/rust/qemu-api/src
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2025-02-05 12:54:01 -0800
committerFabiano Rosas <farosas@suse.de>2025-02-14 15:19:06 -0300
commitb451705e3b90e55c6070338fa97aaae274721a5c (patch)
treeeea2c61201338f791e6d7d6bb32215c7fc23fe5d /rust/qemu-api/src
parent24f4c80cfc31ab4ed4cb6553c9289e3cf8ca63ac (diff)
downloadfocaccia-qemu-b451705e3b90e55c6070338fa97aaae274721a5c.tar.gz
focaccia-qemu-b451705e3b90e55c6070338fa97aaae274721a5c.zip
migration: use parameters.mode in cpr_state_save
qmp_migrate guarantees that cpr_channel is not null for
MIG_MODE_CPR_TRANSFER when cpr_state_save is called:

    qmp_migrate()
        if (s->parameters.mode == MIG_MODE_CPR_TRANSFER && !cpr_channel) {
            return;
        }
        cpr_state_save(cpr_channel)

but cpr_state_save checks for mode differently before using channel,
and Coverity cannot infer that they are equivalent in outgoing QEMU,
and warns that channel may be NULL:

    cpr_state_save(channel)
        MigMode mode = migrate_mode();
        if (mode == MIG_MODE_CPR_TRANSFER) {
            f = cpr_transfer_output(channel, errp);

To make Coverity happy, assert that channel != NULL in cpr_state_save.

Resolves: Coverity CID 1590980
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Message-ID: <1738788841-211843-1-git-send-email-steven.sistare@oracle.com>
[assert instead of using parameters.mode in cpr_state_save]
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'rust/qemu-api/src')
0 files changed, 0 insertions, 0 deletions