[libvirt PATCH] qemu: use correct backendType when checking memfd capability

Ján Tomko posted 1 patch 4 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/40e95c25eab476e4fbc2923d49a8de6ce7e4f0b4.1582547677.git.jtomko@redhat.com
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt PATCH] qemu: use correct backendType when checking memfd capability
Posted by Ján Tomko 4 years, 1 month ago
The backend name is memory-backend-memfd but we've been checking
for memory-backend-memory.

Reported by GCC on rawhide:
../../../src/internal.h:75:22: error: 'strcmp' of a string of length 21 and
an array of size 21 evaluates to nonzero [-Werror=string-compare]
../../../src/qemu/qemu_command.c:3525:20: note: in expansion of macro 'STREQ'
 3525 |         } else if (STREQ(backendType, "memory-backend-memory") &&
      |                    ^~~~~

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 24b74d187cab48a9dc9f409ea78900154c709579
---
 src/qemu/qemu_command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f69a9e651c..6d5b53d30a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3522,7 +3522,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps,
                            _("this qemu doesn't support the "
                              "memory-backend-ram object"));
             return -1;
-        } else if (STREQ(backendType, "memory-backend-memory") &&
+        } else if (STREQ(backendType, "memory-backend-memfd") &&
                    !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("this qemu doesn't support the "
-- 
2.24.1

Re: [libvirt PATCH] qemu: use correct backendType when checking memfd capability
Posted by Daniel P. Berrangé 4 years, 1 month ago
On Mon, Feb 24, 2020 at 01:34:51PM +0100, Ján Tomko wrote:
> The backend name is memory-backend-memfd but we've been checking
> for memory-backend-memory.
> 
> Reported by GCC on rawhide:
> ../../../src/internal.h:75:22: error: 'strcmp' of a string of length 21 and
> an array of size 21 evaluates to nonzero [-Werror=string-compare]
> ../../../src/qemu/qemu_command.c:3525:20: note: in expansion of macro 'STREQ'
>  3525 |         } else if (STREQ(backendType, "memory-backend-memory") &&
>       |                    ^~~~~
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> Fixes: 24b74d187cab48a9dc9f409ea78900154c709579
> ---
>  src/qemu/qemu_command.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|