migration: Add error_desc for file channel errors
commit3d661c8ab18ad2013992c622ab307422ace891a2
authorYury Kotov <yury-kotov@yandex-team.ru>
Mon, 22 Apr 2019 10:34:20 +0000 (22 13:34 +0300)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 14 Aug 2019 16:33:14 +0000 (14 17:33 +0100)
treed1b1ab46d8d0d3b0d3824655e661a469d5caa62b
parentf28ed74fd116491e31329044d140fde4aa23b2a0
migration: Add error_desc for file channel errors

Currently, there is no information about error if outgoing migration was failed
because of file channel errors.
Example (QMP session):
-> { "execute": "migrate", "arguments": { "uri": "exec:head -c 1" }}
<- { "return": {} }
...
-> { "execute": "query-migrate" }
<- { "return": { "status": "failed" }} // There is not error's description

And even in the QEMU's output there is nothing.

This patch
1) Adds errp for the most of QEMUFileOps
2) Adds qemu_file_get_error_obj/qemu_file_set_error_obj
3) And finally using of qemu_file_get_error_obj in migration.c

And now, the status for the mentioned fail will be:
-> { "execute": "query-migrate" }
<- { "return": { "status": "failed",
                 "error-desc": "Unable to write to command: Broken pipe" }}

Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru>
Message-Id: <20190422103420.15686-1-yury-kotov@yandex-team.ru>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/migration.c
migration/qemu-file-channel.c
migration/qemu-file.c
migration/qemu-file.h
migration/savevm.c