mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-17 23:14:01 +00: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;
|
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 ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'mtunnel',
|
name => 'mtunnel',
|
||||||
path => 'mtunnel',
|
path => 'mtunnel',
|
||||||
@ -558,6 +580,8 @@ our $cmddef = {
|
|||||||
|
|
||||||
mtunnel => [ __PACKAGE__, 'mtunnel', []],
|
mtunnel => [ __PACKAGE__, 'mtunnel', []],
|
||||||
|
|
||||||
|
nbdstop => [ __PACKAGE__, 'nbdstop', ['vmid']],
|
||||||
|
|
||||||
terminal => [ __PACKAGE__, 'terminal', ['vmid']],
|
terminal => [ __PACKAGE__, 'terminal', ['vmid']],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6370,4 +6370,10 @@ sub complete_storage {
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub nbd_stop {
|
||||||
|
my ($vmid) = @_;
|
||||||
|
|
||||||
|
vm_mon_cmd($vmid, 'nbd-server-stop');
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user