From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH 01/18] kvm: qemu: fix the prototype of virtio_net_init() Date: Thu, 15 Jan 2009 13:47:25 +0000 Message-ID: <1232027262-21487-1-git-send-email-markmc@redhat.com> Cc: kvm@vger.kernel.org, Mark McLoughlin To: avi@redhat.com Return-path: Received: from mail13.svc.cra.dublin.eircom.net ([159.134.118.29]:47991 "HELO mail13.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1760105AbZAONrq (ORCPT ); Thu, 15 Jan 2009 08:47:46 -0500 Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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