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