mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
conf: reformat virDomainDefCompatibleDevice for upcoming additional check
The next patch will add another check similar to the existing check for a change in alias name. This patch reformats the code in preparation so that the next patch's purpose will be clear. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
ceb0d2b71a
commit
cf916af4a1
@ -28477,13 +28477,14 @@ virDomainDefCompatibleDevice(virDomainDef *def,
|
||||
data.oldInfo = virDomainDeviceGetInfo(oldDev);
|
||||
|
||||
if (action == VIR_DOMAIN_DEVICE_ACTION_UPDATE &&
|
||||
live &&
|
||||
(data.newInfo && data.oldInfo &&
|
||||
data.newInfo->alias && data.oldInfo->alias &&
|
||||
STRNEQ(data.newInfo->alias, data.oldInfo->alias))) {
|
||||
virReportError(VIR_ERR_OPERATION_DENIED, "%s",
|
||||
_("changing device alias is not allowed"));
|
||||
return -1;
|
||||
live && data.newInfo && data.oldInfo) {
|
||||
|
||||
if (data.newInfo->alias && data.oldInfo->alias &&
|
||||
STRNEQ(data.newInfo->alias, data.oldInfo->alias)) {
|
||||
virReportError(VIR_ERR_OPERATION_DENIED, "%s",
|
||||
_("changing device alias is not allowed"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!virDomainDefHasUSB(def) &&
|
||||
|
Loading…
Reference in New Issue
Block a user