previously, we did not check the file parameter of a disk,
allowing passthrough of a block device (by design)
with the change to the json parser for the disks, the format
became 'pve-volume-id' which is only valid for our volume ids
(and later we also allowed the value 'none')
this patch alternatively checks if the parameter is a path
or 'cdrom'
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
$confdesc->{"net$i"} = $netdesc;
}
$confdesc->{"net$i"} = $netdesc;
}
-PVE::JSONSchema::register_format('pve-volume-id-or-none', \&verify_volume_id_or_none);
-sub verify_volume_id_or_none {
+PVE::JSONSchema::register_format('pve-volume-id-or-qm-path', \&verify_volume_id_or_qm_path);
+sub verify_volume_id_or_qm_path {
my ($volid, $noerr) = @_;
my ($volid, $noerr) = @_;
- return $volid if $volid eq 'none';
+ if ($volid eq 'none' || $volid eq 'cdrom' || $volid =~ m|^/|) {
+ return $volid;
+ }
+
+ # if its neither 'none' nor 'cdrom' nor a path, check if its a volume-id
$volid = eval { PVE::JSONSchema::check_format('pve-volume-id', $volid, '') };
if ($@) {
return undef if $noerr;
$volid = eval { PVE::JSONSchema::check_format('pve-volume-id', $volid, '') };
if ($@) {
return undef if $noerr;
volume => { alias => 'file' },
file => {
type => 'string',
volume => { alias => 'file' },
file => {
type => 'string',
- format => 'pve-volume-id-or-none',
+ format => 'pve-volume-id-or-qm-path',
default_key => 1,
format_description => 'volume',
description => "The drive's backing volume.",
default_key => 1,
format_description => 'volume',
description => "The drive's backing volume.",
* Fix #643: activate volumes before resizing
* Fix #643: activate volumes before resizing
+ * fix #947: reenable disk/cdrom passthrough
+
-- Proxmox Support Team <support@proxmox.com> Thu, 21 Apr 2016 10:34:42 +0200
qemu-server (4.0-70) unstable; urgency=medium
-- Proxmox Support Team <support@proxmox.com> Thu, 21 Apr 2016 10:34:42 +0200
qemu-server (4.0-70) unstable; urgency=medium