From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 169451FF164
	for <inbox@lore.proxmox.com>; Fri, 23 May 2025 11:53:46 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id C56B817BCB;
	Fri, 23 May 2025 11:53:47 +0200 (CEST)
Message-ID: <288adb8e-5485-4777-b992-a68f9f610c11@proxmox.com>
Date: Fri, 23 May 2025 11:53:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>,
 "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>
References: <20250509141532.111458-1-f.ebner@proxmox.com>
 <20250509141532.111458-3-f.ebner@proxmox.com>
 <175dd76aa95365010c8448bdd15eddf30aa39641.camel@groupe-cyllene.com>
 <247b14e8-0915-461b-9eb7-c6acb83e762d@proxmox.com>
 <67db7959a03a391df39e9b5af24edc2bed48a21d.camel@groupe-cyllene.com>
 <30552bb9-70aa-49f1-8ff9-f8cad5f31d65@proxmox.com>
 <abbb8159177112d0f1f44d1dccc8fc3907bccb73.camel@groupe-cyllene.com>
 <49ae8bdf-912a-4a87-8290-f63ecef560e1@proxmox.com>
 <abebd4ee7f1197d9e549203355c9482bd7b1004a.camel@groupe-cyllene.com>
Content-Language: en-US
From: Fiona Ebner <f.ebner@proxmox.com>
In-Reply-To: <abebd4ee7f1197d9e549203355c9482bd7b1004a.camel@groupe-cyllene.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.033 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
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 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] [RFC storage 1/3] 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 <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

Am 23.05.25 um 11:34 schrieb DERUMIER, Alexandre:
>>> I intentionally do not handle CD-ROMs, qemu-server should be
>>> concerned
>>> with doing that. There is a comment about this ;)
> 
> I mean, could it better to have something like this ? :
> 
> 
> sub qemu_blockdev_options {
>     my ($cfg, $volid, $snapname) = @_;
> 
>     my ($storeid, $volname) = parse_volume_id($volid, 1);
> 
>     if($storeid) {
>         my $scfg = storage_config($cfg, $storeid);
> 
>         my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
>         my ($vtype) = $plugin->parse_volname($volname);
> 
>         die "cannot use volume of type '$vtype' as a QEMU
> blockdevice\n"
>             if $vtype ne 'images' && $vtype ne 'iso' && $vtype ne
> 'import';
> 
>         die "QEMU blockdevice - 'snapname' argument is not supported
> for vtype '$vtype'"
>             if $snapname && $vtype ne 'images';
>     } elsif ($volid =~ m|^/|) {
>         my $st = File::stat::stat($volid);
>         my $driver = (S_ISCHR($st->mode) || S_ISBLK($st->mode)) ?
> 'host_device' : 'file';
>         return { driver => $driver, filename => $volid };
>     }
> 
>     return $plugin->qemu_blockdev_options($scfg, $storeid, $volname,
> $snapname);
> }

Yes, it would be possible, and it is a close call. But I briefly chatted
with Fabian off-list and we think it's better to do this in qemu-server,
together with the CD-ROM handling. Since the whole use-case is related
to a QEMU-specific interface already.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel