From c1cbeeaeb19973cbf315fbadd0c28b95dc18120f Mon Sep 17 00:00:00 2001 From: rwatson Date: Sat, 11 Feb 2006 18:55:03 +0000 Subject: When reporting an error reading from UMA per-cpu cache pointers using KVM, return a KVM error rather than an out of memory error, so that the caller reports the KVM error state. This replaces a misleading error message with a more accurate although equally confusing one. MFC after: 3 days --- lib/libmemstat/memstat_uma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/libmemstat/memstat_uma.c') diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c index 924b7c2..dfbf31c 100644 --- a/lib/libmemstat/memstat_uma.c +++ b/lib/libmemstat/memstat_uma.c @@ -397,8 +397,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) &ub, sizeof(ub), 0); if (ret != 0) { _memstat_mtl_empty(list); - list->mtl_error = - MEMSTAT_ERROR_NOMEMORY; + list->mtl_error = ret; return (-1); } mtp->mt_free += ub.ub_cnt; @@ -408,8 +407,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) &ub, sizeof(ub), 0); if (ret != 0) { _memstat_mtl_empty(list); - list->mtl_error = - MEMSTAT_ERROR_NOMEMORY; + list->mtl_error = ret; return (-1); } mtp->mt_free += ub.ub_cnt; -- cgit v1.1