[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] bidirectional data exchange between guest and host with

From: Lennart Sorensen
Subject: Re: [Qemu-devel] bidirectional data exchange between guest and host without network
Date: Tue, 7 Jul 2009 10:12:04 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]