[libvirt] [RFC 6/7] Deprecate missing machine type in virDomainDefineXMLFlags()

Peter Krempa pkrempa at redhat.com
Tue Oct 2 14:48:02 UTC 2018


On Tue, Oct 02, 2018 at 16:14:45 +0200, Andrea Bolognani wrote:
> This time we don't want to deprecate the API itself; instead,
> we want warning to be reported whenever some specific condition
> is met.
> 
> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
> ---
>  src/conf/domain_conf.c | 11 ++++++++---
>  src/libvirt-domain.c   |  1 +
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 9911d56130..da0f1ed025 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -19114,9 +19114,14 @@ virDomainDefParseCaps(virDomainDefPtr def,
>      } else {
>          if (!def->os.arch)
>              def->os.arch = capsdata->arch;
> -        if ((!def->os.machine &&
> -             VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0))
> -            goto cleanup;
> +        if (!def->os.machine) {
> +            virReportWarning(VIR_ERR_DEPRECATED_FEATURE,
> +                             "%s",
> +                             _("Missing machine type"));

Soo, and if multiple warnings are present? Since we don't support
multiple error objects this will create one warning and after you fix it
a second one.

Also I doubt that LXC has a machine type.





More information about the libvir-list mailing list