diff options
| author | Markus Armbruster <armbru@redhat.com> | 2025-09-23 11:09:51 +0200 |
|---|---|---|
| committer | Markus Armbruster <armbru@redhat.com> | 2025-09-30 14:43:53 +0200 |
| commit | 897071bb27bfba578af15300973b7a4a1fb65ad2 (patch) | |
| tree | 57f648de6519b0c3d8bab0526e75f4414d08a6b0 /migration | |
| parent | b8df7dfc04a88228a6bf35530c10b1326f5cb6d6 (diff) | |
| download | focaccia-qemu-897071bb27bfba578af15300973b7a4a1fb65ad2.tar.gz focaccia-qemu-897071bb27bfba578af15300973b7a4a1fb65ad2.zip | |
migration/cpr: Clean up error reporting in cpr_resave_fd()
qapi/error.h advises: * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. Do that, and replace exit() by g_assert_not_reached(), since this is actually a programming error. Cc: Steve Sistare <steven.sistare@oracle.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Steve Sistare <steven.sistare@oracle.com> Message-ID: <20250923091000.3180122-5-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Diffstat (limited to 'migration')
| -rw-r--r-- | migration/cpr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/migration/cpr.c b/migration/cpr.c index 42ad0b0d50..9848a21ea6 100644 --- a/migration/cpr.c +++ b/migration/cpr.c @@ -7,6 +7,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "hw/vfio/vfio-device.h" #include "migration/cpr.h" #include "migration/misc.h" @@ -100,10 +101,10 @@ void cpr_resave_fd(const char *name, int id, int fd) if (old_fd < 0) { cpr_save_fd(name, id, fd); } else if (old_fd != fd) { - error_setg(&error_fatal, - "internal error: cpr fd '%s' id %d value %d " - "already saved with a different value %d", - name, id, fd, old_fd); + error_report("internal error: cpr fd '%s' id %d value %d " + "already saved with a different value %d", + name, id, fd, old_fd); + g_assert_not_reached(); } } |