From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E23BA1FF16B for ; Tue, 1 Jul 2025 13:52:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3ECEE3C5AA; Tue, 1 Jul 2025 13:52:49 +0200 (CEST) Message-ID: <00842c28-b265-434e-9b42-2874c6195399@proxmox.com> Date: Tue, 1 Jul 2025 13:52:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Fiona Ebner To: Thomas Lamprecht , Proxmox VE development discussion References: <20250626144644.279679-1-f.ebner@proxmox.com> <20250626144644.279679-2-f.ebner@proxmox.com> <99f545d0-b00b-4216-803b-51fe5eac17f3@proxmox.com> <52125694-2521-4e90-84d8-0a4b96990820@proxmox.com> Content-Language: en-US In-Reply-To: <52125694-2521-4e90-84d8-0a4b96990820@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v3 storage 1/9] plugin: add method to get qemu blockdevice options for volume X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 01.07.25 um 13:01 schrieb Fiona Ebner: > Am 01.07.25 um 11:28 schrieb Thomas Lamprecht: >> Am 26.06.25 um 16:40 schrieb Fiona Ebner: >>> + >>> + my $blockdev = {}; >>> + >>> + my ($path) = $class->filesystem_path($scfg, $volname); >>> + >>> + if ($path =~ m|^/|) { >>> + # The 'file' driver only works for regular files. The check below is taken from >>> + # block/file-posix.c:hdev_probe_device() in QEMU. Do not bother with detecting 'host_cdrom' >>> + # devices here, those are not managed by the storage layer. >>> + my $st = File::stat::stat($path) or die "stat for '$path' failed - $!\n"; >>> + my $driver = (S_ISCHR($st->mode) || S_ISBLK($st->mode)) ? 'host_device' : 'file'; >>> + $blockdev = { driver => $driver, filename => $path }; >>> + } else { >>> + die "storage plugin doesn't implement qemu_blockdev_options() method\n"; >>> + } >> >> Should we rather default to an empty set of extra options? At least for external >> plugins that would be the safer choice for upgrading, might not always work but >> as is users can only loose FWICT? > > What extra options do you mean? The default implementation here only > sets driver and filename which is the most minimal possible. Do you mean restricting what the individual plugins may return and verify that in the Storage.pm's implementation of qemu_blockdev_options()? E.g. a hash with entries for allowed drivers and allowed driver-specific options like $allowed = { file => { filename => 1, }, host_device => { filename => 1, }, rbd => { ... }, ... }; Then plugin authors that already require a custom implementation would need to tell us what they need first and we'd need to allow it. Is this somewhat what you meant? _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel