On Tue, May 07, 2013 at 07:33:13PM +0300, Michael S. Tsirkin wrote:
If you really feel QEMU should direct the pointer and checksum updates, you might want to consider something like:
struct tabledeploy_s { u32 command; union { // COMMAND_ALLOC - allocate a table from the given "file" struct { char alloc_file[FILESZ]; u32 alloc_align; u8 alloc_zone; };
// COMMAND_PATCH - patch the table (originating from // "dest_file") to a pointer to the table originating from // "src_file". struct { char patch_dest_file[FILESZ]; char patch_src_file[FILESZ]; u32 patch_offset; u8 patch_size; };
I think ADD is better since this way we can use not the start of table, but something in the middle. For example, a single fw_cfg can give us multiple tables, it should be up to QEMU.
It's equivalent to PATCH if the original data is 0.
// COMMAND_CHECKSUM - Update a checksum in a table struct { char cksum_file[FILESZ]; u32 cksum_offset; u32 cksum_start; u32 cksum_length; };
Same here. So I would do:
COMMAND_ADD_POINTER
COMMAND_ADD_CHECKSUM
That's fine.
-Kevin