]> git.proxmox.com Git - qemu-server.git/blobdiff - test/snapshot-test.pm
tree wide cleanup of s/return undef/return/
[qemu-server.git] / test / snapshot-test.pm
index 1a2b4c4dc3e7d7df5a8c1de3c396d496e1685803..0b073798ae1e1e90c7cf2ac6a12baafcc05a4010 100644 (file)
@@ -300,7 +300,7 @@ sub __snapshot_save_vmstate {
 
 sub assert_config_exists_on_node {
     my ($vmid, $node) = @_;
-    return -f cfs_config_path(undef, $vmid, $node);
+    return -f cfs_config_path("PVE::QemuConfig", $vmid, $node);
 }
 # END mocked PVE::QemuConfig methods
 
@@ -315,7 +315,7 @@ sub vm_running_locally {
 # BEGIN mocked PVE::QemuServer::Monitor methods
 
 sub qmp_cmd {
-    my ($vmid, $cmd, $nocheck) = @_;
+    my ($vmid, $cmd) = @_;
 
     my $exec = $cmd->{execute};
     if ($exec eq "delete-drive-snapshot") {
@@ -356,13 +356,13 @@ sub do_snapshots_with_qemu {
 }
 
 sub vm_start {
-    my ($storecfg, $vmid, $statefile, $skiplock, $migratedfrom, $paused, $forcemachine) = @_;
+    my ($storecfg, $vmid, $params, $migrate_opts) = @_;
 
     die "Storage config not mocked! aborting\n"
        if defined($storecfg);
 
     die "statefile and forcemachine must be both defined or undefined! aborting\n"
-       if defined($statefile) xor defined($forcemachine);
+       if defined($params->{statefile}) xor defined($params->{forcemachine});
 
     return;
 }
@@ -399,10 +399,10 @@ $qemu_config_module->mock('assert_config_exists_on_node', \&assert_config_exists
 # ignore existing replication config
 my $repl_config_module = new Test::MockModule('PVE::ReplicationConfig');
 $repl_config_module->mock('new' => sub { return bless {}, "PVE::ReplicationConfig" });
-$repl_config_module->mock('check_for_existing_jobs' => sub { return undef });
+$repl_config_module->mock('check_for_existing_jobs' => sub { return });
 
 my $storage_module = new Test::MockModule('PVE::Storage');
-$storage_module->mock('config', sub { return undef; });
+$storage_module->mock('config', sub { return; });
 $storage_module->mock('path', sub { return "/some/store/statefile/path"; });
 $storage_module->mock('activate_volumes', \&mocked_activate_volumes);
 $storage_module->mock('deactivate_volumes', \&mocked_deactivate_volumes);