[libvirt] [RFC 6/7] Deprecate missing machine type in virDomainDefineXMLFlags()
Andrea Bolognani
abologna at redhat.com
Tue Oct 2 15:18:30 UTC 2018
On Tue, 2018-10-02 at 16:48 +0200, Peter Krempa wrote:
> On Tue, Oct 02, 2018 at 16:14:45 +0200, Andrea Bolognani wrote:
[...]
> > @@ -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.
I don't think that's necessarily a blocker: a similar behavior can
be observed by feeding libvirt a guest definition that contains two
or more errors, in which case you're expected to solve them one at
the time; you could very well do the same for warnings.
> Also I doubt that LXC has a machine type.
That could be addressed by reporting the warning from the QEMU
driver instead of the generic code. Doing so would probably require
shuffling the calls around quite a bit, but I don't see why it
wouldn't be possible.
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list