From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgY6h-0001Yk-A4 for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:32:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgY6g-00016G-9e for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:32:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgY6f-00015N-T7 for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:32:21 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 8E99831F063 for ; Fri, 10 Apr 2015 12:32:21 +0000 (UTC) From: Gerd Hoffmann Date: Fri, 10 Apr 2015 14:31:47 +0200 Message-Id: <1428669111-24225-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1428669111-24225-1-git-send-email-kraxel@redhat.com> References: <1428669111-24225-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/9] virtio: move cap type to VirtIOPCIRegion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , mst@redhat.com Signed-off-by: Gerd Hoffmann --- hw/virtio/virtio-pci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 617a3b7..037f4ea 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1221,18 +1221,21 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) proxy, "virtio-pci-common", 0x1000); proxy->common.offset = 0x0; + proxy->common.type = VIRTIO_PCI_CAP_COMMON_CFG; memory_region_init_io(&proxy->isr.mr, OBJECT(proxy), &isr_ops, proxy, "virtio-pci-isr", 0x1000); proxy->isr.offset = 0x1000; + proxy->isr.type = VIRTIO_PCI_CAP_ISR_CFG; memory_region_init_io(&proxy->device.mr, OBJECT(proxy), &device_ops, virtio_bus_get_device(&proxy->bus), "virtio-pci-device", 0x1000); proxy->device.offset = 0x2000; + proxy->device.type = VIRTIO_PCI_CAP_DEVICE_CFG; memory_region_init_io(&proxy->notify.mr, OBJECT(proxy), ¬ify_ops, @@ -1241,6 +1244,7 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) QEMU_VIRTIO_PCI_QUEUE_MEM_MULT * VIRTIO_PCI_QUEUE_MAX); proxy->notify.offset = 0x3000; + proxy->notify.type = VIRTIO_PCI_CAP_NOTIFY_CFG; } static void virtio_pci_modern_region_map(VirtIOPCIProxy *proxy, @@ -1251,6 +1255,7 @@ static void virtio_pci_modern_region_map(VirtIOPCIProxy *proxy, region->offset, ®ion->mr); + cap->cfg_type = region->type; cap->offset = cpu_to_le32(region->offset); cap->length = cpu_to_le32(memory_region_size(®ion->mr)); virtio_pci_add_mem_cap(proxy, cap); @@ -1305,22 +1310,18 @@ static void virtio_pci_device_plugged(DeviceState *d) if (modern) { struct virtio_pci_cap common = { - .cfg_type = VIRTIO_PCI_CAP_COMMON_CFG, .cap_len = sizeof common, .bar = modern_mem_bar, }; struct virtio_pci_cap isr = { - .cfg_type = VIRTIO_PCI_CAP_ISR_CFG, .cap_len = sizeof isr, .bar = modern_mem_bar, }; struct virtio_pci_cap device = { - .cfg_type = VIRTIO_PCI_CAP_DEVICE_CFG, .cap_len = sizeof device, .bar = modern_mem_bar, }; struct virtio_pci_notify_cap notify = { - .cap.cfg_type = VIRTIO_PCI_CAP_NOTIFY_CFG, .cap.cap_len = sizeof notify, .cap.bar = modern_mem_bar, .notify_off_multiplier = cpu_to_le32(QEMU_VIRTIO_PCI_QUEUE_MEM_MULT), -- 1.8.3.1