From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Fiona Ebner <f.ebner@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: [pve-devel] applied: [PATCH qemu-server] fix #4085: properly activate cicustom storage(s)
Date: Wed, 31 Jan 2024 12:29:30 +0100 [thread overview]
Message-ID: <1706700551.gmodouf3pq.astroid@yuna.none> (raw)
In-Reply-To: <c984445b-d944-4472-bdff-4ee4a4e71c9a@proxmox.com>
On January 30, 2024 3:34 pm, Fiona Ebner wrote:
> Am 25.01.24 um 13:33 schrieb Fabian Grünbichler:
>> PVE::Storage::path() neither activates the storage of the passed-in volume, nor
>> does it ensure that the returned value is actually a file or block device, so
>> this actually fixes two issues. PVE::Storage::abs_filesystem_path() actually
>> takes care of both, while still calling path() under the hood (since $volid
>> here is always a proper volid, unless we change the cicustom schema at some
>> point in the future).
>>
>> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>
> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
with this added
>
>> ---
>> Tested by forcefully de-activating a storage only used for cicustom volumes
>> right before starting the VM in question
>>
>> PVE/QemuServer/Cloudinit.pm | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
>> index 7449993a..9a500f8a 100644
>> --- a/PVE/QemuServer/Cloudinit.pm
>> +++ b/PVE/QemuServer/Cloudinit.pm
>> @@ -550,8 +550,11 @@ sub get_custom_cloudinit_files {
>> sub read_cloudinit_snippets_file {
>> my ($storage_conf, $volid) = @_;
>>
>> - my ($full_path, undef, $type) = PVE::Storage::path($storage_conf, $volid);
>> - die "$volid is not in the snippets directory\n" if $type ne 'snippets';
>> + my ($vtype, undef, undef, undef, undef, undef, undef) = PVE::Storage::parse_volname($storage_conf, $volid);
>
> Style nit: line too long. Could be just
> my ($vtype) = ...
and this addressed as well ;) thanks!
>
>> +
>> + die "$volid is not in the snippets directory\n" if $vtype ne 'snippets';
>> +
>> + my $full_path = PVE::Storage::abs_filesystem_path($storage_conf, $volid, 1);
>> return PVE::Tools::file_get_contents($full_path, 1 * 1024 * 1024);
>> }
>>
>
prev parent reply other threads:[~2024-01-31 11:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 12:33 [pve-devel] " Fabian Grünbichler
2024-01-30 14:34 ` Fiona Ebner
2024-01-31 11:29 ` 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=1706700551.gmodouf3pq.astroid@yuna.none \
--to=f.gruenbichler@proxmox.com \
--cc=f.ebner@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.