]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainAttachWatchdog: Avoid unnecessary nesting
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 20 Jan 2023 09:28:52 +0000 (10:28 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 26 Jan 2023 15:40:30 +0000 (16:40 +0100)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_hotplug.c

index 070e0a051c5433fb51c134ff41dfa6fd39febe27..e153e4806d31228fc4d894706fa466b924024e92 100644 (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;