From patchwork Wed Oct 6 13:20:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 66926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CDDFEB6EF0 for ; Thu, 7 Oct 2010 00:41:29 +1100 (EST) Received: from localhost ([127.0.0.1]:56345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3UFJ-0001Xo-To for incoming@patchwork.ozlabs.org; Wed, 06 Oct 2010 09:41:25 -0400 Received: from [140.186.70.92] (port=45249 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3U46-00075d-N6 for qemu-devel@nongnu.org; Wed, 06 Oct 2010 09:29:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3U0w-0002Jm-N6 for qemu-devel@nongnu.org; Wed, 06 Oct 2010 09:26:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3U0w-0002JY-GQ for qemu-devel@nongnu.org; Wed, 06 Oct 2010 09:26:34 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o96DQXpH009462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Oct 2010 09:26:34 -0400 Received: from redhat.com (vpn-10-1.rdu.redhat.com [10.11.10.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o96DQUHp031323; Wed, 6 Oct 2010 09:26:31 -0400 Date: Wed, 6 Oct 2010 15:20:28 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, avi@redhat.com, mtosatti@redhat.com, Alex Williamson , Juan Quintela , Amit Shah Message-ID: <875152723ad6bf789d78c89193b15da31d027904.1286369456.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH 2/3] vhost: error code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org fix up errors returned to include errno, not just -1 Signed-off-by: Michael S. Tsirkin --- hw/vhost.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index 5ac283b..2e5d7a6 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -516,12 +516,14 @@ static int vhost_virtqueue_init(struct vhost_dev *dev, file.fd = event_notifier_get_fd(virtio_queue_get_host_notifier(vvq)); r = ioctl(dev->control, VHOST_SET_VRING_KICK, &file); if (r) { + r = -errno; goto fail_kick; } file.fd = event_notifier_get_fd(virtio_queue_get_guest_notifier(vvq)); r = ioctl(dev->control, VHOST_SET_VRING_CALL, &file); if (r) { + r = -errno; goto fail_call; }