[PATCH 01/16] qemuBuildCommandLine: Properly check return value of qemuBuildShmemCommandLine

Peter Krempa posted 16 patches 4 years, 2 months ago
There is a newer version of this series
[PATCH 01/16] qemuBuildCommandLine: Properly check return value of qemuBuildShmemCommandLine
Posted by Peter Krempa 4 years, 2 months ago
Use the customary '< 0' check for return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 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 713304dd22..24dd00af9b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10882,7 +10882,7 @@ qemuBuildCommandLine(virQEMUDriver *driver,
     for (i = 0; i < def->nshmems; i++) {
         if (qemuBuildShmemCommandLine(logManager, secManager, cmd, cfg,
                                       def, def->shmems[i], qemuCaps,
-                                      chardevStdioLogd))
+                                      chardevStdioLogd) < 0)
             return NULL;
     }

-- 
2.31.1

Re: [PATCH 01/16] qemuBuildCommandLine: Properly check return value of qemuBuildShmemCommandLine
Posted by Ján Tomko 4 years, 2 months ago
On a Thursday in 2021, Peter Krempa wrote:
>Use the customary '< 0' check for return value.
>

We could start a new custom where any value under three is a failure.

>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_command.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano