5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-25 06:03:52 +03:00

add qm nbdstop

we use it to stop remote nbd server

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2017-01-03 15:03:16 +01:00 committed by Wolfgang Bumiller
parent 2189246c5c
commit 63a0937008
2 changed files with 30 additions and 0 deletions

View File

@ -220,6 +220,28 @@ __PACKAGE__->register_method ({
return undef;
}});
__PACKAGE__->register_method ({
name => 'nbdstop',
path => 'nbdstop',
method => 'PUT',
description => "Stop embedded nbd server.",
parameters => {
additionalProperties => 0,
properties => {
vmid => get_standard_option('pve-vmid', { completion => \&PVE::QemuServer::complete_vmid }),
},
},
returns => { type => 'null'},
code => sub {
my ($param) = @_;
my $vmid = $param->{vmid};
PVE::QemuServer::nbd_stop($vmid);
return undef;
}});
__PACKAGE__->register_method ({
name => 'mtunnel',
path => 'mtunnel',
@ -558,6 +580,8 @@ our $cmddef = {
mtunnel => [ __PACKAGE__, 'mtunnel', []],
nbdstop => [ __PACKAGE__, 'nbdstop', ['vmid']],
terminal => [ __PACKAGE__, 'terminal', ['vmid']],
};

View File

@ -6370,4 +6370,10 @@ sub complete_storage {
return $res;
}
sub nbd_stop {
my ($vmid) = @_;
vm_mon_cmd($vmid, 'nbd-server-stop');
}
1;