Patchwork [1/5] migration: exit with error code

login
register
mail settings
Submitter Juan Quintela
Date Jan. 4, 2011, 2:33 p.m.
Message ID <ca366e6304db619b84e05ff86cd33880ddf258b0.1294150511.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/77487/
State New
Headers show

Comments

Juan Quintela - Jan. 4, 2011, 2:33 p.m.
exits due to errors should end with error code 1, not zero or negative.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c |    2 +-
 vl.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/migration.c b/migration.c
index e5ba51c..a8b65e5 100644
--- a/migration.c
+++ b/migration.c
@@ -62,7 +62,7 @@  void process_incoming_migration(QEMUFile *f)
 {
     if (qemu_loadvm_state(f) < 0) {
         fprintf(stderr, "load of migration failed\n");
-        exit(0);
+        exit(1);
     }
     qemu_announce_self();
     DPRINTF("successfully loaded vm state\n");
diff --git a/vl.c b/vl.c
index 78fcef1..e5349af 100644
--- a/vl.c
+++ b/vl.c
@@ -3107,7 +3107,7 @@  int main(int argc, char **argv, char **envp)
         if (ret < 0) {
             fprintf(stderr, "Migration failed. Exit code %s(%d), exiting.\n",
                     incoming, ret);
-            exit(ret);
+            exit(1);
         }
     } else if (autostart) {
         vm_start();