From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DzIZb-0001C8-0G for qemu-devel@nongnu.org; Sun, 31 Jul 2005 14:30:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DzIZN-00018c-9y for qemu-devel@nongnu.org; Sun, 31 Jul 2005 14:29:54 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DzIZN-00014S-3r for qemu-devel@nongnu.org; Sun, 31 Jul 2005 14:29:53 -0400 Received: from [131.111.8.137] (helo=ppsw-7.csi.cam.ac.uk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DzIdo-0002oZ-2t for qemu-devel@nongnu.org; Sun, 31 Jul 2005 14:34:28 -0400 From: Mark Williamson Subject: Re: [Qemu-devel] Re: file system sharing Date: Sun, 31 Jul 2005 19:21:05 +0100 References: <200507310258.13169.mark.williamson@cl.cam.ac.uk> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507311921.06741.mark.williamson@cl.cam.ac.uk> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Eric S. Johansson" > Mark Williamson wrote: > > If only one machine (host or guest) has mounted the device then it should > > always be safe to do this. You may get away with read only mounting in > > one and writing in the other but it's not a reliable solution. Never > > allow more than one writer to the filesystem - this does bad things to > > your filesystem! > > I am well aware of these issues having worked on filesystems in the > 1980s and having designed and built one of the first RPC based networked > filesystems in the late 80s for a CAD/CAM company. To this day the nova > architecture gives me the willies. Ah yes. Somehow whenever I work on a substantial project, I'm left with a new phobia ;-) Just thought I'd mention it - I've hosed my own filesystems in similar ways (admittedly I should have thought what I was doing). > I suspect based on a comment that someone else made about caching that I > would need some sort of event to trigger a flush either by an explicit > flush call or a close. Would unmounting the disk image create such an > event? As far as QEmu's block layer is concerned? Good question - I don't know enough about its internals to comment. Can anyone verify if QEmu does internal caching for block IOs? (or anything else that'd cause coherency problems here, e.g. async IOs seem a likely candidate). > > If you're using a file-based disk and it's partitioned you'll need to use > > lomount > > http://www.dad-answers.com/qemu/utilities/QEMU-HD-Mounter/lomount/ to > > mount the right partition in the host. > > so what I can do is create the partition image on the host, start up > qemu with that multi-partition disk image, do what I need to in qemu, > shut down qemu and then I have a modified disk image. if I need to > modify it from the host, then I can use lomount to make it accessible as > the local filesystem. Yep. You *could* take a disk file and format it all with one filesystem, which would make it directly mountable under the guest Linux. However, the Linux loop driver doesn't like /partitioned/ "file disks" - lomount sorts this out in userspace by just mounting one partition at a time. My thought was that if you were using (say) an image of a USB key, it'd probably have a partition table on it. > > I imagine just giving the guest access to the device file would work. > > I'm not entirely sure how to do that. would I just do something like: > > -hdc /dev/sda1 > > as part of the command line? That might work. Alternatively, exporting the whole device -hdc /dev/sda might be worth a try. Can't say I've ever tried it (so far!) The alternative would be to use some network-based solution. I'm sure you've thought of that but I seem to remember a user-friendly way of letting a QEmu guest access an SMB share, which would make it rather more convenient to set up. Cheers, Mark