From patchwork Tue Jul 24 22:34:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 173071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 27B112C0078 for ; Wed, 25 Jul 2012 08:37:45 +1000 (EST) Received: from localhost ([::1]:36841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Stnjb-0004pI-5T for incoming@patchwork.ozlabs.org; Tue, 24 Jul 2012 18:37:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StnjG-0004dx-3b for qemu-devel@nongnu.org; Tue, 24 Jul 2012 18:37:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StnjE-00035M-KR for qemu-devel@nongnu.org; Tue, 24 Jul 2012 18:37:21 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:51121 helo=linux-iscsi.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StnjE-00035B-FL for qemu-devel@nongnu.org; Tue, 24 Jul 2012 18:37:20 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id 8DE3222D9DA; Tue, 24 Jul 2012 22:34:18 +0000 (UTC) From: "Nicholas A. Bellinger" To: target-devel Date: Tue, 24 Jul 2012 22:34:00 +0000 Message-Id: <1343169246-17636-4-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1343169246-17636-1-git-send-email-nab@linux-iscsi.org> References: <1343169246-17636-1-git-send-email-nab@linux-iscsi.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 67.23.28.174 Cc: Jens Axboe , Anthony Liguori , Stefan Hajnoczi , kvm-devel , "Michael S. Tsirkin" , qemu-devel , Zhi Yong Wu , Anthony Liguori , Hannes Reinecke , Paolo Bonzini , lf-virt , Christoph Hellwig Subject: [Qemu-devel] [RFC 3/9] virtio-pci: check that event notification worked X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Stefan Hajnoczi For sanity assert that event notification succeeds. Signed-off-by: Stefan Hajnoczi Cc: Anthony Liguori Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- hw/virtio-pci.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 538eef4..0f0f766 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -261,8 +261,11 @@ static void virtio_pci_queue_notify(VirtIOPCIProxy *proxy, uint32_t n) vq = virtio_get_queue(proxy->vdev, n); notifier = virtio_queue_get_host_notifier(vq); if (event_notifier_valid(notifier)) { + int r; + printf("notifying vq %u host notifier from userspace\n", n); - event_notifier_notify(notifier); + r = event_notifier_notify(notifier); + assert(r == 0); } else { virtio_queue_notify_vq(vq); }