[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/6] migration: Fix cache_init()'s "Failed to allocate" error mes
From: |
Markus Armbruster |
Subject: |
[PATCH 5/6] migration: Fix cache_init()'s "Failed to allocate" error messages |
Date: |
Fri, 13 Nov 2020 07:52:35 +0100 |
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>
---
migration/page_cache.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/migration/page_cache.c b/migration/page_cache.c
index e07f4ad1dc..ed979eeb45 100644
--- a/migration/page_cache.c
+++ b/migration/page_cache.c
@@ -53,8 +53,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;
@@ -67,8 +66,7 @@ PageCache *cache_init(uint64_t new_size, size_t page_size,
Error **errp)
cache->page_cache = g_try_malloc_n(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;
}
--
2.26.2
- [PATCH 4/6] migration: Check xbzrle-cache-size more carefully, (continued)
- [PATCH 4/6] migration: Check xbzrle-cache-size more carefully, Markus Armbruster, 2020/11/13
- [PATCH 2/6] migration: Fix migrate-set-parameters argument validation, Markus Armbruster, 2020/11/13
- [PATCH 6/6] migration: Fix a few absurdly defective error messages, Markus Armbruster, 2020/11/13
- [PATCH 3/6] migration: Clean up signed vs. unsigned XBZRLE cache-size, Markus Armbruster, 2020/11/13
- [PATCH 1/6] migration: Fix and clean up around @tls-authz, Markus Armbruster, 2020/11/13
- [PATCH 5/6] migration: Fix cache_init()'s "Failed to allocate" error messages,
Markus Armbruster <=
- Re: [PATCH 0/6] migration: Fixes and cleanups aroung migrate-set-parameters, Dr. David Alan Gilbert, 2020/11/13