]> git.proxmox.com Git - pve-common.git/commit - src/PVE/PodParser.pm
support aliases in property strings
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 15 Oct 2015 10:35:18 +0000 (12:35 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 15 Oct 2015 10:36:07 +0000 (12:36 +0200)
commit303a9b34ea148644e2393a11452271b4c708a7c5
tree165363d0b6e9fe53e3f56d220ee3a346dd3b0b36
parentdf0c6a7cd8d4953b5f5b8addc79a187351827a18
support aliases in property strings

In qemu the 'volume' key maps to 'file', both can be used,
so to support this case in the comma-separated property
list parser we need a way to alias keys to one another.
This allows declaring a key like:

  volume => {
      alias => 'file'
  }
  file => {
      type => 'string',
      format => 'pve-volume-id',
      default_key => 1,
      format_description => 'volume'
  }

With this the following property strings are equivalent and
result in the same datastructure being returned from
parse_property_string:

  local:disk.raw
  file=local:disk.raw
  volume=local:disk.raw
src/PVE/JSONSchema.pm
src/PVE/PodParser.pm