mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 18:53:07 +00:00
cleanup: detete trailing whitespace
This commit is contained in:
parent
b67900f17a
commit
f5eb281ad3
@ -117,7 +117,7 @@ sub finish_tunnel {
|
|||||||
|
|
||||||
sub lock_vm {
|
sub lock_vm {
|
||||||
my ($self, $vmid, $code, @param) = @_;
|
my ($self, $vmid, $code, @param) = @_;
|
||||||
|
|
||||||
return PVE::QemuServer::lock_config($vmid, $code, @param);
|
return PVE::QemuServer::lock_config($vmid, $code, @param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ sub phase1_cleanup {
|
|||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
$self->log('err', $err);
|
$self->log('err', $err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($self->{volumes}) {
|
if ($self->{volumes}) {
|
||||||
foreach my $volid (@{$self->{volumes}}) {
|
foreach my $volid (@{$self->{volumes}}) {
|
||||||
$self->log('err', "found stale volume copy '$volid' on node '$self->{node}'");
|
$self->log('err', "found stale volume copy '$volid' on node '$self->{node}'");
|
||||||
@ -343,7 +343,7 @@ sub phase2 {
|
|||||||
$self->log('info', "migration speed: $mbps MB/s");
|
$self->log('info', "migration speed: $mbps MB/s");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($stat->{status} eq 'failed' || $stat->{status} eq 'cancelled') {
|
if ($stat->{status} eq 'failed' || $stat->{status} eq 'cancelled') {
|
||||||
die "aborting\n"
|
die "aborting\n"
|
||||||
}
|
}
|
||||||
@ -390,7 +390,7 @@ sub phase2_cleanup {
|
|||||||
|
|
||||||
sub phase3 {
|
sub phase3 {
|
||||||
my ($self, $vmid) = @_;
|
my ($self, $vmid) = @_;
|
||||||
|
|
||||||
my $volids = $self->{volumes};
|
my $volids = $self->{volumes};
|
||||||
|
|
||||||
# destroy local copies
|
# destroy local copies
|
||||||
@ -416,18 +416,16 @@ sub phase3_cleanup {
|
|||||||
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
|
die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
|
||||||
if !rename($conffile, $newconffile);
|
if !rename($conffile, $newconffile);
|
||||||
|
|
||||||
## now that config file is move, we can resume vm on target if livemigrate
|
# now that config file is move, we can resume vm on target if livemigrate
|
||||||
if ($self->{tunnel}) {
|
if ($self->{tunnel}) {
|
||||||
|
|
||||||
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'resume', $vmid, '--skiplock'];
|
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'resume', $vmid, '--skiplock'];
|
||||||
eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
$self->log('err', $err);
|
$self->log('err', $err);
|
||||||
$self->{errors} = 1;
|
$self->{errors} = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# always stop local VM
|
# always stop local VM
|
||||||
eval { PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1, 1); };
|
eval { PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1, 1); };
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
|
@ -1940,7 +1940,7 @@ sub vmstatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res if !$full;
|
return $res if !$full;
|
||||||
|
|
||||||
my $qmpclient = PVE::QMPClient->new();
|
my $qmpclient = PVE::QMPClient->new();
|
||||||
|
|
||||||
@ -2588,7 +2588,7 @@ sub qemu_block_set_io_throttle {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# old code, only used to shutdown old VM after update
|
# old code, only used to shutdown old VM after update
|
||||||
sub __read_avail {
|
sub __read_avail {
|
||||||
my ($fh, $timeout) = @_;
|
my ($fh, $timeout) = @_;
|
||||||
|
|
||||||
@ -2617,14 +2617,14 @@ sub __read_avail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
die "monitor read timeout\n" if !scalar(@ready);
|
die "monitor read timeout\n" if !scalar(@ready);
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
# old code, only used to shutdown old VM after update
|
# old code, only used to shutdown old VM after update
|
||||||
sub vm_monitor_command {
|
sub vm_monitor_command {
|
||||||
my ($vmid, $cmdstr, $nocheck) = @_;
|
my ($vmid, $cmdstr, $nocheck) = @_;
|
||||||
|
|
||||||
my $res;
|
my $res;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
@ -2678,9 +2678,9 @@ sub vm_monitor_command {
|
|||||||
if ($res = __read_avail($sock, $timeout)) {
|
if ($res = __read_avail($sock, $timeout)) {
|
||||||
|
|
||||||
my @lines = split("\r?\n", $res);
|
my @lines = split("\r?\n", $res);
|
||||||
|
|
||||||
shift @lines if $lines[0] !~ m/^unknown command/; # skip echo
|
shift @lines if $lines[0] !~ m/^unknown command/; # skip echo
|
||||||
|
|
||||||
$res = join("\n", @lines);
|
$res = join("\n", @lines);
|
||||||
$res .= "\n";
|
$res .= "\n";
|
||||||
}
|
}
|
||||||
@ -2692,7 +2692,7 @@ sub vm_monitor_command {
|
|||||||
syslog("err", "VM $vmid monitor command failed - $err");
|
syslog("err", "VM $vmid monitor command failed - $err");
|
||||||
die $err;
|
die $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2811,7 +2811,7 @@ sub vm_qmp_command {
|
|||||||
eval {
|
eval {
|
||||||
die "VM $vmid not running\n" if !check_running($vmid, $nocheck);
|
die "VM $vmid not running\n" if !check_running($vmid, $nocheck);
|
||||||
my $sname = PVE::QemuServer::qmp_socket($vmid);
|
my $sname = PVE::QemuServer::qmp_socket($vmid);
|
||||||
if (-e $sname) {
|
if (-e $sname) {
|
||||||
my $qmpclient = PVE::QMPClient->new();
|
my $qmpclient = PVE::QMPClient->new();
|
||||||
|
|
||||||
$res = $qmpclient->cmd($vmid, $cmd);
|
$res = $qmpclient->cmd($vmid, $cmd);
|
||||||
@ -2836,7 +2836,7 @@ sub vm_human_monitor_command {
|
|||||||
|
|
||||||
my $res;
|
my $res;
|
||||||
|
|
||||||
my $cmd = {
|
my $cmd = {
|
||||||
execute => 'human-monitor-command',
|
execute => 'human-monitor-command',
|
||||||
arguments => { 'command-line' => $cmdline},
|
arguments => { 'command-line' => $cmdline},
|
||||||
};
|
};
|
||||||
@ -3019,7 +3019,7 @@ sub vm_sendkey {
|
|||||||
lock_config($vmid, sub {
|
lock_config($vmid, sub {
|
||||||
|
|
||||||
my $conf = load_config($vmid);
|
my $conf = load_config($vmid);
|
||||||
|
|
||||||
# there is no qmp command, so we use the human monitor command
|
# there is no qmp command, so we use the human monitor command
|
||||||
vm_human_monitor_command($vmid, "sendkey $key");
|
vm_human_monitor_command($vmid, "sendkey $key");
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user