all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v3 qemu-server] qemu-agent: allow hotplug of fstrim_cloned_disk option.
@ 2021-10-06 21:58 Alexandre Derumier
  2021-11-04 11:01 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Derumier @ 2021-10-06 21:58 UTC (permalink / raw)
  To: pve-devel

This option don't have any impact on device itself.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 PVE/QemuServer.pm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 076ce59..2c63826 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4829,6 +4829,8 @@ sub vmconfig_hotplug_pending {
 	    } elsif ($opt eq 'cpulimit') {
 		my $cpulimit = $conf->{pending}->{$opt} == 0 ? -1 : int($conf->{pending}->{$opt} * 100000);
 		$cgroup->change_cpu_quota($cpulimit, 100000);
+	    } elsif ($opt eq 'agent') {
+		vmconfig_update_agent($conf, $opt, $value);
 	    } else {
 		die "skip\n";  # skip non-hot-pluggable options
 	    }
@@ -4988,6 +4990,29 @@ sub vmconfig_update_net {
     }
 }
 
+sub vmconfig_update_agent {
+    my ($conf, $opt, $value) = @_;
+
+    die "skip\n" if !$conf->{$opt};
+
+    my $hotplug_options = { fstrim_cloned_disks => 1 };
+
+    my $old_agent = parse_guest_agent($conf);
+    my $agent = parse_guest_agent({$opt => $value});
+
+    #added/changed options
+    foreach my $option (keys %$agent) {
+	next if defined($hotplug_options->{$option});
+	die "skip\n" if safe_string_ne($agent->{$option}, $old_agent->{$option});
+    }
+
+    #removed options
+    foreach my $option (keys %$old_agent) {
+	next if defined($hotplug_options->{$option});
+	die "skip\n" if safe_string_ne($old_agent->{$option}, $agent->{$option});
+    }
+}
+
 sub vmconfig_update_disk {
     my ($storecfg, $conf, $hotplug, $vmid, $opt, $value, $arch, $machine_type) = @_;
 
-- 
2.30.2




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

* [pve-devel] applied: [PATCH v3 qemu-server] qemu-agent: allow hotplug of fstrim_cloned_disk option.
  2021-10-06 21:58 [pve-devel] [PATCH v3 qemu-server] qemu-agent: allow hotplug of fstrim_cloned_disk option Alexandre Derumier
@ 2021-11-04 11:01 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-11-04 11:01 UTC (permalink / raw)
  To: Proxmox VE development discussion, Alexandre Derumier

On 06.10.21 23:58, Alexandre Derumier wrote:
> This option don't have any impact on device itself.
> 
> Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> ---
>  PVE/QemuServer.pm | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
>

applied, thanks!




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

end of thread, other threads:[~2021-11-04 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 21:58 [pve-devel] [PATCH v3 qemu-server] qemu-agent: allow hotplug of fstrim_cloned_disk option Alexandre Derumier
2021-11-04 11:01 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal