[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/27] migration: Fix cache_init()'s "Failed to allocate" error me
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 12/27] migration: Fix cache_init()'s "Failed to allocate" error messages |
Date: |
Thu, 4 Feb 2021 16:39:44 +0000 |
From: Markus Armbruster <armbru@redhat.com>
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>
---
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 b384f265fb..6d4f7a9bbc 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;
}
--
2.29.2
- [PULL 04/27] migration/qemu-file: Fix maybe uninitialized on qemu_get_buffer_in_place(), (continued)
- [PULL 04/27] migration/qemu-file: Fix maybe uninitialized on qemu_get_buffer_in_place(), Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 01/27] spapr_pci: Fix memory leak of vmstate_spapr_pci, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 03/27] vmstate: Fix memory leak in vmstate_handle_alloc(), Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 05/27] migration: introduce 'background-snapshot' migration capability, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 06/27] migration: introduce UFFD-WP low-level interface helpers, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 07/27] migration: support UFFD write fault processing in ram_save_iterate(), Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 08/27] migration: implementation of background snapshot thread, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 09/27] migration: introduce 'userfaultfd-wrlat.py' script, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 10/27] migration: Fix migrate-set-parameters argument validation, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 11/27] migration: Clean up signed vs. unsigned XBZRLE cache-size, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 12/27] migration: Fix cache_init()'s "Failed to allocate" error messages,
Dr. David Alan Gilbert (git) <=
- [PULL 13/27] migration: Fix a few absurdly defective error messages, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 14/27] migration: Add blocker information, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 15/27] migration: Display the migration blockers, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 16/27] block: push error reporting into bdrv_all_*_snapshot functions, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 17/27] migration: Make save_snapshot() return bool, not 0/-1, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 18/27] migration: stop returning errno from load_snapshot(), Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 19/27] block: add ability to specify list of blockdevs during snapshot, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 20/27] block: allow specifying name of block device for vmstate storage, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 22/27] migration: control whether snapshots are ovewritten, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 23/27] migration: wire up support for snapshot device selection, Dr. David Alan Gilbert (git), 2021/02/04