qemuDomainAttachWatchdog: Avoid unnecessary nesting

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Martin Kletzander 2023-01-20 10:28:52 +01:00
parent 1cf7e6ec05
commit c5340d5420

View File

@ -2936,17 +2936,17 @@ qemuDomainAttachWatchdog(virDomainObj *vm,
qemuAssignDeviceWatchdogAlias(watchdog);
if (watchdog->model == VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) {
if (qemuDomainEnsurePCIAddress(vm, &dev) < 0)
goto cleanup;
releaseAddress = true;
} else {
if (watchdog->model != VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("hotplug of watchdog of model %s is not supported"),
virDomainWatchdogModelTypeToString(watchdog->model));
goto cleanup;
}
if (qemuDomainEnsurePCIAddress(vm, &dev) < 0)
goto cleanup;
releaseAddress = true;
if (!(props = qemuBuildWatchdogDevProps(vm->def, watchdog)))
goto cleanup;