mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
hw/core/qdev.c: add qdev_get_human_name()
Add a simple method to return some kind of human readable identifier for use in error messages. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Message-id: 8b566bfced98ae44be1fcc1f8e7215f0c3393aa1.1706598705.git.manos.pitsidianakis@linaro.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
d5eaeefbda
commit
956ef49990
2 changed files with 22 additions and 0 deletions
|
@ -879,6 +879,14 @@ Object *qdev_get_machine(void)
|
|||
return dev;
|
||||
}
|
||||
|
||||
char *qdev_get_human_name(DeviceState *dev)
|
||||
{
|
||||
g_assert(dev != NULL);
|
||||
|
||||
return dev->id ?
|
||||
g_strdup(dev->id) : object_get_canonical_path(OBJECT(dev));
|
||||
}
|
||||
|
||||
static MachineInitPhase machine_phase;
|
||||
|
||||
bool phase_check(MachineInitPhase phase)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue