[libvirt] [PATCH 7/9] qemu: caps: Don't check capability before clearing it

Peter Krempa posted 9 patches 12 weeks ago

[libvirt] [PATCH 7/9] qemu: caps: Don't check capability before clearing it

Posted by Peter Krempa 12 weeks ago
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>
---
 src/qemu/qemu_capabilities.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e5f19ddcaa..7c0533aef5 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -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) &&
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 7/9] qemu: caps: Don't check capability before clearing it

Posted by Cole Robinson 12 weeks ago
On 11/25/19 7:53 AM, Peter Krempa wrote:
> 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>
> ---
>  src/qemu/qemu_capabilities.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: Cole Robinson <crobinso@redhat.com>

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list