[pve-devel] [PATCH qemu-server] remove pve-qm-drive
Dietmar Maurer
dietmar at proxmox.com
Mon May 23 06:51:09 CEST 2016
> On May 19, 2016 at 11:44 AM Wolfgang Bumiller <w.bumiller at proxmox.com> wrote:
>
>
> Let 'cdrom' use the pve-qm-ide format, as it's supposed to
> be an alias to ide2.
> We're not using the 'alias' schema property (yet) since
> there's still a parse function in qemu-server which does not
> deal with them.
>
> This also brings back support for old-style filenames for
> the drive options other than 'cdrom' (which is most likely
> only found in very very old backup files).
> ---
> PVE/QemuServer.pm | 25 ++++++++++++-------------
> 1 file changed, 12 insertions(+), 13 deletions(-)
> @@ -662,6 +662,13 @@ sub verify_volume_id_or_qm_path {
> return $volid;
> }
>
> + # parse_vm_config special-cases old-style file names and converts them,
> so
> + # allow them, too. filename_to_volume_id() uses the same cases as we have
> + # above plus the following:
> + if ($volid !~ /^[^:]+:.+$/) {
> + return $volid;
> + }
> +
Do we really want that? So far nobody complained, so I am not sure if we
want to relax volid parser here?
> # 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 ($@) {
> @@ -848,6 +855,7 @@ my $idedesc = {
> description => "Use volume as IDE hard disk or CD-ROM (n is 0 to "
> .($MAX_IDE_DISKS -1) . ").",
> };
> PVE::JSONSchema::register_standard_option("pve-qm-ide", $idedesc);
> +PVE::JSONSchema::register_format("pve-qm-ide", $ide_fmt);
I guess you should call register_format first (and use it later).
I know it is not required, but it makes more sense to me.
More information about the pve-devel
mailing list