[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL for-2.0 08/13] vl.c: Extend get_boot_devices_list() to
From: |
Andreas Färber |
Subject: |
[Qemu-ppc] [PULL for-2.0 08/13] vl.c: Extend get_boot_devices_list() to ignore suffixes |
Date: |
Thu, 20 Mar 2014 02:48:50 +0100 |
From: Alexey Kardashevskiy <address@hidden>
As suffixes do not make sense for sPAPR's device tree and
there is no way to filter them out on the BusState::get_fw_dev_path()
level, let's add an ability for the external caller to specify
whether to apply suffixes or not.
We could handle suffixes in SLOF (ignored for now) but this would require
serious rework in the node opening code in SLOF, which has no obvious
benefit for the currently emulated sPAPR machine.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/nvram/fw_cfg.c | 2 +-
include/sysemu/sysemu.h | 2 +-
vl.c | 8 +++++---
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index cb36dc2..282341a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -504,7 +504,7 @@ static void fw_cfg_machine_ready(struct Notifier *n, void
*data)
{
size_t len;
FWCfgState *s = container_of(n, FWCfgState, machine_ready);
- char *bootindex = get_boot_devices_list(&len);
+ char *bootindex = get_boot_devices_list(&len, false);
fw_cfg_add_file(s, "bootorder", (uint8_t*)bootindex, len);
}
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index c01304d..3915ce3 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -186,7 +186,7 @@ void rtc_change_mon_event(struct tm *tm);
void add_boot_device_path(int32_t bootindex, DeviceState *dev,
const char *suffix);
-char *get_boot_devices_list(size_t *size);
+char *get_boot_devices_list(size_t *size, bool ignore_suffixes);
DeviceState *get_boot_device(uint32_t position);
diff --git a/vl.c b/vl.c
index f0fe48b..1adc8f4 100644
--- a/vl.c
+++ b/vl.c
@@ -1209,7 +1209,7 @@ DeviceState *get_boot_device(uint32_t position)
* memory pointed by "size" is assigned total length of the array in bytes
*
*/
-char *get_boot_devices_list(size_t *size)
+char *get_boot_devices_list(size_t *size, bool ignore_suffixes)
{
FWBootEntry *i;
size_t total = 0;
@@ -1224,7 +1224,7 @@ char *get_boot_devices_list(size_t *size)
assert(devpath);
}
- if (i->suffix && devpath) {
+ if (i->suffix && !ignore_suffixes && devpath) {
size_t bootpathlen = strlen(devpath) + strlen(i->suffix) + 1;
bootpath = g_malloc(bootpathlen);
@@ -1232,9 +1232,11 @@ char *get_boot_devices_list(size_t *size)
g_free(devpath);
} else if (devpath) {
bootpath = devpath;
- } else {
+ } else if (!ignore_suffixes) {
assert(i->suffix);
bootpath = g_strdup(i->suffix);
+ } else {
+ bootpath = g_strdup("");
}
if (total) {
--
1.8.4.5
- [Qemu-ppc] [PULL for-2.0-rc1 00/13] PowerPC patch queue 2014-03-20 #2, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 06/13] target-ppc: Introduce powerisa-207-server flag, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 03/13] target-ppc: Reset SPRs on CPU reset, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 04/13] target-ppc: Fix overallocation of opcode tables, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 07/13] spapr_hcall: Fix little-endian resource handling in H_SET_MODE, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 10/13] spapr_llan: Add to boot device list, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 01/13] target-ppc: Add missing 'static' and 'const' attributes, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 09/13] qdev: Introduce FWPathProvider interface, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 05/13] target-ppc: Force CPU threads count to be a power of 2, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 08/13] vl.c: Extend get_boot_devices_list() to ignore suffixes,
Andreas Färber <=
- [Qemu-ppc] [PULL for-2.0 02/13] spapr_hcall: Fix h_enter to loop correctly, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 11/13] spapr_vio: Fix firmware names, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 13/13] spapr: Implement interface to fix device pathname, Andreas Färber, 2014/03/19
- [Qemu-ppc] [PULL for-2.0 12/13] spapr: QOM'ify pseries machine, Andreas Färber, 2014/03/19
- Re: [Qemu-ppc] [PULL for-2.0-rc1 00/13] PowerPC patch queue 2014-03-20 #2, Peter Maydell, 2014/03/20