The errors from kvm_cmd_run_init() are not handled properly as they are
returned as positive values.

Signed-off-by: Paul Neumann <paul1...@yahoo.de>
---
 tools/kvm/builtin-run.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index a36bd00..47c6634 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -952,7 +952,7 @@ static int kvm_cmd_run_init(int argc, const char **argv)
                                fprintf(stderr, "Cannot handle parameter: "
                                                "%s\n", argv[0]);
                                usage_with_options(run_usage, options);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (kvm_run_wrapper == KVM_RUN_SANDBOX) {
                                /*
@@ -979,7 +979,7 @@ static int kvm_cmd_run_init(int argc, const char **argv)
 
        if (!kernel_filename) {
                kernel_usage_with_options();
-               return EINVAL;
+               return -EINVAL;
        }
 
        vmlinux_filename = find_vmlinux();
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to