Uri Lublin wrote:
Anthony, this is a problem with qemu-upstream so I'd like to solve it
in a way that's acceptable for upstream.
The proposed patch is less that ideal IMO as it introduces
limitations on what you can do with a file. An alternative
implementation would add a read/write mode to the buffer, based on
the last access type. When switching from read to write, we drop the
buffer, and when switching from write to read, we flush it and then
drop it. This is more complex but results in a cleaner API.
I am not sure we are allowed to drop the buffer a on read-to-write
switch, especially if there are unread bytes in it. We may need to
pause the write that causes the switch, similar to pausing the read in
order to flush the buffer on a write-to-read switch.
Yeah, I tried to implement the read/write mode buffer and it ends up not
to work very nicely. I don't remember the precise issue, but I hit some
sort of wall that I thought was a fundamental limitation. I ended up
forcing the QEMUFile to be in either read or write mode similar to your
original patch without introducing a new option as an argument.
Regards,
Anthony Liguori
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html