mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-03 20:39:59 +00:00
put target vm in singlestep mode and resume it only when config is moved
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
d691e6d3ec
commit
b67900f17a
@ -416,6 +416,18 @@ sub phase3_cleanup {
|
||||
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
|
||||
if !rename($conffile, $newconffile);
|
||||
|
||||
## now that config file is move, we can resume vm on target if livemigrate
|
||||
if ($self->{tunnel}) {
|
||||
|
||||
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'resume', $vmid, '--skiplock'];
|
||||
eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
||||
if (my $err = $@) {
|
||||
$self->log('err', $err);
|
||||
$self->{errors} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# always stop local VM
|
||||
eval { PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1, 1); };
|
||||
if (my $err = $@) {
|
||||
|
@ -2037,6 +2037,8 @@ sub config_to_command {
|
||||
|
||||
push @$cmd, '-incoming', $migrate_uri if $migrate_uri;
|
||||
|
||||
push @$cmd, '-S' if $migrate_uri;
|
||||
|
||||
my $use_usb2 = 0;
|
||||
for (my $i = 0; $i < $MAX_USB_DEVICES; $i++) {
|
||||
next if !$conf->{"usb$i"};
|
||||
|
Loading…
Reference in New Issue
Block a user