From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: Anthony Lannuzel <anthony.lannuzel@hynesim.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] bidirectional data exchange between guest and host without network
Date: Tue, 7 Jul 2009 10:12:04 -0400 [thread overview]
Message-ID: <20090707141204.GL15751@csclub.uwaterloo.ca> (raw)
In-Reply-To: <53352.89.3.148.243.1246972290.squirrel@webmail.aql.fr>
On Tue, Jul 07, 2009 at 03:11:30PM +0200, Anthony Lannuzel wrote:
> Hi, thanks for replying.
>
> I have just tried the following:
>
> On the host I create a fat partition on /dev/sda8. Then I run
>
> kvm -hda $IMG -drive file=/dev/sda8,if=virtio -cdrom /dev/cdrom -m 192
>
> In the guest in do the following:
>
> sudo mount /dev/vda /mnt/shared
> sudo touch /mnt/shared/guestFile
>
> On the host I mount the partition :
>
> sudo mount /dev/sda8 /tmp/qemuShare
>
> I can see the file guestFile.
>
> Then both the host and guest add a file in the shared directory
> (newHostFile and newGuestFile), but the other one does not see the change.
> And when the guest unmounts /dev/vda, the hosts sees the 2 files written
> by the guest (guestFile and newGuestFile) and loses its own file
> (newHostFile).
>
> It looks like I can not mount this block device from two OSs at the same
> time, but isn't that virtio's purpose ?
>
> I see a dirty workaround: sharing two partitions, one for the host to
> write and one for the guest to write. But it still seems the writer has to
> unmount /dev/sda8 for the data to be written on the other side. Am I wrong
Most filesystems do not support simultanious mounting. Besides, allowing
multiple mounts at once would make any use of caching imposible.
Almost certainly what you are seeing is caused by caching since each
OS has no reason to believe what it read before isn't still valid so it
uses the cache. After all it is normally safe to assume that the data
on disk can't change unless you write to it.
Some filesystems probably exist for high availability use to allow a
SAN to be mounted in multiple places at once.
--
Len Sorensen
next prev parent reply other threads:[~2009-07-07 14:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 8:45 [Qemu-devel] bidirectional data exchange between guest and host without network Anthony Lannuzel
2009-07-07 9:02 ` Jamie Lokier
2009-07-07 13:11 ` Anthony Lannuzel
2009-07-07 14:12 ` Lennart Sorensen [this message]
2009-07-07 14:39 ` Jamie Lokier
2009-07-08 10:03 ` Anthony Lannuzel
2009-07-08 13:31 ` Lennart Sorensen
2009-07-11 0:01 ` Jamie Lokier
2009-07-08 13:34 ` Paul Brook
2009-07-08 13:57 ` Jamie Lokier
2009-07-09 7:51 ` Anthony Lannuzel
2009-07-11 0:04 ` Jamie Lokier
2009-07-12 9:02 ` Richard W.M. Jones
2009-07-13 22:38 ` Jamie Lokier
2009-07-14 5:54 ` Richard W.M. Jones
2009-07-16 7:46 ` Amit Shah
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=20090707141204.GL15751@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=anthony.lannuzel@hynesim.org \
--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).