Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
qemu
0316-qdev-add-qdev_alias_all_properties.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0316-qdev-add-qdev_alias_all_properties.patch of Package qemu
From 0fd39b6b7bbf7a064d1c5952910ef70e5afe0a55 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi <stefanha@redhat.com> Date: Wed, 18 Jun 2014 17:58:32 +0800 Subject: [PATCH] qdev: add qdev_alias_all_properties() The qdev_alias_all_properties() function creates QOM alias properties for each qdev property on a DeviceState. This is useful for parent objects that wish to forward property accesses to their children. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> (cherry picked from commit 67cc7e0aaca835ed68cf3bd34f4d51a21232792f) [BR: Fix and/or infrastructure for BSC#1020427 CVE-2016-9602] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/core/qdev.c | 21 +++++++++++++++++++++ include/hw/qdev-properties.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 79db4709a4..ad8da1ddda 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -727,6 +727,27 @@ void qdev_property_add_static(DeviceState *dev, Property *prop, } } +/* @qdev_alias_all_properties - Add alias properties to the source object for + * all qdev properties on the target DeviceState. + */ +void qdev_alias_all_properties(DeviceState *target, Object *source) +{ + ObjectClass *class; + Property *prop; + + class = object_get_class(OBJECT(target)); + do { + DeviceClass *dc = DEVICE_CLASS(class); + + for (prop = dc->props; prop && prop->name; prop++) { + object_property_add_alias(source, prop->name, + OBJECT(target), prop->name, + &error_abort); + } + class = object_class_get_parent(class); + } while (class != object_class_by_name(TYPE_DEVICE)); +} + static bool device_get_realized(Object *obj, Error **errp) { DeviceState *dev = DEVICE(obj); diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index c46e908d71..ffef425cd0 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -192,6 +192,8 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp); +void qdev_alias_all_properties(DeviceState *target, Object *source); + /** * @qdev_prop_set_after_realize: * @dev: device
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor