yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
0a122b
From 7f65c774ae1c40ca38de8db14ad5637390c6c2e7 Mon Sep 17 00:00:00 2001
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
Date: Fri, 17 Jan 2014 17:07:55 +0100
0a122b
Subject: [PATCH 05/11] qdev-monitor: Avoid qdev as variable name
0a122b
MIME-Version: 1.0
0a122b
Content-Type: text/plain; charset=UTF-8
0a122b
Content-Transfer-Encoding: 8bit
0a122b
0a122b
RH-Author: Markus Armbruster <armbru@redhat.com>
0a122b
Message-id: <1389978479-30595-6-git-send-email-armbru@redhat.com>
0a122b
Patchwork-id: 56791
0a122b
O-Subject: [PATCH 7.0 qemu-kvm 5/9] qdev-monitor: Avoid qdev as variable name
0a122b
Bugzilla: 669524
0a122b
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
0a122b
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
0a122b
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
0a122b
0a122b
From: Andreas Färber <afaerber@suse.de>
0a122b
0a122b
Prepares for bringing error cleanup code into canonical QOM form.
0a122b
0a122b
Includes a whitespace removal after curly brace by Stefan.
0a122b
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
0a122b
Signed-off-by: Andreas Färber <afaerber@suse.de>
0a122b
(cherry picked from commit 2bcb0c62f620a7033e9e25c5b645d50bf9e6a8f2)
0a122b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
0a122b
---
0a122b
 qdev-monitor.c | 32 ++++++++++++++++----------------
0a122b
 1 file changed, 16 insertions(+), 16 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 qdev-monitor.c |   32 ++++++++++++++++----------------
0a122b
 1 files changed, 16 insertions(+), 16 deletions(-)
0a122b
0a122b
diff --git a/qdev-monitor.c b/qdev-monitor.c
0a122b
index f313a94..464e7bd 100644
0a122b
--- a/qdev-monitor.c
0a122b
+++ b/qdev-monitor.c
0a122b
@@ -457,7 +457,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
0a122b
     ObjectClass *oc;
0a122b
     DeviceClass *dc;
0a122b
     const char *driver, *path, *id;
0a122b
-    DeviceState *qdev;
0a122b
+    DeviceState *dev;
0a122b
     BusState *bus = NULL;
0a122b
 
0a122b
     driver = qemu_opt_get(opts, "driver");
0a122b
@@ -516,38 +516,38 @@ DeviceState *qdev_device_add(QemuOpts *opts)
0a122b
     }
0a122b
 
0a122b
     /* create device, set properties */
0a122b
-    qdev = DEVICE(object_new(driver));
0a122b
+    dev = DEVICE(object_new(driver));
0a122b
 
0a122b
     if (bus) {
0a122b
-        qdev_set_parent_bus(qdev, bus);
0a122b
+        qdev_set_parent_bus(dev, bus);
0a122b
     }
0a122b
 
0a122b
     id = qemu_opts_id(opts);
0a122b
     if (id) {
0a122b
-        qdev->id = id;
0a122b
+        dev->id = id;
0a122b
     }
0a122b
-    if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {
0a122b
-        object_unparent(OBJECT(qdev));
0a122b
-        object_unref(OBJECT(qdev));
0a122b
+    if (qemu_opt_foreach(opts, set_property, dev, 1) != 0) {
0a122b
+        object_unparent(OBJECT(dev));
0a122b
+        object_unref(OBJECT(dev));
0a122b
         return NULL;
0a122b
     }
0a122b
-    if (qdev->id) {
0a122b
-        object_property_add_child(qdev_get_peripheral(), qdev->id,
0a122b
-                                  OBJECT(qdev), NULL);
0a122b
+    if (dev->id) {
0a122b
+        object_property_add_child(qdev_get_peripheral(), dev->id,
0a122b
+                                  OBJECT(dev), NULL);
0a122b
     } else {
0a122b
         static int anon_count;
0a122b
         gchar *name = g_strdup_printf("device[%d]", anon_count++);
0a122b
         object_property_add_child(qdev_get_peripheral_anon(), name,
0a122b
-                                  OBJECT(qdev), NULL);
0a122b
+                                  OBJECT(dev), NULL);
0a122b
         g_free(name);
0a122b
-    }        
0a122b
-    if (qdev_init(qdev) < 0) {
0a122b
-        object_unref(OBJECT(qdev));
0a122b
+    }
0a122b
+    if (qdev_init(dev) < 0) {
0a122b
+        object_unref(OBJECT(dev));
0a122b
         qerror_report(QERR_DEVICE_INIT_FAILED, driver);
0a122b
         return NULL;
0a122b
     }
0a122b
-    qdev->opts = opts;
0a122b
-    return qdev;
0a122b
+    dev->opts = opts;
0a122b
+    return dev;
0a122b
 }
0a122b
 
0a122b
 
0a122b
-- 
0a122b
1.7.1
0a122b