提交 d0204e37 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 b372983d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册