From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: sharing a (mostly) read-only virtual block device Date: Sun, 18 Oct 2009 16:02:20 +0900 Message-ID: <4ADABD7C.50803@redhat.com> References: <4AD84EB5.5070200@nagafix.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: Antoine Martin Return-path: Received: from mx1.redhat.com ([209.132.183.28]:7476 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752329AbZJRHCV (ORCPT ); Sun, 18 Oct 2009 03:02:21 -0400 In-Reply-To: <4AD84EB5.5070200@nagafix.co.uk> Sender: kvm-owner@vger.kernel.org List-ID: On 10/16/2009 07:45 PM, Antoine Martin wrote: > Hi, > > Is there an easy way that I have missed to share a virtual disk > read-only between many guests whilst still having the ability to update > it occasionally from the host? > > That's very fragile, since the guest won't expect the disk to change under its feet. Expect oopses. > I was hoping I could use a shared image file, and occasionally replace > it with an updated version (move old copy to disk_image.bak, copy new > image to disk_image), then the guests could umount/mount the drive and > get access to the new disk image. > > Unfortunately qemu opens the virtual disk as soon as the guest boots, so > the file descriptor still points to the old image. > Note: I do not want to use the qemu monitor from the host as I want the > guests to be in charge of when/if they get the new disk image. > > I suggest using a monitor, and have the host and guest coordinate the change (guest unmounts, host modifies, guest mounts). Alternatively, export the disk from the host using nfs. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.