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:
parent
2189246c5c
commit
63a0937008
@ -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']],
|
||||
};
|
||||
|
||||
|
@ -6370,4 +6370,10 @@ sub complete_storage {
|
||||
return $res;
|
||||
}
|
||||
|
||||
sub nbd_stop {
|
||||
my ($vmid) = @_;
|
||||
|
||||
vm_mon_cmd($vmid, 'nbd-server-stop');
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user