[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/30] virtio-net: QOM realize preparations
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 17/30] virtio-net: QOM realize preparations |
Date: |
Mon, 9 Dec 2013 21:48:19 +0100 |
From: Andreas Färber <address@hidden>
Rename variable qdev -> dev since that's what realize's argument is
called by convention.
Avoid duplicate VIRTIO_DEVICE() cast.
Signed-off-by: Andreas Färber <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/net/virtio-net.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 93a81eb..a669f83 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1488,14 +1488,12 @@ void virtio_net_set_netclient_name(VirtIONet *n, const
char *name,
static int virtio_net_device_init(VirtIODevice *vdev)
{
- int i;
-
- DeviceState *qdev = DEVICE(vdev);
- VirtIONet *n = VIRTIO_NET(vdev);
+ DeviceState *dev = DEVICE(vdev);
+ VirtIONet *n = VIRTIO_NET(dev);
NetClientState *nc;
+ int i;
- virtio_init(VIRTIO_DEVICE(n), "virtio-net", VIRTIO_ID_NET,
- n->config_size);
+ virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size);
n->max_queues = MAX(n->nic_conf.queues, 1);
n->vqs = g_malloc0(sizeof(VirtIONetQueue) * n->max_queues);
@@ -1535,7 +1533,7 @@ static int virtio_net_device_init(VirtIODevice *vdev)
n->netclient_type, n->netclient_name, n);
} else {
n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf,
- object_get_typename(OBJECT(qdev)), qdev->id, n);
+ object_get_typename(OBJECT(dev)), dev->id, n);
}
peer_test_vnet_hdr(n);
@@ -1562,11 +1560,11 @@ static int virtio_net_device_init(VirtIODevice *vdev)
nc = qemu_get_queue(n->nic);
nc->rxfilter_notify_enabled = 1;
- n->qdev = qdev;
- register_savevm(qdev, "virtio-net", -1, VIRTIO_NET_VM_VERSION,
+ n->qdev = dev;
+ register_savevm(dev, "virtio-net", -1, VIRTIO_NET_VM_VERSION,
virtio_net_save, virtio_net_load, n);
- add_boot_device_path(n->nic_conf.bootindex, qdev, "/address@hidden");
+ add_boot_device_path(n->nic_conf.bootindex, dev, "/address@hidden");
return 0;
}
--
1.8.4.2
- [Qemu-devel] [PULL 07/30] virtio-serial: switch exit callback to VirtioDeviceClass, (continued)
- [Qemu-devel] [PULL 07/30] virtio-serial: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 08/30] virtio-net: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 09/30] virtio-scsi: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 10/30] virtio-balloon: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 11/30] virtio-rng: switch exit callback to VirtioDeviceClass, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 12/30] virtio-pci: add device_unplugged callback, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 13/30] virtio-blk-dataplane: Improve error reporting, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 14/30] virtio-9p: QOM realize preparations, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 15/30] virtio-blk: QOM realize preparations, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 16/30] virtio-serial: QOM realize preparations, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 17/30] virtio-net: QOM realize preparations,
Paolo Bonzini <=
- [Qemu-devel] [PULL 18/30] virtio-balloon: QOM realize preparations, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 19/30] virtio-rng: QOM realize preparations, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 20/30] virtio-scsi: QOM realize preparations, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 21/30] virtio: Start converting VirtioDevice to QOM realize, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 22/30] virtio-9p: Convert to QOM realize, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 23/30] virtio-blk: Convert to QOM realize, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 24/30] virtio-serial: Convert to QOM realize, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 25/30] virtio-net: Convert to QOM realize, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 26/30] virtio-balloon: Convert to QOM realize, Paolo Bonzini, 2013/12/09
- [Qemu-devel] [PULL 27/30] virtio-rng: Convert to QOM realize, Paolo Bonzini, 2013/12/09