]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/CLI/qm.pm
qm rescan: add dryrun option
[qemu-server.git] / PVE / CLI / qm.pm
index 48fbc5fca3430b857d4697973ad09b990c86bfb8..cf26943ce3709f1a6d73f57a091658bcc86fc38f 100755 (executable)
@@ -404,13 +404,23 @@ __PACKAGE__->register_method ({
                optional => 1,
                completion => \&PVE::QemuServer::complete_vmid,
            }),
+           dryrun => {
+               type => 'boolean',
+               optional => 1,
+               default => 0,
+               description => 'Do not actually write changes out to conifg.',
+           },
        },
     },
     returns => { type => 'null'},
     code => sub {
        my ($param) = @_;
 
-       PVE::QemuServer::rescan($param->{vmid});
+       my $dryrun = $param->{dryrun};
+
+       print "NOTE: running in dry-run mode, won't write changes out!\n" if $dryrun;
+
+       PVE::QemuServer::rescan($param->{vmid}, 0, $dryrun);
 
        return undef;
     }});