We do the check on VM start, but the user could still hotplug a disk
with a conflicting serial or WWN. Reuse the checker function to fix the
issue.
}
-static int
+int
virDomainDiskDefCheckDuplicateInfo(virDomainDiskDefPtr a,
virDomainDiskDefPtr b)
{
bool virDomainDefNeedsPlacementAdvice(virDomainDefPtr def)
ATTRIBUTE_NONNULL(1);
+int virDomainDiskDefCheckDuplicateInfo(virDomainDiskDefPtr a,
+ virDomainDiskDefPtr b)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainDefCheckDuplicateDiskInfo(virDomainDefPtr def)
ATTRIBUTE_NONNULL(1);
virDomainDiskCacheTypeFromString;
virDomainDiskCacheTypeToString;
virDomainDiskDefAssignAddress;
+virDomainDiskDefCheckDuplicateInfo;
virDomainDiskDefDstDuplicates;
virDomainDiskDefForeachPath;
virDomainDiskDefFree;
_("target %s already exists"), disk->dst);
goto cleanup;
}
+
+ if (virDomainDiskDefCheckDuplicateInfo(vm->def->disks[i], disk) < 0)
+ goto cleanup;
}
switch ((virDomainDiskBus) disk->bus) {