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: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
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"),