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