public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/18] kvm: qemu: fix the prototype of virtio_net_init()
@ 2009-01-15 13:47 Mark McLoughlin
  2009-01-15 13:47 ` [PATCH 02/18] kvm: qemu: make qemu_alloc_physram() and alloc_mem_area() static Mark McLoughlin
  2009-01-15 13:58 ` [PATCH 01/18] kvm: qemu: fix the prototype of virtio_net_init() Avi Kivity
  0 siblings, 2 replies; 23+ messages in thread
From: Mark McLoughlin @ 2009-01-15 13:47 UTC (permalink / raw)
  To: avi; +Cc: kvm, Mark McLoughlin

NIC init functions don't return a PCIDevice pointer in upstream QEMU
but they do in KVM for hotplug.

Fixes:

  qemu/hw/pci.c:740: warning: initialization from incompatible pointer type

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 qemu/hw/virtio-net.c |    6 ++++--
 qemu/hw/virtio-net.h |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index 28337c3..358c382 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
@@ -409,7 +409,7 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
     return 0;
 }
 
-void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
+PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
 {
     VirtIONet *n;
     static int virtio_net_id;
@@ -420,7 +420,7 @@ void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
                                      sizeof(struct virtio_net_config),
                                      sizeof(VirtIONet));
     if (!n)
-        return;
+        return NULL;
 
     n->vdev.get_config = virtio_net_update_config;
     n->vdev.get_features = virtio_net_get_features;
@@ -441,4 +441,6 @@ void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
 
     register_savevm("virtio-net", virtio_net_id++, 2,
                     virtio_net_save, virtio_net_load, n);
+
+    return (PCIDevice *)n;
 }
diff --git a/qemu/hw/virtio-net.h b/qemu/hw/virtio-net.h
index 148ec47..9ac9e34 100644
--- a/qemu/hw/virtio-net.h
+++ b/qemu/hw/virtio-net.h
@@ -80,6 +80,6 @@ struct virtio_net_hdr_mrg_rxbuf
     uint16_t num_buffers;   /* Number of merged rx buffers */
 };
 
-void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn);
+PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn);
 
 #endif
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-01-15 14:35 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 13:47 [PATCH 01/18] kvm: qemu: fix the prototype of virtio_net_init() Mark McLoughlin
2009-01-15 13:47 ` [PATCH 02/18] kvm: qemu: make qemu_alloc_physram() and alloc_mem_area() static Mark McLoughlin
2009-01-15 13:47   ` [PATCH 03/18] kvm: qemu: kill some redundant declarations Mark McLoughlin
2009-01-15 13:47     ` [PATCH 04/18] kvm: qemu: make lsi_scsi_uninit() static Mark McLoughlin
2009-01-15 13:47       ` [PATCH 05/18] kvm: qemu: Fix virtio_blk_init() calls Mark McLoughlin
2009-01-15 13:47         ` [PATCH 06/18] kvm: qemu: device-assignment: don't use libkvm's private get_slot() Mark McLoughlin
2009-01-15 13:47           ` [PATCH 07/18] kvm: libkvm: make get_slot() and co. static Mark McLoughlin
2009-01-15 13:47             ` [PATCH 08/18] kvm: qemu: device-assignment: add kvm_add_ioperm_data() prototype Mark McLoughlin
2009-01-15 13:47               ` [PATCH 09/18] kvm: qemu: device-assignment: add assigned_dev_update_irq() prototype Mark McLoughlin
2009-01-15 13:47                 ` [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing Mark McLoughlin
2009-01-15 13:47                   ` [PATCH 11/18] kvm: qemu: kill unused variable Mark McLoughlin
2009-01-15 13:47                     ` [PATCH 12/18] kvm: qemu: kill redundant declarion of perror() Mark McLoughlin
2009-01-15 13:47                       ` [PATCH 13/18] kvm: qemu: kill redundant declaration of smp_cpus and vm_running Mark McLoughlin
2009-01-15 13:47                         ` [PATCH 14/18] kvm: qemu: make qemu_kvm_system_reset() static Mark McLoughlin
2009-01-15 13:47                           ` [PATCH 15/18] kvm: qemu: kill unused variable in kvm_init_vcpu() Mark McLoughlin
2009-01-15 13:47                             ` [PATCH 16/18] kvm: qemu: make another couple of functions static Mark McLoughlin
2009-01-15 13:47                               ` [PATCH 17/18] kvm: qemu: fix update_vbios_real_tpr declaration Mark McLoughlin
2009-01-15 13:47                                 ` [PATCH 18/18] kvm: qemu: kill unused variable in enable_vapic() Mark McLoughlin
2009-01-15 13:54                   ` [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing Avi Kivity
2009-01-15 14:24                     ` Mark McLoughlin
2009-01-15 14:35                       ` Avi Kivity
2009-01-15 13:58 ` [PATCH 01/18] kvm: qemu: fix the prototype of virtio_net_init() Avi Kivity
2009-01-15 14:28   ` Mark McLoughlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox