mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: hotplug: Check duplicate disk serial/wwn on hotplug too
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.
This commit is contained in:
parent
e76a848e3d
commit
4f1324aa48
@ -23988,7 +23988,7 @@ virDomainDefNeedsPlacementAdvice(virDomainDefPtr def)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
int
|
||||
virDomainDiskDefCheckDuplicateInfo(virDomainDiskDefPtr a,
|
||||
virDomainDiskDefPtr b)
|
||||
{
|
||||
|
@ -3153,6 +3153,9 @@ virDomainParseMemory(const char *xpath,
|
||||
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);
|
||||
|
||||
|
@ -257,6 +257,7 @@ virDomainDiskByName;
|
||||
virDomainDiskCacheTypeFromString;
|
||||
virDomainDiskCacheTypeToString;
|
||||
virDomainDiskDefAssignAddress;
|
||||
virDomainDiskDefCheckDuplicateInfo;
|
||||
virDomainDiskDefDstDuplicates;
|
||||
virDomainDiskDefForeachPath;
|
||||
virDomainDiskDefFree;
|
||||
|
@ -799,6 +799,9 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
|
||||
_("target %s already exists"), disk->dst);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDomainDiskDefCheckDuplicateInfo(vm->def->disks[i], disk) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
switch ((virDomainDiskBus) disk->bus) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user