From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCGpm-0005Gj-B0 for qemu-devel@nongnu.org; Tue, 29 Jul 2014 19:29:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCGpd-0006JU-KS for qemu-devel@nongnu.org; Tue, 29 Jul 2014 19:29:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCGpd-0006JP-Bm for qemu-devel@nongnu.org; Tue, 29 Jul 2014 19:29:21 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6TNTK9w028114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 29 Jul 2014 19:29:20 -0400 From: John Snow Date: Tue, 29 Jul 2014 19:28:58 -0400 Message-Id: <1406676538-23149-3-git-send-email-jsnow@redhat.com> In-Reply-To: <1406676538-23149-1-git-send-email-jsnow@redhat.com> References: <1406676538-23149-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] virtio-rng: replace error_set calls with error_setg List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, jsnow@redhat.com, armbru@redhat.com, stefanha@redhat.com, lcapitulino@redhat.com Under recommendation from Luiz Capitulino, we are changing the error_set calls to error_setg while we are fixing up the error handling pathways of virtio-rng. Signed-off-by: John Snow --- hw/virtio/virtio-rng.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index ff58917..03fd04a 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -142,16 +142,15 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp) Error *local_err = NULL; if (!vrng->conf.period_ms > 0) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "period", - "a positive number"); + error_setg(errp, "'period' parameter expects a positive integer"); return; } /* Workaround: Property parsing does not enforce unsigned integers, * So this is a hack to reject such numbers. */ if (vrng->conf.max_bytes > INT64_MAX) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "max-bytes", - "a non-negative integer below 2^63"); + error_setg(errp, "'max-bytes' parameter must be non-negative, " + "and less than 2^63"); return; } @@ -181,7 +180,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp) vrng->rng = vrng->conf.rng; if (vrng->rng == NULL) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "rng", "a valid object"); + error_setg(errp, "'rng' parameter expects a valid object"); return; } -- 1.9.3