qom: optimize qdev_get_canonical_path using a parent link

The full tree search was a bit unreasonable.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2011-12-12 14:29:40 -06:00
parent 182970509b
commit b2b6c39a79
2 changed files with 34 additions and 38 deletions

View file

@ -92,6 +92,10 @@ struct DeviceState {
uint32_t ref;
QTAILQ_HEAD(, DeviceProperty) properties;
/* Do not, under any circumstance, use this parent link below anywhere
* outside of qdev.c. You have been warned. */
DeviceState *parent;
};
typedef void (*bus_dev_printfn)(Monitor *mon, DeviceState *dev, int indent);