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