diff options
author | Peter Xu <peterx@redhat.com> | 2023-04-25 21:15:14 -0400 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-04-27 10:18:25 +0200 |
commit | 74c38cf7fd24c60e4f0a90585d17250478260877 (patch) | |
tree | 9a639322ddd6fb2aa4fa3838fff16b9d3069906d /migration/savevm.c | |
parent | 09d6c9658474e8573c5ada58dca8b20fe47dd99e (diff) |
migration: Allow postcopy_ram_supported_by_host() to report err
Instead of print it to STDERR, bring the error upwards so that it can be
reported via QMP responses.
E.g.:
{ "execute": "migrate-set-capabilities" ,
"arguments": { "capabilities":
[ { "capability": "postcopy-ram", "state": true } ] } }
{ "error":
{ "class": "GenericError",
"desc": "Postcopy is not supported: Host backend files need to be TMPFS
or HUGETLBFS only" } }
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/savevm.c')
-rw-r--r-- | migration/savevm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/migration/savevm.c b/migration/savevm.c index 9671211339..211eff3a8b 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1753,7 +1753,8 @@ static int loadvm_postcopy_handle_advise(MigrationIncomingState *mis, return -EINVAL; } - if (!postcopy_ram_supported_by_host(mis)) { + if (!postcopy_ram_supported_by_host(mis, &local_err)) { + error_report_err(local_err); postcopy_state_set(POSTCOPY_INCOMING_NONE); return -1; } |