Daniel P. Berrange wrote:
Or rather, such state should be part of the migration. There's the
question of whether to transform the path on the target, but "which
media is in the drive" is part of the hardware state.
(logically we would copy all of the data of all block devices, but
that's not very practical, so we assume shared storage).
What other commands are unsafe during migration? I exclude host
device assignment which is obviously migration unfriendly.
USB + virtio device attach/detach - well at least have the same need as
media change - you'd need to propagate the change to the other side in
some way. Currently migrate just assumes the management tool/admin has
started QEMU on the destinations with the matching hardware config, and
for libvirt to use the monitor to add USB /virtio devices at both ends
has the race condition/synchronization problem .
Any hotplug, for that matter.
The hardware topology should be part of the state; there is no other
way to deal with hotplug. Hotplug can create configurations that are
impossible to recreate using the command line.