mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes device in firmware readable way is added into sorted list. Later this list will be passed into firmware to control boot order. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
db07c0f84b
commit
1ca4d09ae0
17 changed files with 119 additions and 2 deletions
32
hw/qdev.c
32
hw/qdev.c
|
@ -889,3 +889,35 @@ int do_device_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
|||
}
|
||||
return qdev_unplug(dev);
|
||||
}
|
||||
|
||||
static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size)
|
||||
{
|
||||
int l = 0;
|
||||
|
||||
if (dev && dev->parent_bus) {
|
||||
char *d;
|
||||
l = qdev_get_fw_dev_path_helper(dev->parent_bus->parent, p, size);
|
||||
if (dev->parent_bus->info->get_fw_dev_path) {
|
||||
d = dev->parent_bus->info->get_fw_dev_path(dev);
|
||||
l += snprintf(p + l, size - l, "%s", d);
|
||||
qemu_free(d);
|
||||
} else {
|
||||
l += snprintf(p + l, size - l, "%s", dev->info->name);
|
||||
}
|
||||
}
|
||||
l += snprintf(p + l , size - l, "/");
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
char* qdev_get_fw_dev_path(DeviceState *dev)
|
||||
{
|
||||
char path[128];
|
||||
int l;
|
||||
|
||||
l = qdev_get_fw_dev_path_helper(dev, path, 128);
|
||||
|
||||
path[l-1] = '\0';
|
||||
|
||||
return strdup(path);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue