From patchwork Sun Jan 10 11:52:47 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: 42575 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 3DFCAB6F07 for ; Sun, 10 Jan 2010 23:07:46 +1100 (EST) Received: from localhost ([127.0.0.1]:41662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTwTS-00009r-Tg for incoming@patchwork.ozlabs.org; Sun, 10 Jan 2010 07:00:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTwOb-0007dH-CF for qemu-devel@nongnu.org; Sun, 10 Jan 2010 06:55:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTwOW-0007bL-GS for qemu-devel@nongnu.org; Sun, 10 Jan 2010 06:55:48 -0500 Received: from [199.232.76.173] (port=39539 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTwOW-0007b6-5K for qemu-devel@nongnu.org; Sun, 10 Jan 2010 06:55:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27454) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTwOV-00046s-Az for qemu-devel@nongnu.org; Sun, 10 Jan 2010 06:55:43 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0ABtffw029673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 10 Jan 2010 06:55:41 -0500 Received: from redhat.com (vpn2-11-45.ams2.redhat.com [10.36.11.45]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o0ABtdft028181; Sun, 10 Jan 2010 06:55:40 -0500 Date: Sun, 10 Jan 2010 13:52:47 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, Anthony Liguori , kraxel@redhat.com Message-ID: <20100110115247.GC27013@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCHv7 2/3] virtio: rename features -> guest_features 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 Rename features->guest_features. This is what they are, avoid confusion with host features which we also need to keep around. Signed-off-by: Michael S. Tsirkin --- hw/s390-virtio-bus.c | 2 +- hw/syborg_virtio.c | 4 ++-- hw/virtio-net.c | 10 +++++----- hw/virtio-pci.c | 4 ++-- hw/virtio.c | 8 ++++---- hw/virtio.h | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index dc154ed..6c0da11 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -251,7 +251,7 @@ void s390_virtio_device_update_status(VirtIOS390Device *dev) if (vdev->set_features) { vdev->set_features(vdev, features); } - vdev->features = features; + vdev->guest_features = features; } VirtIOS390Device *s390_virtio_bus_console(VirtIOS390Bus *bus) diff --git a/hw/syborg_virtio.c b/hw/syborg_virtio.c index a84206a..fe6fc23 100644 --- a/hw/syborg_virtio.c +++ b/hw/syborg_virtio.c @@ -90,7 +90,7 @@ static uint32_t syborg_virtio_readl(void *opaque, target_phys_addr_t offset) ret |= vdev->binding->get_features(s); break; case SYBORG_VIRTIO_GUEST_FEATURES: - ret = vdev->features; + ret = vdev->guest_features; break; case SYBORG_VIRTIO_QUEUE_BASE: ret = virtio_queue_get_addr(vdev, vdev->queue_sel); @@ -132,7 +132,7 @@ static void syborg_virtio_writel(void *opaque, target_phys_addr_t offset, case SYBORG_VIRTIO_GUEST_FEATURES: if (vdev->set_features) vdev->set_features(vdev, value); - vdev->features = value; + vdev->guest_features = value; break; case SYBORG_VIRTIO_QUEUE_BASE: if (value == 0) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 2f201ff..ab20a33 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -768,11 +768,11 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) if (n->has_vnet_hdr) { tap_using_vnet_hdr(n->nic->nc.peer, 1); tap_set_offload(n->nic->nc.peer, - (n->vdev.features >> VIRTIO_NET_F_GUEST_CSUM) & 1, - (n->vdev.features >> VIRTIO_NET_F_GUEST_TSO4) & 1, - (n->vdev.features >> VIRTIO_NET_F_GUEST_TSO6) & 1, - (n->vdev.features >> VIRTIO_NET_F_GUEST_ECN) & 1, - (n->vdev.features >> VIRTIO_NET_F_GUEST_UFO) & 1); + (n->vdev.guest_features >> VIRTIO_NET_F_GUEST_CSUM) & 1, + (n->vdev.guest_features >> VIRTIO_NET_F_GUEST_TSO4) & 1, + (n->vdev.guest_features >> VIRTIO_NET_F_GUEST_TSO6) & 1, + (n->vdev.guest_features >> VIRTIO_NET_F_GUEST_ECN) & 1, + (n->vdev.guest_features >> VIRTIO_NET_F_GUEST_UFO) & 1); } } diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 62b46bd..4e1d5e1 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -181,7 +181,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) } if (vdev->set_features) vdev->set_features(vdev, val); - vdev->features = val; + vdev->guest_features = val; break; case VIRTIO_PCI_QUEUE_PFN: pa = (target_phys_addr_t)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT; @@ -239,7 +239,7 @@ static uint32_t virtio_ioport_read(VirtIOPCIProxy *proxy, uint32_t addr) ret |= vdev->binding->get_features(proxy); break; case VIRTIO_PCI_GUEST_FEATURES: - ret = vdev->features; + ret = vdev->guest_features; break; case VIRTIO_PCI_QUEUE_PFN: ret = virtio_queue_get_addr(vdev, vdev->queue_sel) diff --git a/hw/virtio.c b/hw/virtio.c index bb78ca8..f01548e 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -441,7 +441,7 @@ void virtio_reset(void *opaque) if (vdev->reset) vdev->reset(vdev); - vdev->features = 0; + vdev->guest_features = 0; vdev->queue_sel = 0; vdev->status = 0; vdev->isr = 0; @@ -596,7 +596,7 @@ void virtio_notify(VirtIODevice *vdev, VirtQueue *vq) mb(); /* Always notify when queue is empty (when feature acknowledge) */ if ((vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT) && - (!(vdev->features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) || + (!(vdev->guest_features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) || (vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx))) return; @@ -623,7 +623,7 @@ void virtio_save(VirtIODevice *vdev, QEMUFile *f) qemu_put_8s(f, &vdev->status); qemu_put_8s(f, &vdev->isr); qemu_put_be16s(f, &vdev->queue_sel); - qemu_put_be32s(f, &vdev->features); + qemu_put_be32s(f, &vdev->guest_features); qemu_put_be32(f, vdev->config_len); qemu_put_buffer(f, vdev->config, vdev->config_len); @@ -668,7 +668,7 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f) features, supported_features); return -1; } - vdev->features = features; + vdev->guest_features = features; vdev->config_len = qemu_get_be32(f); qemu_get_buffer(f, vdev->config, vdev->config_len); diff --git a/hw/virtio.h b/hw/virtio.h index 35532a6..85ef171 100644 --- a/hw/virtio.h +++ b/hw/virtio.h @@ -100,7 +100,7 @@ struct VirtIODevice uint8_t status; uint8_t isr; uint16_t queue_sel; - uint32_t features; + uint32_t guest_features; size_t config_len; void *config; uint16_t config_vector;