From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: [pve-devel] applied: [PATCH qemu-server] clone disk: prevent 'uninitialized value' warning for unused check
Date: Fri, 19 Apr 2024 08:59:16 +0200 [thread overview]
Message-ID: <1713509943.r1x48tmtz1.astroid@yuna.none> (raw)
In-Reply-To: <20240419065154.148615-1-d.csapak@proxmox.com>
On April 19, 2024 8:51 am, Dominik Csapak wrote:
> since commit
> 1f743141 (fix #1905: Allow moving unused disks)
>
> we want to check the source drive name for 'unused', but in case of
> importing a volume from the 'import' content type (e.g. from esxi),
> there is no source drive name. So we have to first check if it's
> defined.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> i did not add a 'fixes' trailer, because when the patch was written
> there was no 'import' content-type where that could have failed.
>
> also at the time the 'import' was written, the patch checking for unused
> was not applied yet, so there no fault there too..
>
>
> PVE/QemuServer.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 661613df..28e630d3 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -8154,7 +8154,7 @@ sub clone_disk {
> my ($newvmid, $dst_drivename, $efisize) = $dest->@{qw(vmid drivename efisize)};
> my ($storage, $format) = $dest->@{qw(storage format)};
>
> - my $unused = $src_drivename =~ /^unused/;
> + my $unused = defined($src_drivename) && $src_drivename =~ /^unused/;
> my $use_drive_mirror = $full && $running && $src_drivename && !$snapname && !$unused;
>
> if ($src_drivename && $dst_drivename && $src_drivename ne $dst_drivename) {
> --
> 2.39.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
prev parent reply other threads:[~2024-04-19 6:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 6:51 [pve-devel] " Dominik Csapak
2024-04-19 6:59 ` Fabian Grünbichler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1713509943.r1x48tmtz1.astroid@yuna.none \
--to=f.gruenbichler@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.