|
|
9ae3a8 |
From 3090a6d3f085dea8f7f6539bf12709cd79d57cb4 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
Message-Id: <3090a6d3f085dea8f7f6539bf12709cd79d57cb4.1387298827.git.minovotn@redhat.com>
|
|
|
9ae3a8 |
In-Reply-To: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
|
|
|
9ae3a8 |
References: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
|
|
|
9ae3a8 |
From: "Michael S. Tsirkin" <mst@redhat.com>
|
|
|
9ae3a8 |
Date: Tue, 17 Dec 2013 15:18:28 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 36/56] loader: use file path size from fw_cfg.h
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1387293161-4085-37-git-send-email-mst@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 56342
|
|
|
9ae3a8 |
O-Subject: [PATCH qemu-kvm RHEL7.0 v2 36/57] loader: use file path size from fw_cfg.h
|
|
|
9ae3a8 |
Bugzilla: 1034876
|
|
|
9ae3a8 |
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Avoid a bit of code duplication, make
|
|
|
9ae3a8 |
max file path constant reusable.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Suggested-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
Tested-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 35c12e60c840bc4840cbbe3f6ca514a53b2e36bc)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
include/hw/nvram/fw_cfg.h | 4 +++-
|
|
|
9ae3a8 |
hw/core/loader.c | 2 +-
|
|
|
9ae3a8 |
2 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Michal Novotny <minovotn@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/core/loader.c | 2 +-
|
|
|
9ae3a8 |
include/hw/nvram/fw_cfg.h | 4 +++-
|
|
|
9ae3a8 |
2 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/core/loader.c b/hw/core/loader.c
|
|
|
9ae3a8 |
index 2bfff48..ab4c7bd 100644
|
|
|
9ae3a8 |
--- a/hw/core/loader.c
|
|
|
9ae3a8 |
+++ b/hw/core/loader.c
|
|
|
9ae3a8 |
@@ -629,7 +629,7 @@ int rom_add_file(const char *file, const char *fw_dir,
|
|
|
9ae3a8 |
rom_insert(rom);
|
|
|
9ae3a8 |
if (rom->fw_file && fw_cfg) {
|
|
|
9ae3a8 |
const char *basename;
|
|
|
9ae3a8 |
- char fw_file_name[56];
|
|
|
9ae3a8 |
+ char fw_file_name[FW_CFG_MAX_FILE_PATH];
|
|
|
9ae3a8 |
void *data;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
basename = strrchr(rom->fw_file, '/');
|
|
|
9ae3a8 |
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
|
|
|
9ae3a8 |
index 2ab0fc2..72b1549 100644
|
|
|
9ae3a8 |
--- a/include/hw/nvram/fw_cfg.h
|
|
|
9ae3a8 |
+++ b/include/hw/nvram/fw_cfg.h
|
|
|
9ae3a8 |
@@ -46,12 +46,14 @@
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
#define FW_CFG_INVALID 0xffff
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+#define FW_CFG_MAX_FILE_PATH 56
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
#ifndef NO_QEMU_PROTOS
|
|
|
9ae3a8 |
typedef struct FWCfgFile {
|
|
|
9ae3a8 |
uint32_t size; /* file size */
|
|
|
9ae3a8 |
uint16_t select; /* write this to 0x510 to read it */
|
|
|
9ae3a8 |
uint16_t reserved;
|
|
|
9ae3a8 |
- char name[56];
|
|
|
9ae3a8 |
+ char name[FW_CFG_MAX_FILE_PATH];
|
|
|
9ae3a8 |
} FWCfgFile;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
typedef struct FWCfgFiles {
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.11.7
|
|
|
9ae3a8 |
|