]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: caps: Don't check capability before clearing it
authorPeter Krempa <pkrempa@redhat.com>
Sun, 24 Nov 2019 08:55:42 +0000 (09:55 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Dec 2019 14:26:54 +0000 (15:26 +0100)
Checking whether a qemu capability set right before clearing it without
any other logic doesn't make sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_capabilities.c

index f65af5c2287d83db5c4fa1dc3f1561646b2817f2..b93fd8310f8381f523af6a6b70859923f44f1d77 100644 (file)
@@ -4602,8 +4602,7 @@ virQEMUCapsInitProcessCaps(virQEMUCapsPtr qemuCaps)
     /* Prealloc on NVDIMMs is broken on older QEMUs leading to
      * user data corruption. If we are dealing with such version
      * of QEMU pretend we don't know how to NVDIMM. */
-    if (qemuCaps->version < 2009000 &&
-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM))
+    if (qemuCaps->version < 2009000)
         virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM);
 
     if (ARCH_IS_X86(qemuCaps->arch) &&