From patchwork Wed Sep 21 13:18:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 672892 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sfLQY4xs2z9sBr for ; Wed, 21 Sep 2016 23:42:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ryF17HmX; dkim-atps=neutral Received: from localhost ([::1]:42531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmhmt-0008HX-95 for incoming@patchwork.ozlabs.org; Wed, 21 Sep 2016 09:42:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmhRn-0007N6-96 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 09:20:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmhRh-0001B9-Hi for qemu-devel@nongnu.org; Wed, 21 Sep 2016 09:20:22 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmhRh-0001At-8i for qemu-devel@nongnu.org; Wed, 21 Sep 2016 09:20:17 -0400 Received: by mail-wm0-f66.google.com with SMTP id w84so8569479wmg.0 for ; Wed, 21 Sep 2016 06:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CcyOixfSKnzP83P4bGfDwLvqVCJuhrLOgJvfL/zbE/k=; b=ryF17HmXt56nFtNAyuEqF2IiiKBZbK+W5Np78KkC3AC0m4icqKO9oCZo89jHY6LRW9 56/7UHO3ZPgNMswlgxVoR3R/PuU2j35I9itYJqAsr1OuDrJAf2HC7SvSbaXgQ8jIFvQR Lk9bac/z/ZNZmyR+HxGYXAFOKt0ARJYDMQJpWQNOr2wN21qPt//MCYD0NMxI6BlHBQUG VgzpIqc/v9H+140KVKg6ZbCFEClk1YxRXyQ/AcM3LvTSSiBEqlDOIRv3ilXv8PS8tCo4 DCSXya+d92NhbG7WcEIFFXVNXTHLN1yENjxAEXyDW0Ca6X1o2C0TbHGxzn8CN1sBazrs 5cXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CcyOixfSKnzP83P4bGfDwLvqVCJuhrLOgJvfL/zbE/k=; b=IcC5JxkQz+QxffGhw1BR7ExqBU5GLSsvEOLlHUP2xNB5p+v3G5kyh0FuVZNkqJqw6H 59drHtZCGeUL2P7GZw6OX4nA00oAdtvrIWzRDu+OGeL51PtQ5df74o4WllcZS5D7MnxA +EkmQ2fNqC+/3xChKFbv0nmx11JUGobxm/YaeyfCAODF95Z7M6C7b7ALKoQX2trl8ieW Fb/9l1MH9rVvXpR5moB8fOVs+3AshpeXr7o2L2JFmMffRn3YLn59aCBAeuOesh0bMHG9 927Dn7V6s8lBpF7I8NCU2SOxK5OxyQV5tZf5aweemUSuvxHJSUhrBEn3YdHUznySCDVV SxwQ== X-Gm-Message-State: AE9vXwOWcECwanzISju35pr7L1iAZg5AslOnF5BIz7odMaS3yxlJSaP1k5L2VnmlU1Yepw== X-Received: by 10.194.54.165 with SMTP id k5mr32696948wjp.36.1474463956730; Wed, 21 Sep 2016 06:19:16 -0700 (PDT) Received: from donizetti.lan (94-39-176-182.adsl-ull.clienti.tiscali.it. [94.39.176.182]) by smtp.gmail.com with ESMTPSA id lz5sm33404492wjb.24.2016.09.21.06.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Sep 2016 06:19:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 21 Sep 2016 15:18:54 +0200 Message-Id: <1474463939-12223-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474463939-12223-1-git-send-email-pbonzini@redhat.com> References: <1474463939-12223-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.66 Subject: [Qemu-devel] [PATCH 07/12] Revert "virtio: Introduce virtio_add_queue_aio" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, famz@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This reverts commit 872dd82c83745a603d2e07a03d34313eb6467ae4. virtio_add_queue_aio is unused. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 38 ++++---------------------------------- include/hw/virtio/virtio.h | 3 --- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 84abd08..d1cc2f5 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -97,7 +97,6 @@ struct VirtQueue uint16_t vector; VirtIOHandleOutput handle_output; VirtIOHandleOutput handle_aio_output; - bool use_aio; VirtIODevice *vdev; EventNotifier guest_notifier; EventNotifier host_notifier; @@ -1141,9 +1140,8 @@ void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector) } } -static VirtQueue *virtio_add_queue_internal(VirtIODevice *vdev, int queue_size, - VirtIOHandleOutput handle_output, - bool use_aio) +VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, + VirtIOHandleOutput handle_output) { int i; @@ -1160,28 +1158,10 @@ static VirtQueue *virtio_add_queue_internal(VirtIODevice *vdev, int queue_size, vdev->vq[i].vring.align = VIRTIO_PCI_VRING_ALIGN; vdev->vq[i].handle_output = handle_output; vdev->vq[i].handle_aio_output = NULL; - vdev->vq[i].use_aio = use_aio; return &vdev->vq[i]; } -/* Add a virt queue and mark AIO. - * An AIO queue will use the AioContext based event interface instead of the - * default IOHandler and EventNotifier interface. - */ -VirtQueue *virtio_add_queue_aio(VirtIODevice *vdev, int queue_size, - VirtIOHandleOutput handle_output) -{ - return virtio_add_queue_internal(vdev, queue_size, handle_output, true); -} - -/* Add a normal virt queue (on the contrary to the AIO version above. */ -VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, - VirtIOHandleOutput handle_output) -{ - return virtio_add_queue_internal(vdev, queue_size, handle_output, false); -} - void virtio_del_queue(VirtIODevice *vdev, int n) { if (n < 0 || n >= VIRTIO_QUEUE_MAX) { @@ -1866,21 +1846,11 @@ static void virtio_queue_host_notifier_read(EventNotifier *n) void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign, bool set_handler) { - AioContext *ctx = qemu_get_aio_context(); if (assign && set_handler) { - if (vq->use_aio) { - aio_set_event_notifier(ctx, &vq->host_notifier, true, + event_notifier_set_handler(&vq->host_notifier, true, virtio_queue_host_notifier_read); - } else { - event_notifier_set_handler(&vq->host_notifier, true, - virtio_queue_host_notifier_read); - } } else { - if (vq->use_aio) { - aio_set_event_notifier(ctx, &vq->host_notifier, true, NULL); - } else { - event_notifier_set_handler(&vq->host_notifier, true, NULL); - } + event_notifier_set_handler(&vq->host_notifier, true, NULL); } if (!assign) { /* Test and clear notifier before after disabling event, diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index ec50f7a..1db4fbf 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -145,9 +145,6 @@ typedef void (*VirtIOHandleOutput)(VirtIODevice *, VirtQueue *); VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, VirtIOHandleOutput handle_output); -VirtQueue *virtio_add_queue_aio(VirtIODevice *vdev, int queue_size, - VirtIOHandleOutput handle_output); - void virtio_del_queue(VirtIODevice *vdev, int n); void *virtqueue_alloc_element(size_t sz, unsigned out_num, unsigned in_num);