* [pve-devel] [PATCH qemu-server] api: qemu: make resize_vm async close #2315
@ 2021-01-12 9:44 Hannes Laimer
2021-01-12 11:20 ` Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Hannes Laimer @ 2021-01-12 9:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
Resizing is now done asynchronous in a task.
PVE/API2/Qemu.pm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index e8de4ea..379f34a 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -3730,7 +3730,7 @@ __PACKAGE__->register_method({
},
},
},
- returns => { type => 'null'},
+ returns => { type => 'string'},
code => sub {
my ($param) = @_;
@@ -3817,8 +3817,7 @@ __PACKAGE__->register_method({
PVE::QemuConfig->write_config($vmid, $conf);
};
- PVE::QemuConfig->lock_config($vmid, $updatefn);
- return;
+ return $rpcenv->fork_worker('qmresize', $vmid, $authuser, PVE::QemuConfig->lock_config($vmid, $updatefn));
}});
__PACKAGE__->register_method({
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH qemu-server] api: qemu: make resize_vm async close #2315
2021-01-12 9:44 [pve-devel] [PATCH qemu-server] api: qemu: make resize_vm async close #2315 Hannes Laimer
@ 2021-01-12 11:20 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-01-12 11:20 UTC (permalink / raw)
To: Proxmox VE development discussion, Hannes Laimer
On 12.01.21 10:44, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> Resizing is now done asynchronous in a task.
seems like an API change, doesn't it? Maybe (did not checked) we could
add an "async" boolean param and make the return type a optional string, can
you please check if that would work and stay compatible as long as async is not
passed as true.
Then there are again a few cosmetic, but still important, issues:
* even if it's rather obvious the cost adding something like:
"resize can easily hang for a longer time depending on underlying storage
and load" is almost zero (takes <10 seconds of one person) and can only
help to avoid people going to the b
* place the "fix #2315:" first
https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commit_Messages
* replace the "qemu:" with "disk:", as we're in the qemu-server repository
the "qemu" doesn't adds much informational value here (like it would in the,
e.g., pve-manager one).
thanks!
>
> PVE/API2/Qemu.pm | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index e8de4ea..379f34a 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -3730,7 +3730,7 @@ __PACKAGE__->register_method({
> },
> },
> },
> - returns => { type => 'null'},
> + returns => { type => 'string'},
> code => sub {
> my ($param) = @_;
>
> @@ -3817,8 +3817,7 @@ __PACKAGE__->register_method({
> PVE::QemuConfig->write_config($vmid, $conf);
> };
>
> - PVE::QemuConfig->lock_config($vmid, $updatefn);
> - return;
> + return $rpcenv->fork_worker('qmresize', $vmid, $authuser, PVE::QemuConfig->lock_config($vmid, $updatefn));
> }});
>
> __PACKAGE__->register_method({
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-12 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 9:44 [pve-devel] [PATCH qemu-server] api: qemu: make resize_vm async close #2315 Hannes Laimer
2021-01-12 11:20 ` Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox