提交 630c6e34 编写于 作者: M Michal Privoznik

virDomainDeviceDefValidateAliasesIterator: Ignore some hostdevs

https://bugzilla.redhat.com/show_bug.cgi?id=1556828

When defining a domain that has <interface type='hostdev'/> our
parser creates two entries in virDomainDef: one for <interface/>
and one for <hostdev/>. However, some info is shared between the
two which makes user alias validation fail because alias belongs
to the set of shared info.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 a5d85adb
......@@ -5584,6 +5584,13 @@ virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def,
virDomainChrEquals(def->serials[0], dev->data.chr))
return 0;
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
dev->data.hostdev->parent.type == VIR_DOMAIN_DEVICE_NET) {
/* This hostdev is a copy of some previous interface.
* Aliases are duplicated. */
return 0;
}
if (virHashLookup(data->aliases, alias)) {
virReportError(VIR_ERR_XML_ERROR,
_("non unique alias detected: %s"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册