]> git.proxmox.com Git - qemu-server.git/commit
add qemu_drive_mirror_monitor completion modes
authorMira Limbeck <m.limbeck@proxmox.com>
Tue, 17 Mar 2020 19:56:09 +0000 (20:56 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 18 Mar 2020 07:03:44 +0000 (08:03 +0100)
commite02fb12620a3be0c2539822fd7ea8f8b0c2f04e5
treedba681ef4d5067cf5df709c649e59bf3769e2ff8
parent758a08eb39cbce40ad20d2b5021ab0b6d45ebb79
add qemu_drive_mirror_monitor completion modes

With Qemu 4.2 we encountered a problem with unix sockets and SSH socket
forwarding for drive-mirror. It seems the socket gets reopened again and
again after it closes for some reason. This can be worked around by
specifying 'block-job-cancel' instead of 'block-job-complete' when we're
not interested in swapping the disks again from NBD to their original
protocol. This is always the case when we use drive-mirror for live
migrating a VM.

qemu_drive_mirror is used for migration and for clone_disk. All in all
we have 3 cases to handle. Either the 'skip' case which skips the
completion of the job. The 'wait' case which was the default before and
still is when $completion is undefined. And the new 'wait_noswap' case
which is used for the live migration.
If 'wait_noswap' is specified, we issue a 'block-job-cancel' once the block
job is in 'ready' state. This completes the block job without swapping the
disks.

clone_disk always uses 'block-job-cancel' via the qemu_blockjobs_cancel
sub.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuMigrate.pm
PVE/QemuServer.pm