Comment 23 for bug 832507

I don't understand what the file argument would mean. Once you write() to a file, QEMU no longer can implement a ring buffer (it cannot discard written data). You would need to do something like the following:

qemu -chardev memchr,max-capacity=640k,id=foo -serial chardev:foo

And then introduce QMP commands like:

{ 'command': 'memchr-read', 'arguments': { 'chardev': 'str', 'size': 'int' }, 'returns': 'str' }

We already have a memory character device that we don't expose externally yet. It's just a matter of implementing a ring queue behavior and plumbing things up. I think it's entirely reasonable and perhaps would even be something that libvirt would prefer to use in the long term over ptys.

Would also be good for unit testing.