]> git.proxmox.com Git - mirror_qemu.git/commitdiff
softmmu: pass the main loop status to gdb "Wxx" packet
authorClément Chigot <chigot@adacore.com>
Tue, 3 Oct 2023 07:14:24 +0000 (09:14 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 12 Oct 2023 02:33:24 +0000 (12:33 +1000)
gdb_exit function aims to close gdb sessions and sends the exit code of
the current execution. It's being called by qemu_cleanup once the main
loop is over.
Until now, the exit code sent was always 0. Now that hardware can
shutdown this main loop with custom exit codes, these codes must be
transfered to gdb as well.

Signed-off-by: Clément Chigot <chigot@adacore.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20231003071427.188697-3-chigot@adacore.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
include/sysemu/sysemu.h
system/main.c
system/runstate.c

index 25be2a692e64087593bbda8c7bfb5eb4232816b4..73a37949c24d1b5f511f6d2aaf7a7494f5af5349 100644 (file)
@@ -101,7 +101,7 @@ bool defaults_enabled(void);
 
 void qemu_init(int argc, char **argv);
 int qemu_main_loop(void);
-void qemu_cleanup(void);
+void qemu_cleanup(int);
 
 extern QemuOptsList qemu_legacy_drive_opts;
 extern QemuOptsList qemu_common_drive_opts;
index 694388bd7f7f6785c2e753b184fc2bd2e77bf296..9b91d21ea8c9186f2c80ac604542731c12cf05f1 100644 (file)
@@ -35,7 +35,7 @@ int qemu_default_main(void)
     int status;
 
     status = qemu_main_loop();
-    qemu_cleanup();
+    qemu_cleanup(status);
 
     return status;
 }
index 363a5ea8dddbdb4e67909f3c1fb0bf4ccdec2c08..ea9d6c2a32a45541a87cecaba569583f60624ea2 100644 (file)
@@ -834,9 +834,9 @@ void qemu_init_subsystems(void)
 }
 
 
-void qemu_cleanup(void)
+void qemu_cleanup(int status)
 {
-    gdb_exit(0);
+    gdb_exit(status);
 
     /*
      * cleaning up the migration object cancels any existing migration