From patchwork Fri May 29 09:29:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 477709 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9586F140E55 for ; Fri, 29 May 2015 19:30:22 +1000 (AEST) Received: from localhost ([::1]:34611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyGcO-000320-N7 for incoming@patchwork.ozlabs.org; Fri, 29 May 2015 05:30:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyGbw-00029U-SX for qemu-devel@nongnu.org; Fri, 29 May 2015 05:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyGbr-0001yr-O6 for qemu-devel@nongnu.org; Fri, 29 May 2015 05:29:52 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:47089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyGbr-0001ye-Fc for qemu-devel@nongnu.org; Fri, 29 May 2015 05:29:47 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 May 2015 10:29:45 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 29 May 2015 10:29:44 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 607181B0805F for ; Fri, 29 May 2015 10:30:36 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4T9Thmj19398832 for ; Fri, 29 May 2015 09:29:43 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4T9ThW9016338 for ; Fri, 29 May 2015 03:29:43 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t4T9TgUF016282; Fri, 29 May 2015 03:29:42 -0600 From: Cornelia Huck To: mst@redhat.com Date: Fri, 29 May 2015 11:29:40 +0200 Message-Id: <1432891780-46490-3-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 2.3.7 In-Reply-To: <1432891780-46490-1-git-send-email-cornelia.huck@de.ibm.com> References: <1432891780-46490-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15052909-0025-0000-0000-0000055CAB1C X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.112 Cc: Cornelia Huck , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/2] virtio: move VIRTIO_F_NOTIFY_ON_EMPTY into core 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 Nearly all transports have been offering VIRTIO_F_NOTIFY_ON_EMPTY, s390-virtio being the exception. There's no reason why it shouldn't offer it as well, though (handling is done in core anyway), so let's move it to the common virtio features. While we're changing it anyway, fix the indentation for the DEFINE_VIRTIO_COMMON_FEATURES macro. Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 3 --- hw/virtio/virtio-mmio.c | 10 ---------- hw/virtio/virtio-pci.c | 1 - include/hw/virtio/virtio.h | 10 ++++++---- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 2d63764..8801e15 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1409,12 +1409,9 @@ static void virtio_ccw_device_plugged(DeviceState *d) { VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); SubchDev *sch = dev->sch; - VirtIODevice *vdev = virtio_ccw_get_vdev(sch); sch->id.cu_model = virtio_bus_get_vdev_id(&dev->bus); - virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY); - css_generate_sch_crws(sch->cssid, sch->ssid, sch->schid, d->hotplugged, 1); } diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 1817a07..3008b65 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -336,15 +336,6 @@ static void virtio_mmio_reset(DeviceState *d) /* virtio-mmio device */ -/* This is called by virtio-bus just after the device is plugged. */ -static void virtio_mmio_device_plugged(DeviceState *opaque) -{ - VirtIOMMIOProxy *proxy = VIRTIO_MMIO(opaque); - VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); - - virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY); -} - static void virtio_mmio_realizefn(DeviceState *d, Error **errp) { VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d); @@ -384,7 +375,6 @@ static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data) k->notify = virtio_mmio_update_irq; k->save_config = virtio_mmio_save_config; k->load_config = virtio_mmio_load_config; - k->device_plugged = virtio_mmio_device_plugged; k->has_variable_vring_alignment = true; bus_class->max_dev = 1; } diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index a8383ac..fc5f8b4 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -953,7 +953,6 @@ static void virtio_pci_device_plugged(DeviceState *d) proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD; } - virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY); virtio_add_feature(&vdev->host_features, VIRTIO_F_BAD_FEATURE); } diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b620da5..d976c7b 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -193,10 +193,12 @@ typedef struct VirtIOSCSIConf VirtIOSCSIConf; typedef struct VirtIORNGConf VirtIORNGConf; #define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \ - DEFINE_PROP_BIT("indirect_desc", _state, _field, \ - VIRTIO_RING_F_INDIRECT_DESC, true), \ - DEFINE_PROP_BIT("event_idx", _state, _field, \ - VIRTIO_RING_F_EVENT_IDX, true) + DEFINE_PROP_BIT("indirect_desc", _state, _field, \ + VIRTIO_RING_F_INDIRECT_DESC, true), \ + DEFINE_PROP_BIT("event_idx", _state, _field, \ + VIRTIO_RING_F_EVENT_IDX, true), \ + DEFINE_PROP_BIT("notify_on_empty", _state, _field, \ + VIRTIO_F_NOTIFY_ON_EMPTY, true) hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);