|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2] dump: Show custom message for ENOSPC |
Date: | Fri, 9 Feb 2018 14:57:33 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 02/09/2018 02:26 PM, Yasmin Beatriz wrote:
This patch intends to make a more specific message for when the system has not enough space to save guest memory. Reported-by: address@hidden Cc: Jose Ricardo Ziviani <address@hidden> Signed-off-by: Yasmin Beatriz <address@hidden> ---
@@ -364,7 +364,11 @@ static void write_data(DumpState *s, void *buf, int length, Error **errp)ret = fd_write_vmcore(buf, length, s);if (ret < 0) { - error_setg(errp, "dump: failed to save memory"); + if (ret == -ENOSPC) { + error_setg(errp, "dump: not enough space to save memory"); + } else { + error_setg(errp, "dump: failed to save memory"); + }
Why is this caller the only one in the file that gets distinguished error messages? And why not use error_setg_errno() instead of open-coding just one special errno value? If you're changing the return value of fd_write_vmcore() anyways, I'd suggest that ALL callers in the file be updated to use error_setg_errno().
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |