[pve-devel] [PATCH qemu-server] fix #1749: do not copy pending changes when cloning a vm
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed May 2 11:06:55 CEST 2018
On 5/2/18 10:55 AM, Dominik Csapak wrote:
> cloning a vm means copying the current state, not the
> state of 'some time in the future, when the vm is started again'
> we should not copy the pending changes, which also fixes the
> issue that we got a wrong pending change on the disks,net,smbios,etc.
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> PVE/API2/Qemu.pm | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 0f27d29..e340e24 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -2624,6 +2624,9 @@ __PACKAGE__->register_method({
> my $fullclone = {};
> my $vollist = [];
>
> + # do not copy pending changes
> + delete $oldconf->{pending};
> +
I'd output a warning or informative note, if pending changes got
deleted/ignored. Else it may be a bit nontransparent and confusing
for the user, IMO.
> foreach my $opt (keys %$oldconf) {
> my $value = $oldconf->{$opt};
>
>
More information about the pve-devel
mailing list