mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemuDomainDiskChangeSupported: Forbid alias change
Since we have user aliases it may happen that users want to change it using 'update-device'. Instead of ignoring it silently, error out loudly. Note that we don't limit the check just for "ua-" prefixes because users might try to change libvirt generated aliases too. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
b372983d14
commit
d0204e373d
@ -6837,6 +6837,14 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (disk->info.alias &&
|
||||
STRNEQ_NULLABLE(disk->info.alias, orig_disk->info.alias)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("cannot modify field '%s' of the disk"),
|
||||
"alias");
|
||||
return false;
|
||||
}
|
||||
|
||||
CHECK_EQ(info.bootIndex, "boot order", true);
|
||||
CHECK_EQ(rawio, "rawio", true);
|
||||
CHECK_EQ(sgio, "sgio", true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user