use 'eq' instead of regex for simple equality test.
This commit is contained in:
@ -29,12 +29,14 @@ my $get_guestconfig = sub {
|
|||||||
my $guestconf;
|
my $guestconf;
|
||||||
my $running;
|
my $running;
|
||||||
|
|
||||||
if ($type =~ m/^qemu$/) {
|
if ($type eq 'qemu') {
|
||||||
$guestconf = PVE::QemuConfig->load_config($vmid);
|
$guestconf = PVE::QemuConfig->load_config($vmid);
|
||||||
$running = PVE::QemuServer::check_running($vmid);
|
$running = PVE::QemuServer::check_running($vmid);
|
||||||
} elsif ($type =~ m/^lxc$/) {
|
} elsif ($type eq 'lxc') {
|
||||||
$guestconf = PVE::LXC::Config->load_config($vmid);
|
$guestconf = PVE::LXC::Config->load_config($vmid);
|
||||||
$running = PVE::LXC::check_running($vmid);
|
$running = PVE::LXC::check_running($vmid);
|
||||||
|
} else {
|
||||||
|
die "internal error";
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($guestconf, $type, $running);
|
return ($guestconf, $type, $running);
|
||||||
@ -124,7 +126,7 @@ sub sync_guest {
|
|||||||
my $job = $jobs->{$vmid};
|
my $job = $jobs->{$vmid};
|
||||||
my $tnode = $job->{tnode};
|
my $tnode = $job->{tnode};
|
||||||
|
|
||||||
if ($vm_type eq "qemu" && defined($guest_conf->{agent}) ) {
|
if ($vm_type eq 'qemu' && defined($guest_conf->{agent}) ) {
|
||||||
$qga = PVE::QemuServer::qga_check_running($vmid)
|
$qga = PVE::QemuServer::qga_check_running($vmid)
|
||||||
if $running;
|
if $running;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user