mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qom: Refine container_get() to allow using a custom root
Specify the root to search from as argument. This avoids hardcoding "/machine" in some places and makes it more flexible. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
7f3bf92fad
commit
dfe47e7029
4 changed files with 10 additions and 8 deletions
|
@ -181,7 +181,7 @@ static Object *qdev_get_peripheral(void)
|
|||
static Object *dev;
|
||||
|
||||
if (dev == NULL) {
|
||||
dev = container_get("/machine/peripheral");
|
||||
dev = container_get(qdev_get_machine(), "/peripheral");
|
||||
}
|
||||
|
||||
return dev;
|
||||
|
@ -192,7 +192,7 @@ static Object *qdev_get_peripheral_anon(void)
|
|||
static Object *dev;
|
||||
|
||||
if (dev == NULL) {
|
||||
dev = container_get("/machine/peripheral-anon");
|
||||
dev = container_get(qdev_get_machine(), "/peripheral-anon");
|
||||
}
|
||||
|
||||
return dev;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue