mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-15 19:59:36 +00:00
fix #2315: api: have resize endpoint spawn a worker task
Similar to the corresponding endpoint for containers. Because disks are involved, this can be a longer running operation, as is also indicated by the 60 seconds timeout used in qemu_block_resize() which is called by this endpoint. This is a breaking API change. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
a6f14ef49b
commit
606d9d76b2
@ -4700,7 +4700,10 @@ __PACKAGE__->register_method({
|
||||
},
|
||||
},
|
||||
},
|
||||
returns => { type => 'null'},
|
||||
returns => {
|
||||
type => 'string',
|
||||
description => "the task ID.",
|
||||
},
|
||||
code => sub {
|
||||
my ($param) = @_;
|
||||
|
||||
@ -4784,8 +4787,11 @@ __PACKAGE__->register_method({
|
||||
PVE::QemuConfig->write_config($vmid, $conf);
|
||||
};
|
||||
|
||||
my $worker = sub {
|
||||
PVE::QemuConfig->lock_config($vmid, $updatefn);
|
||||
return;
|
||||
};
|
||||
|
||||
return $rpcenv->fork_worker('resize', $vmid, $authuser, $worker);
|
||||
}});
|
||||
|
||||
__PACKAGE__->register_method({
|
||||
|
Loading…
Reference in New Issue
Block a user