[libvirt PATCH] qemu: Drop redundant checks for qemuCaps before virQEMUCapsGet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



virQEMUCapsGet checks for qemuCaps itself, no need to do it explicitly.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c  | 5 +----
 src/qemu/qemu_process.c | 3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5c98f8ff1a..fff67481a7 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5289,7 +5289,6 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk,
     g_autofree char *encalias = NULL;
 
     if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS) ||
-        !qemuCaps ||
         virStorageSourceIsEmpty(disk->src) ||
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_SECRET))
         return 0;
@@ -5475,7 +5474,6 @@ qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(virDomainHostdevDefPtr hostde
     g_autofree char *authalias = NULL;
 
     if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS) ||
-        !qemuCaps ||
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_SECRET))
         return 0;
 
@@ -5520,8 +5518,7 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDefPtr ho
     if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS))
         return 0;
 
-    if (!qemuCaps ||
-        hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+    if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
         hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI ||
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI))
         return 0;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 0b79dde2c3..b86afe4daa 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8349,8 +8349,7 @@ qemuProcessReconnect(void *opaque)
     if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0)
         goto error;
 
-    if (priv->qemuCaps &&
-        virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS))
+    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS))
         retry = false;
 
     if (qemuDomainObjStartWorker(obj) < 0)
-- 
2.31.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux