Skip to contentSkip to conversation

libxl: fix return code in qmp_synchronous_send

PATCH In review Olaf Hering 2 participants 2 messages May 17, 2018 – May 18, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: fix return code in qmp_synchronous_send

Use error code from libxl namespace, a plain -1 is not valid in this context.

---
 tools/libxl/libxl_qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_qmp.c +1 -1
index be1fda18ba..0fe42813bf 100644
@@ -627,7 +627,7 @@ static int qmp_synchronous_send(libxl__qmp_handler *qmp, const char *cmd,
 
     id = qmp_send(qmp, cmd, args, callback, opaque, &context);
     if (id <= 0) {
-        return -1;
+        return ERROR_FAIL;
     }
     qmp->wait_for_id = id;
 

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Olaf Hering

Use error code from libxl namespace, a plain -1 is not valid in this context.

While this function doesn't have libxl prefix, its return value does get returned directly by various libxl functions. Instead of fixing all the callers, I'm fine with this change.

Quoted 9 lines
---
 tools/libxl/libxl_qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_qmp.c +0 -0
index be1fda18ba..0fe42813bf 100644

tools/libxl/libxl_qmp.c static int qmp_synchronous_send(libxl__qmp_handler *qmp, const char *cmd, · line 633

Quoted 8 lines
tools/libxl/libxl_qmp.c +1 -1
@@ -627,7 +627,7 @@ static int qmp_synchronous_send(libxl__qmp_handler *qmp, const char *cmd,
 
     id = qmp_send(qmp, cmd, args, callback, opaque, &context);
     if (id <= 0) {
-        return -1;
+        return ERROR_FAIL;
     }
     qmp->wait_for_id = id;
 

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel