From patchwork Mon Nov 25 07:27:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 293838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CEBD72C011C for ; Mon, 25 Nov 2013 18:30:43 +1100 (EST) Received: from localhost ([::1]:50034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkqcz-00056H-9z for incoming@patchwork.ozlabs.org; Mon, 25 Nov 2013 02:30:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkqai-0001oo-Mp for qemu-devel@nongnu.org; Mon, 25 Nov 2013 02:28:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkqaa-000535-80 for qemu-devel@nongnu.org; Mon, 25 Nov 2013 02:28:20 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:35862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkqaX-00051x-Hk for qemu-devel@nongnu.org; Mon, 25 Nov 2013 02:28:12 -0500 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 Nov 2013 17:27:54 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 25 Nov 2013 17:27:51 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 3D6422CE805A; Mon, 25 Nov 2013 18:27:51 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAP7RYoF61145336; Mon, 25 Nov 2013 18:27:39 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAP7Rj9x018392; Mon, 25 Nov 2013 18:27:46 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.190.163.12]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rAP7RhvH018369; Mon, 25 Nov 2013 18:27:44 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.190.164.82]) by ozlabs.au.ibm.com (Postfix) with ESMTP id C0E63A0240; Mon, 25 Nov 2013 18:27:43 +1100 (EST) Received: from ka1.ozlabs.ibm.com (ka1.ozlabs.ibm.com [10.61.145.11]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 2893F16A964; Mon, 25 Nov 2013 18:27:43 +1100 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Mon, 25 Nov 2013 18:27:36 +1100 Message-Id: <1385364460-24332-2-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.8.4.rc4 In-Reply-To: <1385364460-24332-1-git-send-email-aik@ozlabs.ru> References: <1385364460-24332-1-git-send-email-aik@ozlabs.ru> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13112507-6102-0000-0000-0000048FF2B9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.145 Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Paul Mackerras , Nikunj A Dadhania Subject: [Qemu-devel] [PATCH 1/5] boot: extend get_boot_devices_list() to ignore suffixes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. Signed-off-by: Alexey Kardashevskiy --- hw/nvram/fw_cfg.c | 2 +- include/sysemu/sysemu.h | 2 +- vl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index f5dc3ea..4d0c76f 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 495dae8..2b71a4a 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -185,7 +185,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 8d5d874..aefc11a 100644 --- a/vl.c +++ b/vl.c @@ -1211,7 +1211,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; @@ -1226,7 +1226,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); @@ -1234,7 +1234,7 @@ 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); }