From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOBP0-0007Qy-GG for qemu-devel@nongnu.org; Tue, 07 Jul 2009 10:12:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOBOw-0007LW-KY for qemu-devel@nongnu.org; Tue, 07 Jul 2009 10:12:10 -0400 Received: from [199.232.76.173] (port=39417 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOBOw-0007LK-GO for qemu-devel@nongnu.org; Tue, 07 Jul 2009 10:12:06 -0400 Received: from caffeine.csclub.uwaterloo.ca ([129.97.134.17]:46423) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOBOw-0007Qt-7f for qemu-devel@nongnu.org; Tue, 07 Jul 2009 10:12:06 -0400 Date: Tue, 7 Jul 2009 10:12:04 -0400 Subject: Re: [Qemu-devel] bidirectional data exchange between guest and host without network Message-ID: <20090707141204.GL15751@csclub.uwaterloo.ca> References: <59673.89.3.148.243.1246956346.squirrel@webmail.aql.fr> <20090707090213.GB5690@shareable.org> <53352.89.3.148.243.1246972290.squirrel@webmail.aql.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53352.89.3.148.243.1246972290.squirrel@webmail.aql.fr> From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Lannuzel Cc: qemu-devel@nongnu.org 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