On 2026-06-23 5:24 AM, Dr. David Alan Gilbert wrote:
> * Dongli Zhang ([email protected]) wrote:
>> Currently the cpr-transfer source QEMU instance cannot be driven entirely
>> via HMP.  The source must use QMP in order to specify both the
>> main migration channel and the CPR channel.
>>
>> Extend the HMP migrate command with an optional CPR channel URI. When the
>> migration mode is cpr-transfer, HMP uses this URI to build a
>> CPR MigrationChannel in addition to the main migration channel. The new
>> argument is rejected unless the migration mode is cpr-transfer, so existing
>> HMP migrate usage is unchanged.
>>
>> For example, source QEMU HMP commands can be something like below. The
>> "unix:/tmp/cpr.sock" is for CPR URI.
>>
>> (qemu) migrate_set_parameter mode cpr-transfer
>> (qemu) migrate tcp:0:50002 unix:/tmp/cpr.sock
>>
>> Signed-off-by: Dongli Zhang <[email protected]>
> 
> Yeh this looks OK to me; I don't see a check for if you do:
> (qemu) migrate_set_parameter mode cpr-transfer
> (qemu) migrate tcp:0:50002
> 
> Does that get caught by the qmp_migrate or should you add a check here?

I did test this before sending the patch.

With cpr-transfer mode enabled, missing the CPR channel is caught by
migrate_channels_parse().

(qemu) migrate_set_parameter mode cpr-transfer
(qemu) migrate tcp:0:50002
Error: missing 'cpr' migration channel

... including when the second uri is not a UNIX domain socket, reported by
cpr_transfer_output().

(qemu) migrate tcp:0:50002 tcp:0:50003
Error: bad cpr channel address; must be unix

> 
> I do have a slight preference for using flag optional parameters rather 
> than positional, e.g.
> 
>    migrate -c unix:/tmp/cpr.sock tcp:0:50002
> 
> but I wouldn't insist on it.

I will follow this as Peter also voted for it.

Thank you very much!

Dongli Zhang




Reply via email to