Received: from eggs.gnu.org ([2001:4830:134:3::10]:45653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGJPT-0004fv-3R for qemu-devel@nongnu.org; Fri, 24 Jun 2016 01:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGJPR-0004Qf-3u for qemu-devel@nongnu.org; Fri, 24 Jun 2016 01:12:06 -0400 From: Fam Zheng Date: Fri, 24 Jun 2016 13:12:26 +0800 Message-Id: <20160624051227.8417-4-famz@redhat.com> In-Reply-To: <20160624051227.8417-1-famz@redhat.com> References: <20160624051227.8417-1-famz@redhat.com> Subject: [Qemu-devel] [PATCH 3/4] virtio: Drop the unused virtio_queue_set_host_notifier_fd_handler code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jeff Cody , Kevin Wolf , Max Reitz , Stefan Hajnoczi , "Michael S. Tsirkin" , Paolo Bonzini , qemu-block@nongnu.org Signed-off-by: Fam Zheng --- hw/virtio/virtio.c | 24 ------------------------ include/hw/virtio/virtio.h | 2 -- 2 files changed, 26 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 99cd0c0..7a375c1 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1815,30 +1815,6 @@ void virtio_queue_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx, } } -static void virtio_queue_host_notifier_read(EventNotifier *n) -{ - VirtQueue *vq = container_of(n, VirtQueue, host_notifier); - if (event_notifier_test_and_clear(n)) { - virtio_queue_notify_vq(vq); - } -} - -void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign, - bool set_handler) -{ - if (assign && set_handler) { - event_notifier_set_handler(&vq->host_notifier, true, - virtio_queue_host_notifier_read); - } else { - event_notifier_set_handler(&vq->host_notifier, true, NULL); - } - if (!assign) { - /* Test and clear notifier before after disabling event, - * in case poll callback didn't have time to run. */ - virtio_queue_host_notifier_read(&vq->host_notifier); - } -} - EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq) { return &vq->host_notifier; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9a40df7..49488bf 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -248,8 +248,6 @@ EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq); void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign, bool with_irqfd); EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq); -void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign, - bool set_handler); void virtio_queue_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx, bool assign, VirtQueueHandleOutput handle_output); -- 2.8.3