Revision 1ca4d09a vl.c
b/vl.c | ||
---|---|---|
229 | 229 |
const char *prom_envs[MAX_PROM_ENVS]; |
230 | 230 |
int boot_menu; |
231 | 231 |
|
232 |
typedef struct FWBootEntry FWBootEntry; |
|
233 |
|
|
234 |
struct FWBootEntry { |
|
235 |
QTAILQ_ENTRY(FWBootEntry) link; |
|
236 |
int32_t bootindex; |
|
237 |
DeviceState *dev; |
|
238 |
char *suffix; |
|
239 |
}; |
|
240 |
|
|
241 |
QTAILQ_HEAD(, FWBootEntry) fw_boot_order = QTAILQ_HEAD_INITIALIZER(fw_boot_order); |
|
242 |
|
|
232 | 243 |
int nb_numa_nodes; |
233 | 244 |
uint64_t node_mem[MAX_NODES]; |
234 | 245 |
uint64_t node_cpumask[MAX_NODES]; |
... | ... | |
693 | 704 |
qemu_free(standard_boot_devices); |
694 | 705 |
} |
695 | 706 |
|
707 |
void add_boot_device_path(int32_t bootindex, DeviceState *dev, |
|
708 |
const char *suffix) |
|
709 |
{ |
|
710 |
FWBootEntry *node, *i; |
|
711 |
|
|
712 |
if (bootindex < 0) { |
|
713 |
return; |
|
714 |
} |
|
715 |
|
|
716 |
assert(dev != NULL || suffix != NULL); |
|
717 |
|
|
718 |
node = qemu_mallocz(sizeof(FWBootEntry)); |
|
719 |
node->bootindex = bootindex; |
|
720 |
node->suffix = strdup(suffix); |
|
721 |
node->dev = dev; |
|
722 |
|
|
723 |
QTAILQ_FOREACH(i, &fw_boot_order, link) { |
|
724 |
if (i->bootindex == bootindex) { |
|
725 |
fprintf(stderr, "Two devices with same boot index %d\n", bootindex); |
|
726 |
exit(1); |
|
727 |
} else if (i->bootindex < bootindex) { |
|
728 |
continue; |
|
729 |
} |
|
730 |
QTAILQ_INSERT_BEFORE(i, node, link); |
|
731 |
return; |
|
732 |
} |
|
733 |
QTAILQ_INSERT_TAIL(&fw_boot_order, node, link); |
|
734 |
} |
|
735 |
|
|
696 | 736 |
static void numa_add(const char *optarg) |
697 | 737 |
{ |
698 | 738 |
char option[128]; |
Also available in: Unified diff