From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Mira Limbeck <m.limbeck@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 qemu-server 2/2] fix clone_disk failing for nonexistent cloudinit disk
Date: Fri, 16 Oct 2020 15:45:46 +0200 [thread overview]
Message-ID: <a730e985-38fa-2abf-e39e-ed423d504884@proxmox.com> (raw)
In-Reply-To: <1443552e-8e26-ae63-9b09-d9a68d54177b@proxmox.com>
On 06.10.20 13:10, Mira Limbeck wrote:
> On 10/6/20 10:56 AM, Mira Limbeck wrote:
>> On 10/5/20 5:35 PM, Thomas Lamprecht wrote:
>>> On 28.09.20 10:36, Mira Limbeck wrote:
>>>> @@ -6906,6 +6906,8 @@ sub clone_disk {
>>>> $size = PVE::QemuServer::Cloudinit::CLOUDINIT_DISK_SIZE;
>>>> } elsif ($drivename eq 'efidisk0') {
>>>> $size = get_efivars_size($conf);
>>>> + } else {
>>>> + ($size) = PVE::Storage::volume_size_info($storecfg, $drive->{file}, 3);
>>>> }
>>>> $size /= 1024;
>>> doesn't this logs a "use of undefined value in division" or something like that
>>> somewhere in the non-else case?
>> No, in the cloudinit case we set it to a constant. In the efidisk case we call get_efivars_size() which dies if efivars is not a file, otherwise we get a size (-s). And in the else case we also die if we can't get the size. So size is set in every case before the first use.
> To clarify, the returned size in volume_size_info can be undefined, but not the other 2 cases. Would a die be a good idea in case the volume_size_info call returns 'undef'?
could be, could be possible to assert that in vdisk_alloc, as there
it rather seems that it's assumed to never be undef; but I just checked
the base and ZFS Plugin, so..
next prev parent reply other threads:[~2020-10-16 13:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 8:36 [pve-devel] [PATCH v2 qemu-server 1/2] fix VM clone from snapshot with " Mira Limbeck
2020-09-28 8:36 ` [pve-devel] [PATCH v2 qemu-server 2/2] fix clone_disk failing for nonexistent " Mira Limbeck
2020-10-05 15:35 ` Thomas Lamprecht
2020-10-06 8:56 ` Mira Limbeck
2020-10-06 11:10 ` Mira Limbeck
2020-10-16 13:45 ` Thomas Lamprecht [this message]
2020-10-16 13:40 ` [pve-devel] applied: " Thomas Lamprecht
2020-10-16 13:40 ` [pve-devel] applied: [PATCH v2 qemu-server 1/2] fix VM clone from snapshot with " Thomas Lamprecht
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=a730e985-38fa-2abf-e39e-ed423d504884@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=m.limbeck@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox