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:
Laine Stump 2021-09-09 12:57:32 -04:00
parent ceb0d2b71a
commit cf916af4a1

View File

@ -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) &&