Re: [PATCH v3 09/17] conf: Add <filesystem model='virtio-{non-}transitional'/>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2019-02-08 at 17:12 -0500, Cole Robinson wrote:
[...]
> @@ -10858,6 +10866,15 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
>          def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
>      }
>  
> +    model = virXMLPropString(node, "model");
> +    if (model) {
> +        if ((def->model = virDomainFSModelTypeFromString(model)) < 0) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +                           _("unknown model '%s'"), model);
> +            goto error;
> +        }
> +    }

If we wanted to be super-duper safe, we could do

  if (model) {
      if ((def->model = virDomainFSModelTypeFromString(model)) < 0 ||
          def->model == VIR_DOMAIN_FS_MODEL_DEFAULT) {
          virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                         _("unknown model '%s'"), model);
          goto error;
      }
  }

to prevent people from using

  <filesystem model='default'>
    ...
  </filesystem>

and same for disks and other devices for which we're introducing
the concept of model just now. But it's probably okay even if we
don't want to go the extra mile.

Either way,

  Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux