diff options
| author | Tejus GK <tejus.gk@nutanix.com> | 2023-10-03 06:55:38 +0000 |
|---|---|---|
| committer | Juan Quintela <quintela@redhat.com> | 2023-10-04 10:54:40 +0200 |
| commit | 848a0503422d043d541130d5e3e2f7bc147cdef9 (patch) | |
| tree | 7912f04315546e59d30faa03d7380b1803e950f2 /migration/vmstate.c | |
| parent | 969298f9d7ed0ccad39203bc3656805cbf0893d4 (diff) | |
| download | focaccia-qemu-848a0503422d043d541130d5e3e2f7bc147cdef9.tar.gz focaccia-qemu-848a0503422d043d541130d5e3e2f7bc147cdef9.zip | |
migration: Update error description outside migration.c
A few code paths exist in the source code,where a migration is marked as failed via MIGRATION_STATUS_FAILED, but the failure happens outside of migration.c In such cases, an error_report() call is made, however the current MigrationState is never updated with the error description, and hence clients like libvirt never know the actual reason for the failure. This patch covers such cases outside of migration.c and updates the error description at the appropriate places. Acked-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Tejus GK <tejus.gk@nutanix.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231003065538.244752-3-tejus.gk@nutanix.com>
Diffstat (limited to 'migration/vmstate.c')
| -rw-r--r-- | migration/vmstate.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/migration/vmstate.c b/migration/vmstate.c index dd9c76dbeb..4cde30bf2d 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -14,6 +14,7 @@ #include "migration.h" #include "migration/vmstate.h" #include "savevm.h" +#include "qapi/error.h" #include "qapi/qmp/json-writer.h" #include "qemu-file.h" #include "qemu/bitops.h" @@ -336,7 +337,7 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd, ret = vmsd->pre_save(opaque); trace_vmstate_save_state_pre_save_res(vmsd->name, ret); if (ret) { - error_report("pre-save failed: %s", vmsd->name); + error_setg(errp, "pre-save failed: %s", vmsd->name); return ret; } } @@ -389,8 +390,8 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd, vmdesc_loop); } if (ret) { - error_report("Save of field %s/%s failed", - vmsd->name, field->name); + error_setg(errp, "Save of field %s/%s failed", + vmsd->name, field->name); if (vmsd->post_save) { vmsd->post_save(opaque); } |