diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-02-02 15:17:33 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2021-02-08 11:19:51 +0000 |
commit | 7bfc47936e9e083ea7743fccb8e235b063ae6590 (patch) | |
tree | bbc7f12e1f0a6825ec478a5dcd0127e9722e7d26 /migration/page_cache.c | |
parent | 8b9407a09f925ff9e4dcf6783add8df68f5c7eb6 (diff) | |
download | qemu-7bfc47936e9e083ea7743fccb8e235b063ae6590.zip qemu-7bfc47936e9e083ea7743fccb8e235b063ae6590.tar.gz qemu-7bfc47936e9e083ea7743fccb8e235b063ae6590.tar.bz2 |
migration: Fix cache_init()'s "Failed to allocate" error messages
cache_init() attempts to handle allocation failure. The two error
messages are garbage, as untested error messages commonly are:
Parameter 'cache size' expects Failed to allocate cache
Parameter 'cache size' expects Failed to allocate page cache
Fix them to just
Failed to allocate cache
Failed to allocate page cache
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210202141734.2488076-4-armbru@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/page_cache.c')
-rw-r--r-- | migration/page_cache.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/migration/page_cache.c b/migration/page_cache.c index b384f26..6d4f7a9 100644 --- a/migration/page_cache.c +++ b/migration/page_cache.c @@ -60,8 +60,7 @@ PageCache *cache_init(uint64_t new_size, size_t page_size, Error **errp) /* We prefer not to abort if there is no memory */ cache = g_try_malloc(sizeof(*cache)); if (!cache) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size", - "Failed to allocate cache"); + error_setg(errp, "Failed to allocate cache"); return NULL; } cache->page_size = page_size; @@ -74,8 +73,7 @@ PageCache *cache_init(uint64_t new_size, size_t page_size, Error **errp) cache->page_cache = g_try_malloc((cache->max_num_items) * sizeof(*cache->page_cache)); if (!cache->page_cache) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size", - "Failed to allocate page cache"); + error_setg(errp, "Failed to allocate page cache"); g_free(cache); return NULL; } |