public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 qemu-server] api: qemu: make resize_vm async close #2315
@ 2021-01-12 11:07 Hannes Laimer
  2021-01-12 11:17 ` Oguz Bektas
  2021-01-12 11:24 ` Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Hannes Laimer @ 2021-01-12 11:07 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
Resize is now done in a task.

v1 -> v2: pass code that should be executed correctly to fork_worker

 PVE/API2/Qemu.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index e8de4ea..0c5d50c 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) = @_;
 
@@ -3816,9 +3816,10 @@ __PACKAGE__->register_method({
 
 	    PVE::QemuConfig->write_config($vmid, $conf);
 	};
-
-        PVE::QemuConfig->lock_config($vmid, $updatefn);
-        return;
+	my $worker = sub {
+	    PVE::QemuConfig->lock_config($vmid, $updatefn);
+	};
+	return $rpcenv->fork_worker('qmresize', $vmid, $authuser, $worker);
     }});
 
 __PACKAGE__->register_method({
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH v2 qemu-server] api: qemu: make resize_vm async close #2315
  2021-01-12 11:07 [pve-devel] [PATCH v2 qemu-server] api: qemu: make resize_vm async close #2315 Hannes Laimer
@ 2021-01-12 11:17 ` Oguz Bektas
  2021-01-12 11:24 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Oguz Bektas @ 2021-01-12 11:17 UTC (permalink / raw)
  To: Proxmox VE development discussion

hi,

thanks for the fix :)

Tested-by: Oguz Bektas <o.bektas@proxmox.com>


On Tue, Jan 12, 2021 at 12:07:54PM +0100, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> Resize is now done in a task.
> 
> v1 -> v2: pass code that should be executed correctly to fork_worker
> 
>  PVE/API2/Qemu.pm | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index e8de4ea..0c5d50c 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) = @_;
>  
> @@ -3816,9 +3816,10 @@ __PACKAGE__->register_method({
>  
>  	    PVE::QemuConfig->write_config($vmid, $conf);
>  	};
> -
> -        PVE::QemuConfig->lock_config($vmid, $updatefn);
> -        return;
> +	my $worker = sub {
> +	    PVE::QemuConfig->lock_config($vmid, $updatefn);
> +	};
> +	return $rpcenv->fork_worker('qmresize', $vmid, $authuser, $worker);
>      }});
>  
>  __PACKAGE__->register_method({
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH v2 qemu-server] api: qemu: make resize_vm async close #2315
  2021-01-12 11:07 [pve-devel] [PATCH v2 qemu-server] api: qemu: make resize_vm async close #2315 Hannes Laimer
  2021-01-12 11:17 ` Oguz Bektas
@ 2021-01-12 11:24 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-01-12 11:24 UTC (permalink / raw)
  To: Proxmox VE development discussion, Hannes Laimer

On 12.01.21 12:07, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> Resize is now done in a task.
> 
> v1 -> v2: pass code that should be executed correctly to fork_worker

yeah that looked weird in the v1, did not checked it and assumed
you tested the version you actually send at least once (please try do so
in the future).

Anyway, all other points I replied to v1 still apply to v2.

> 
>  PVE/API2/Qemu.pm | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index e8de4ea..0c5d50c 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) = @_;
>  
> @@ -3816,9 +3816,10 @@ __PACKAGE__->register_method({
>  
>  	    PVE::QemuConfig->write_config($vmid, $conf);
>  	};
> -
> -        PVE::QemuConfig->lock_config($vmid, $updatefn);
> -        return;
> +	my $worker = sub {
> +	    PVE::QemuConfig->lock_config($vmid, $updatefn);
> +	};
> +	return $rpcenv->fork_worker('qmresize', $vmid, $authuser, $worker);
>      }});
>  
>  __PACKAGE__->register_method({
> 





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-12 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 11:07 [pve-devel] [PATCH v2 qemu-server] api: qemu: make resize_vm async close #2315 Hannes Laimer
2021-01-12 11:17 ` Oguz Bektas
2021-01-12 11:24 ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal