mirror of
https://git.proxmox.com/git/qemu
synced 2025-07-23 11:14:18 +00:00
qdev: Clean up global properties
Now that global properties do not depend on buses anymore, set them directly in the device instance_init function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
bce544740a
commit
4b3582b06b
@ -440,7 +440,6 @@ DeviceState *qdev_device_add(QemuOpts *opts)
|
|||||||
/* create device, set properties */
|
/* create device, set properties */
|
||||||
qdev = DEVICE(object_new(driver));
|
qdev = DEVICE(object_new(driver));
|
||||||
qdev_set_parent_bus(qdev, bus);
|
qdev_set_parent_bus(qdev, bus);
|
||||||
qdev_prop_set_globals(qdev);
|
|
||||||
|
|
||||||
id = qemu_opts_id(opts);
|
id = qemu_opts_id(opts);
|
||||||
if (id) {
|
if (id) {
|
||||||
|
@ -111,7 +111,6 @@ DeviceState *qdev_try_create(BusState *bus, const char *type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
qdev_set_parent_bus(dev, bus);
|
qdev_set_parent_bus(dev, bus);
|
||||||
qdev_prop_set_globals(dev);
|
|
||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
@ -618,6 +617,7 @@ static void device_initfn(Object *obj)
|
|||||||
qdev_prop_set_defaults(dev, DEVICE_CLASS(class)->props);
|
qdev_prop_set_defaults(dev, DEVICE_CLASS(class)->props);
|
||||||
class = object_class_get_parent(class);
|
class = object_class_get_parent(class);
|
||||||
} while (class != object_class_by_name(TYPE_DEVICE));
|
} while (class != object_class_by_name(TYPE_DEVICE));
|
||||||
|
qdev_prop_set_globals(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unlink device from bus and free the structure. */
|
/* Unlink device from bus and free the structure. */
|
||||||
|
Loading…
Reference in New Issue
Block a user