[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 1/6] Make fw_cfg interface 32-bit aware

From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH 1/6] Make fw_cfg interface 32-bit aware
Date: Wed, 11 Nov 2009 16:22:51 -0600
User-agent: Thunderbird (X11/20090825)

Alexander Graf wrote:
Anthony Liguori wrote:
Alexander Graf wrote:
The fw_cfg interface can only handle up to 16 bits of data for its
While that isn't too much of a problem when handling integers, we would
like to stream full kernel images over that interface!

So let's extend it to 32 bit length variables.

Signed-off-by: Alexander Graf <address@hidden>
 hw/fw_cfg.c |    8 ++++----
 hw/fw_cfg.h |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index a6d811b..3a3f694 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -39,7 +39,7 @@
 #define FW_CFG_SIZE 2
typedef struct _FWCfgEntry {
-    uint16_t len;
+    uint32_t len;
     uint8_t *data;
     void *callback_opaque;
     FWCfgCallback callback;
@@ -48,7 +48,7 @@ typedef struct _FWCfgEntry {
 typedef struct _FWCfgState {
     FWCfgEntry entries[2][FW_CFG_MAX_ENTRY];
     uint16_t cur_entry;
-    uint16_t cur_offset;
+    uint32_t cur_offset;
 } FWCfgState;
static void fw_cfg_write(FWCfgState *s, uint8_t value)
@@ -171,12 +171,12 @@ static const VMStateDescription vmstate_fw_cfg = {
     .minimum_version_id_old = 1,
     .fields      = (VMStateField []) {
         VMSTATE_UINT16(cur_entry, FWCfgState),
-        VMSTATE_UINT16(cur_offset, FWCfgState),
+        VMSTATE_UINT32(cur_offset, FWCfgState),
-int fw_cfg_add_bytes(void *opaque, uint16_t key, uint8_t *data,
uint16_t len)
+int fw_cfg_add_bytes(void *opaque, uint16_t key, uint8_t *data,
uint32_t len)
     FWCfgState *s = opaque;
     int arch = !!(key & FW_CFG_ARCH_LOCAL);
We need to bump a version here.

Sure - which one?

The version_id field in vmstate_fw_cfg. You also have to try to support older versions which means you may want to either split cur_offset into a high and low or ask Juan what the appropriate vodoo would be.


Anthony Liguori


reply via email to

[Prev in Thread] Current Thread [Next in Thread]