use 'eq' instead of regex for simple equality test.

This commit is contained in:
Dietmar Maurer
2017-05-06 17:20:52 +02:00
parent efcdabfb36
commit 7e5b531380

View File

@ -29,12 +29,14 @@ my $get_guestconfig = sub {
my $guestconf;
my $running;
if ($type =~ m/^qemu$/) {
if ($type eq 'qemu') {
$guestconf = PVE::QemuConfig->load_config($vmid);
$running = PVE::QemuServer::check_running($vmid);
} elsif ($type =~ m/^lxc$/) {
} elsif ($type eq 'lxc') {
$guestconf = PVE::LXC::Config->load_config($vmid);
$running = PVE::LXC::check_running($vmid);
} else {
die "internal error";
}
return ($guestconf, $type, $running);
@ -124,7 +126,7 @@ sub sync_guest {
my $job = $jobs->{$vmid};
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)
if $running;
}