mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-02 21:14:59 +00:00
qemu-agent: allow hotplug of fstrim_cloned_disk option.
This option don't have any impact on device itself. Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
d08e787cae
commit
74ea2c65a9
@ -4844,6 +4844,8 @@ sub vmconfig_hotplug_pending {
|
|||||||
} elsif ($opt eq 'cpulimit') {
|
} elsif ($opt eq 'cpulimit') {
|
||||||
my $cpulimit = $conf->{pending}->{$opt} == 0 ? -1 : int($conf->{pending}->{$opt} * 100000);
|
my $cpulimit = $conf->{pending}->{$opt} == 0 ? -1 : int($conf->{pending}->{$opt} * 100000);
|
||||||
$cgroup->change_cpu_quota($cpulimit, 100000);
|
$cgroup->change_cpu_quota($cpulimit, 100000);
|
||||||
|
} elsif ($opt eq 'agent') {
|
||||||
|
vmconfig_update_agent($conf, $opt, $value);
|
||||||
} else {
|
} else {
|
||||||
die "skip\n"; # skip non-hot-pluggable options
|
die "skip\n"; # skip non-hot-pluggable options
|
||||||
}
|
}
|
||||||
@ -5003,6 +5005,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 {
|
sub vmconfig_update_disk {
|
||||||
my ($storecfg, $conf, $hotplug, $vmid, $opt, $value, $arch, $machine_type) = @_;
|
my ($storecfg, $conf, $hotplug, $vmid, $opt, $value, $arch, $machine_type) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user