Patchwork [for-next,v2,16/22] virtio-rng: QOM realize preparations

login
register
mail settings
Submitter Andreas Färber
Date Aug. 1, 2013, 2:17 a.m.
Message ID <1375323463-32747-17-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/263866/
State New
Headers show

Comments

Andreas Färber - Aug. 1, 2013, 2:17 a.m.
Rename qdev -> dev because that's what realize's argument is called by
convention. No need to keep more "qdev" around than necessary.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/virtio/virtio-rng.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Patch

diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index bac8421..0accc9e 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -135,19 +135,19 @@  static void check_rate_limit(void *opaque)
 
 static int virtio_rng_device_init(VirtIODevice *vdev)
 {
-    DeviceState *qdev = DEVICE(vdev);
-    VirtIORNG *vrng = VIRTIO_RNG(vdev);
+    DeviceState *dev = DEVICE(vdev);
+    VirtIORNG *vrng = VIRTIO_RNG(dev);
     Error *local_err = NULL;
 
     if (vrng->conf.rng == NULL) {
         vrng->conf.default_backend = RNG_RANDOM(object_new(TYPE_RNG_RANDOM));
 
-        object_property_add_child(OBJECT(qdev),
+        object_property_add_child(OBJECT(dev),
                                   "default-backend",
                                   OBJECT(vrng->conf.default_backend),
                                   NULL);
 
-        object_property_set_link(OBJECT(qdev),
+        object_property_set_link(OBJECT(dev),
                                  OBJECT(vrng->conf.default_backend),
                                  "rng", NULL);
     }
@@ -178,20 +178,20 @@  static int virtio_rng_device_init(VirtIODevice *vdev)
     qemu_mod_timer(vrng->rate_limit_timer,
                    qemu_get_clock_ms(vm_clock) + vrng->conf.period_ms);
 
-    register_savevm(qdev, "virtio-rng", -1, 1, virtio_rng_save,
+    register_savevm(dev, "virtio-rng", -1, 1, virtio_rng_save,
                     virtio_rng_load, vrng);
 
     return 0;
 }
 
-static int virtio_rng_device_exit(DeviceState *qdev)
+static int virtio_rng_device_exit(DeviceState *dev)
 {
-    VirtIORNG *vrng = VIRTIO_RNG(qdev);
-    VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
+    VirtIORNG *vrng = VIRTIO_RNG(dev);
+    VirtIODevice *vdev = VIRTIO_DEVICE(dev);
 
     qemu_del_timer(vrng->rate_limit_timer);
     qemu_free_timer(vrng->rate_limit_timer);
-    unregister_savevm(qdev, "virtio-rng", vrng);
+    unregister_savevm(dev, "virtio-rng", vrng);
     virtio_cleanup(vdev);
     return 0;
 }