From: "John R. Hogerhuis" <jhoger@pobox.com>
To: qemu-devel@nongnu.org, Henrik Nordstrom <hno@marasystems.com>
Subject: Re: [Qemu-devel] Looking for an easy way to exchange data bidirectional between host and guest (including some suggestion)
Date: Tue, 07 Jun 2005 23:12:07 -0700 [thread overview]
Message-ID: <1118211127.9735.178.camel@aragorn> (raw)
In-Reply-To: <Pine.LNX.4.61.0506080006270.13848@filer.marasystems.com>
On Wed, 2005-06-08 at 00:15 +0200, Henrik Nordstrom wrote:
> On Mon, 6 Jun 2005, John R. Hogerhuis wrote:
>
> > I can think of some reasons for a non-native file service that is
> > instead built into QEMU:
>
> vvfat?
>
> > e) Scripts to be used across farms of QEMU virtual machines will have
> > more commonalities even across different OSes. The event and content of
> > a file popping up on a machine in a given directory is a very basic form
> > of inter-process communication common in business operations.
>
> Using something like vvfat for bi-directional IPC would be a very bad
> move. Most guests doesn't guarantee data written on a local drive gets
> commited to the drive in a timely fashion (can be anywhere from seconds to
> many minutes before the data is actually written).
>
For the kind of thing I'm referring to is not usually very time
critical. The resolution is on the order of 15 to 30 minutes to an
hour... some stores get polled for data, the accounting system imports
the data and generates some reports which feed into other systems, etc.
Nothing particularly time critical.
Often you have a process which comes through periodically polling for
files. And it's usually not bidirectional communication but I don't know
if that matters much. You are alluding to the problem with these
approaches of two different processes acting like they own the virtual
hardware. The only thing that can make it work is that in reality QEMU
actually owns the virtual drive, and just needs to present a clear
illusion to the guest that it is so. If some rules are followed by the
guest it is possible without any difficulty to write without stepping on
the guest's toes. For example if an entire drive or partition were made
read-only to the guest that would solve the problem. Without that
assumption it gets more complex depending on the file system type and
how the os treats it.
But certainly I agree it is an inherently difficult problem.
> Even if vvfat can provide what to the guest looks like FAT block
> device access to a directory of files on the host the directory must not
> be touched in any manner while qemu is accessing it. Providing this kind
> of emulation is complex enough as it is.
>
> What vvfat does is that it emulates a FAT formatted block device from a
> directory of files on the host. Currently this emulation is read-only
> (mostly) but it is moving towards read-write access which will when
> completed allow the guest to not only read the files but also write new
> content. But it is important to understand that write access is far from
> trivial. The vvfat driver have to piece together the block level writes
> performed by the guest and reconstruct the filestructure to know what
> files to map this to on the host. It is not like the guest tells vvfat
> which file it is writing to.
Of course, if I understand what you are saying it doesn't have to tell
vvfat though... all events pass through QEMU so you have a place to hook
events and there's no polling involved. The more stupid the guest's file
structure, the more feasible such a solution becomes. "Open/create" and
"write" and "seek" should be possible to recover, efficiently even, if
you maintain a hash table or other data structure which lets you go from
block # to file (or block # to free space).
I guess the event you would be missing is "close," but a idle timeout is
probably a decent heuristic. Also if the file is locked, that would have
to be mimiced.
-- John.
next prev parent reply other threads:[~2005-06-08 6:16 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-03 13:57 [Qemu-devel] Looking for an easy way to exchange data bidirectional between host and guest (including some suggestion) Jan Marten Simons
2005-06-05 19:17 ` Henrik Nordstrom
2005-06-06 14:28 ` Jim C. Brown
2005-06-07 21:45 ` Henrik Nordstrom
2005-06-08 18:24 ` Jim C. Brown
2005-06-09 11:56 ` Henrik Nordstrom
2005-06-11 20:58 ` Jim C. Brown
2005-06-11 21:29 ` Christian MICHON
2005-06-13 0:14 ` Henrik Nordstrom
2005-06-13 8:59 ` Christian MICHON
2005-06-13 11:55 ` Jernej Simonèiè
2005-06-13 12:52 ` Christian MICHON
2005-06-14 19:49 ` John R. Hogerhuis
2005-06-14 20:00 ` Christian MICHON
2005-06-15 13:40 ` Henrik Nordstrom
2005-06-14 20:33 ` Jim C. Brown
2005-06-15 13:43 ` Henrik Nordstrom
2005-06-13 0:02 ` Henrik Nordstrom
2005-06-13 0:22 ` Paul Brook
2005-06-06 18:11 ` marten
2005-06-06 19:55 ` Jim C. Brown
2005-06-06 23:38 ` Jan Marten Simons
2005-06-07 16:16 ` Johannes Schindelin
2005-06-07 21:52 ` Henrik Nordstrom
2005-06-08 18:27 ` Jim C. Brown
2005-06-07 21:50 ` Henrik Nordstrom
2005-06-06 23:54 ` John R. Hogerhuis
2005-06-07 8:40 ` Christian MICHON
2005-06-07 22:59 ` Henrik Nordstrom
2005-06-08 6:43 ` Christian MICHON
2005-06-08 7:55 ` Henrik Nordstrom
2005-06-08 11:22 ` Christian MICHON
2005-06-08 12:25 ` Henrik Nordstrom
2005-06-08 22:31 ` Jan Marten Simons
2005-06-08 23:50 ` Jim C. Brown
2005-06-21 14:17 ` Jan Marten Simons
2005-06-21 20:02 ` Jim C. Brown
2005-06-21 21:39 ` Paul Brook
2005-06-21 21:47 ` Jim C. Brown
2005-06-09 16:33 ` Johannes Schindelin
2005-06-10 13:45 ` Jan Marten Simons
2005-06-07 22:15 ` Henrik Nordstrom
2005-06-08 6:12 ` John R. Hogerhuis [this message]
2005-06-08 7:52 ` Henrik Nordstrom
2005-06-08 11:22 ` Johannes Schindelin
2005-06-09 11:48 ` Henrik Nordstrom
2005-06-09 16:26 ` Johannes Schindelin
2005-06-08 18:33 ` Jim C. Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1118211127.9735.178.camel@aragorn \
--to=jhoger@pobox.com \
--cc=hno@marasystems.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).