Blame SOURCES/kvm-qdev-monitor-Clean-up-qdev_device_add-variable-namin.patch

0a122b
From 4767cbd32744d8dff462233b6509f31ebe826588 Mon Sep 17 00:00:00 2001
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
Date: Fri, 17 Jan 2014 17:07:53 +0100
0a122b
Subject: [PATCH 03/11] qdev-monitor: Clean up qdev_device_add() variable naming
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-4-git-send-email-armbru@redhat.com>
0a122b
Patchwork-id: 56786
0a122b
O-Subject: [PATCH 7.0 qemu-kvm 3/9] qdev-monitor: Clean up qdev_device_add() variable naming
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
Avoid confusion between object (obj) and object class (oc).
0a122b
Tidy DeviceClass variable while at it (k -> dc).
0a122b
0a122b
Signed-off-by: Andreas Färber <afaerber@suse.de>
0a122b
(cherry picked from commit f4d85795605c7dc594c013221a4b6d62967bd8ab)
0a122b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
0a122b
---
0a122b
 qdev-monitor.c | 22 +++++++++++-----------
0a122b
 1 file changed, 11 insertions(+), 11 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 qdev-monitor.c |   22 +++++++++++-----------
0a122b
 1 files changed, 11 insertions(+), 11 deletions(-)
0a122b
0a122b
diff --git a/qdev-monitor.c b/qdev-monitor.c
0a122b
index d187db5..5b45d02 100644
0a122b
--- a/qdev-monitor.c
0a122b
+++ b/qdev-monitor.c
0a122b
@@ -454,8 +454,8 @@ static BusState *qbus_find(const char *path)
0a122b
 
0a122b
 DeviceState *qdev_device_add(QemuOpts *opts)
0a122b
 {
0a122b
-    ObjectClass *obj;
0a122b
-    DeviceClass *k;
0a122b
+    ObjectClass *oc;
0a122b
+    DeviceClass *dc;
0a122b
     const char *driver, *path, *id;
0a122b
     DeviceState *qdev;
0a122b
     BusState *bus = NULL;
0a122b
@@ -467,22 +467,22 @@ DeviceState *qdev_device_add(QemuOpts *opts)
0a122b
     }
0a122b
 
0a122b
     /* find driver */
0a122b
-    obj = object_class_by_name(driver);
0a122b
-    if (!obj) {
0a122b
+    oc = object_class_by_name(driver);
0a122b
+    if (!oc) {
0a122b
         const char *typename = find_typename_by_alias(driver);
0a122b
 
0a122b
         if (typename) {
0a122b
             driver = typename;
0a122b
-            obj = object_class_by_name(driver);
0a122b
+            oc = object_class_by_name(driver);
0a122b
         }
0a122b
     }
0a122b
 
0a122b
-    if (!obj) {
0a122b
+    if (!oc) {
0a122b
         qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", "device type");
0a122b
         return NULL;
0a122b
     }
0a122b
 
0a122b
-    k = DEVICE_CLASS(obj);
0a122b
+    dc = DEVICE_CLASS(oc);
0a122b
 
0a122b
     /* find bus */
0a122b
     path = qemu_opt_get(opts, "bus");
0a122b
@@ -491,16 +491,16 @@ DeviceState *qdev_device_add(QemuOpts *opts)
0a122b
         if (!bus) {
0a122b
             return NULL;
0a122b
         }
0a122b
-        if (!object_dynamic_cast(OBJECT(bus), k->bus_type)) {
0a122b
+        if (!object_dynamic_cast(OBJECT(bus), dc->bus_type)) {
0a122b
             qerror_report(QERR_BAD_BUS_FOR_DEVICE,
0a122b
                           driver, object_get_typename(OBJECT(bus)));
0a122b
             return NULL;
0a122b
         }
0a122b
-    } else if (k->bus_type != NULL) {
0a122b
-        bus = qbus_find_recursive(sysbus_get_default(), NULL, k->bus_type);
0a122b
+    } else if (dc->bus_type != NULL) {
0a122b
+        bus = qbus_find_recursive(sysbus_get_default(), NULL, dc->bus_type);
0a122b
         if (!bus) {
0a122b
             qerror_report(QERR_NO_BUS_FOR_DEVICE,
0a122b
-                          k->bus_type, driver);
0a122b
+                          dc->bus_type, driver);
0a122b
             return NULL;
0a122b
         }
0a122b
     }
0a122b
-- 
0a122b
1.7.1
0a122b